Line data Source code
1 : // SPDX-FileCopyrightText: 2024 Pairinteraction Developers 2 : // SPDX-License-Identifier: LGPL-3.0-or-later 3 : 4 : #include "pairinteraction/operator/OperatorPair.hpp" 5 : 6 : #include "pairinteraction/basis/BasisPair.hpp" 7 : #include "pairinteraction/enums/OperatorType.hpp" 8 : 9 : namespace pairinteraction { 10 : 11 : template <typename Scalar> 12 64 : OperatorPair<Scalar>::OperatorPair(std::shared_ptr<const basis_t> basis) 13 64 : : Operator<OperatorPair<Scalar>>(std::move(basis)) {} 14 : 15 : template <typename Scalar> 16 114 : OperatorPair<Scalar>::OperatorPair(std::shared_ptr<const basis_t> basis, OperatorType type) 17 114 : : Operator<OperatorPair<Scalar>>(std::move(basis)) { 18 114 : if (type == OperatorType::ENERGY) { 19 114 : this->initialize_as_energy_operator(); 20 : } else { 21 0 : throw std::invalid_argument("Only OperatorType::ENERGY is supported."); 22 : } 23 114 : } 24 : 25 : // Explicit instantiations 26 : template class OperatorPair<double>; 27 : template class OperatorPair<std::complex<double>>; 28 : } // namespace pairinteraction