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 3008770 : Ket::Ket(double energy) : energy(energy) {} 10 : 11 2670788 : double Ket::get_energy() const { return energy; } 12 : 13 40691 : bool Ket::operator==(const Ket &other) const { return energy == other.energy; } 14 : 15 4220 : size_t Ket::hash::operator()(const Ket &k) const { 16 4220 : size_t seed = 0; 17 4220 : utils::hash_combine(seed, k.energy); 18 4220 : return seed; 19 : } 20 : } // namespace pairinteraction