Line data Source code
1 : // SPDX-FileCopyrightText: 2024 PairInteraction Developers 2 : // SPDX-License-Identifier: LGPL-3.0-or-later 3 : 4 : #include "pairinteraction/ket/Ket.hpp" 5 : 6 : #include "pairinteraction/utils/hash.hpp" 7 : 8 : namespace pairinteraction { 9 2940637 : Ket::Ket(double energy) : energy(energy) {} 10 : 11 2604089 : double Ket::get_energy() const { return energy; } 12 : 13 39331 : bool Ket::operator==(const Ket &other) const { return energy == other.energy; } 14 : 15 2873395 : size_t Ket::hash::operator()(const Ket &k) const { 16 2873395 : size_t seed = 0; 17 2873395 : utils::hash_combine(seed, k.energy); 18 2873395 : return seed; 19 : } 20 : } // namespace pairinteraction