10#include <Eigen/SparseCore>
16template <
typename Derived>
19template <
typename Derived>
22template <
typename Derived>
25template <
typename Derived>
28template <
typename Derived>
29Derived &
operator+=(Operator<Derived> &lhs,
const Operator<Derived> &rhs);
31template <
typename Derived>
32Derived &
operator-=(Operator<Derived> &lhs,
const Operator<Derived> &rhs);
34template <
typename Derived>
35Derived
operator+(
const Operator<Derived> &lhs,
const Operator<Derived> &rhs);
37template <
typename Derived>
38Derived
operator-(
const Operator<Derived> &lhs,
const Operator<Derived> &rhs);
40template <
typename Derived>
52 std::shared_ptr<const basis_t>
get_basis()
const;
53 std::shared_ptr<const basis_t> &
get_basis();
55 const Eigen::SparseMatrix<scalar_t, Eigen::RowMajor> &
get_matrix()
const;
56 Eigen::SparseMatrix<scalar_t, Eigen::RowMajor> &
get_matrix();
61 std::vector<IndicesOfBlock>
70 friend Derived
operator*
72 friend Derived
operator*
74 friend Derived
operator/
86 std::shared_ptr<const basis_t>
basis;
87 Eigen::SparseMatrix<scalar_t, Eigen::RowMajor>
matrix;
90 const Derived &derived()
const;
91 Derived &derived_mutable();
const Transformation< scalar_t > & get_transformation() const override
typename traits::CrtpTraits< Derived >::real_t real_t
void initialize_as_energy_operator()
std::shared_ptr< const basis_t > basis
virtual ~Operator()=default
Operator(std::shared_ptr< const basis_t > basis)
std::shared_ptr< const basis_t > get_basis() const
Eigen::SparseMatrix< scalar_t, Eigen::RowMajor > matrix
typename traits::CrtpTraits< Derived >::scalar_t scalar_t
Derived transformed(const Transformation< scalar_t > &transformation) const
typename traits::CrtpTraits< Derived >::basis_t basis_t
void get_indices_of_blocks_without_checks(const std::set< TransformationType > &unique_labels, IndicesOfBlocksCreator &blocks) const
typename traits::CrtpTraits< Derived >::ketvec_t ketvec_t
const Eigen::SparseMatrix< scalar_t, Eigen::RowMajor > & get_matrix() const
std::vector< IndicesOfBlock > get_indices_of_blocks(const std::vector< TransformationType > &labels) const override
Transformation< scalar_t > get_rotator(real_t alpha, real_t beta, real_t gamma) const override
void initialize_from_matrix(Eigen::SparseMatrix< scalar_t, Eigen::RowMajor > &&matrix)
Sorting get_sorter(const std::vector< TransformationType > &labels) const override
Derived operator+(const Operator< Derived > &lhs, const Operator< Derived > &rhs)
Derived & operator-=(Operator< Derived > &lhs, const Operator< Derived > &rhs)
Derived operator*(const typename Operator< Derived >::scalar_t &lhs, const Operator< Derived > &rhs)
Derived & operator+=(Operator< Derived > &lhs, const Operator< Derived > &rhs)
Derived operator/(const Operator< Derived > &lhs, const typename Operator< Derived >::scalar_t &rhs)
Derived operator-(const Operator< Derived > &lhs, const Operator< Derived > &rhs)
Helper struct to extract types from a derived basis type. Must be specialized for each derived basis ...