Line data Source code
1 : // SPDX-FileCopyrightText: 2024 PairInteraction Developers 2 : // SPDX-License-Identifier: LGPL-3.0-or-later 3 : 4 : #pragma once 5 : 6 : #include <memory> 7 : #include <optional> 8 : #include <string> 9 : #include <type_traits> 10 : #include <unordered_map> 11 : 12 : namespace pairinteraction { 13 : class Database; 14 : 15 : class KetAtom; 16 : 17 : /** 18 : * @class KetAtomCreator 19 : * 20 : * @brief Builder class for creating KetAtom objects. 21 : */ 22 : class KetAtomCreator { 23 : public: 24 482 : KetAtomCreator() = default; 25 : KetAtomCreator(std::string species, int n, double l, double j, double m); 26 : KetAtomCreator &set_species(const std::string &value); 27 : KetAtomCreator &set_energy(double value); 28 : // Set the quantum number with the given logical name (e.g. "f", "m", "n", "nu", "l", ...). 29 : // The parity is set via the name "parity" with a value of +1 (even) or -1 (odd). 30 : KetAtomCreator &set_quantum_number(const std::string &name, double value); 31 : std::shared_ptr<const KetAtom> create(Database &database) const; 32 : 33 : private: 34 : std::optional<std::string> species; 35 : std::optional<double> energy; 36 : std::unordered_map<std::string, double> quantum_numbers; 37 : }; 38 : 39 : } // namespace pairinteraction