pairinteraction
A Rydberg Interaction Calculator
OperatorAtom.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2024 Pairinteraction Developers
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
5
9
10#include <limits>
11
12namespace pairinteraction {
13template <typename Scalar>
14OperatorAtom<Scalar>::OperatorAtom(std::shared_ptr<const basis_t> basis)
15 : Operator<OperatorAtom<Scalar>>(std::move(basis)) {}
16
17template <typename Scalar>
18OperatorAtom<Scalar>::OperatorAtom(std::shared_ptr<const basis_t> basis, OperatorType type, int q)
19 : Operator<OperatorAtom<Scalar>>(std::move(basis)) {
20 if (type == OperatorType::ENERGY) {
22 } else {
24 this->basis->get_database().get_matrix_elements(this->basis, this->basis, type, q));
25 }
26}
27
28template <typename Scalar>
29OperatorAtom<Scalar>::OperatorAtom(std::shared_ptr<const basis_t> basis,
30 Eigen::SparseMatrix<Scalar, Eigen::RowMajor> &&matrix)
31 : Operator<OperatorAtom<Scalar>>(std::move(basis)) {
32 this->matrix = std::move(matrix);
33}
34
35// Explicit instantiations
36template class OperatorAtom<double>;
37template class OperatorAtom<std::complex<double>>;
38} // namespace pairinteraction
OperatorAtom(std::shared_ptr< const basis_t > basis)
Eigen::SparseMatrix< scalar_t, Eigen::RowMajor > matrix
Definition: Operator.hpp:87
void initialize_from_matrix(Eigen::SparseMatrix< scalar_t, Eigen::RowMajor > &&matrix)
Definition: Operator.cpp:43