pairinteraction
A Rydberg Interaction Calculator
pairinteraction::BasisPair< Scalar > Class Template Reference

#include <BasisPair.hpp>

+ Inheritance diagram for pairinteraction::BasisPair< Scalar >:
+ Collaboration diagram for pairinteraction::BasisPair< Scalar >:

Public Types

using Type = BasisPair< Scalar >
 
using real_t = typename traits::CrtpTraits< Type >::real_t
 
using ket_t = typename traits::CrtpTraits< Type >::ket_t
 
using ketvec_t = typename traits::CrtpTraits< Type >::ketvec_t
 
using range_t = Range< size_t >
 
using map_size_t = std::unordered_map< size_t, size_t >
 
using map_range_t = std::unordered_map< size_t, range_t >
 
using map_indices_t = std::unordered_map< std::vector< size_t >, size_t, utils::hash< std::vector< size_t > > >
 
- Public Types inherited from pairinteraction::Basis< BasisPair< Scalar > >
using scalar_t = typename traits::CrtpTraits< BasisPair< Scalar > >::scalar_t
 
using real_t = typename traits::CrtpTraits< BasisPair< Scalar > >::real_t
 
using ket_t = typename traits::CrtpTraits< BasisPair< Scalar > >::ket_t
 
using ketvec_t = typename traits::CrtpTraits< BasisPair< Scalar > >::ketvec_t
 
- Public Types inherited from pairinteraction::TransformationBuilderInterface< traits::CrtpTraits< BasisPair< Scalar > >::scalar_t >
using real_t = typename traits::NumTraits< traits::CrtpTraits< BasisPair< Scalar > >::scalar_t >::real_t
 

Public Member Functions

 BasisPair (Private, ketvec_t &&kets, map_range_t &&map_range_of_state_index2, map_indices_t &&state_indices_to_ket_index, std::shared_ptr< const BasisAtom< Scalar > > basis1, std::shared_ptr< const BasisAtom< Scalar > > basis2)
 
const range_tget_index_range (size_t state_index1) const
 
std::shared_ptr< const BasisAtom< Scalar > > get_basis1 () const
 
std::shared_ptr< const BasisAtom< Scalar > > get_basis2 () const
 
int get_ket_index_from_tuple (size_t state_index1, size_t state_index2) const
 
Eigen::VectorX< Scalar > get_amplitudes (std::shared_ptr< const KetAtom > ket1, std::shared_ptr< const KetAtom > ket2) const
 
Eigen::SparseMatrix< Scalar, Eigen::RowMajor > get_amplitudes (std::shared_ptr< const BasisAtom< Scalar > > other1, std::shared_ptr< const BasisAtom< Scalar > > other2) const
 
Eigen::VectorX< real_tget_overlaps (std::shared_ptr< const KetAtom > ket1, std::shared_ptr< const KetAtom > ket2) const
 
Eigen::SparseMatrix< real_t, Eigen::RowMajor > get_overlaps (std::shared_ptr< const BasisAtom< Scalar > > other1, std::shared_ptr< const BasisAtom< Scalar > > other2) const
 
Eigen::VectorX< Scalar > get_matrix_elements (std::shared_ptr< const ket_t >, OperatorType, int) const override
 
Eigen::SparseMatrix< Scalar, Eigen::RowMajor > get_matrix_elements (std::shared_ptr< const Type >, OperatorType, int) const override
 
Eigen::VectorX< Scalar > get_matrix_elements (std::shared_ptr< const ket_t > ket, OperatorType type1, OperatorType type2, int q1=0, int q2=0) const
 
Eigen::VectorX< Scalar > get_matrix_elements (std::shared_ptr< const KetAtom > ket1, std::shared_ptr< const KetAtom > ket2, OperatorType type1, OperatorType type2, int q1=0, int q2=0) const
 
Eigen::SparseMatrix< Scalar, Eigen::RowMajor > get_matrix_elements (std::shared_ptr< const Type > final, OperatorType type1, OperatorType type2, int q1=0, int q2=0) const
 
Eigen::SparseMatrix< Scalar, Eigen::RowMajor > get_matrix_elements (std::shared_ptr< const BasisAtom< Scalar > > final1, std::shared_ptr< const BasisAtom< Scalar > > final2, OperatorType type1, OperatorType type2, int q1=0, int q2=0) const
 
- Public Member Functions inherited from pairinteraction::Basis< BasisPair< Scalar > >
 Basis ()=delete
 
virtual ~Basis ()=default
 
bool has_quantum_number_f () const
 
bool has_quantum_number_m () const
 
bool has_parity () const
 
const ketvec_tget_kets () const
 
size_t get_number_of_states () const
 
size_t get_number_of_kets () const
 
real_t get_quantum_number_f (size_t state_index) const
 
real_t get_quantum_number_m (size_t state_index) const
 
Parity get_parity (size_t state_index) const
 
std::shared_ptr< const BasisPair< Scalar > > get_state (size_t state_index) const
 
std::shared_ptr< const ket_tget_ket (size_t ket_index) const
 
std::shared_ptr< const ket_tget_corresponding_ket (size_t state_index) const
 
std::shared_ptr< const ket_tget_corresponding_ket (std::shared_ptr< const BasisPair< Scalar > > state) const
 
size_t get_corresponding_ket_index (size_t state_index) const
 
size_t get_corresponding_ket_index (std::shared_ptr< const BasisPair< Scalar > > state) const
 
std::shared_ptr< const BasisPair< Scalar > > get_corresponding_state (size_t ket_index) const
 
std::shared_ptr< const BasisPair< Scalar > > get_corresponding_state (std::shared_ptr< const ket_t > ket) const
 
size_t get_corresponding_state_index (size_t ket_index) const
 
size_t get_corresponding_state_index (std::shared_ptr< const ket_t > ket) const
 
std::shared_ptr< const BasisPair< Scalar > > get_canonical_state_from_ket (size_t ket_index) const
 
std::shared_ptr< const BasisPair< Scalar > > get_canonical_state_from_ket (std::shared_ptr< const ket_t > ket) const
 
const Eigen::SparseMatrix< scalar_t, Eigen::RowMajor > & get_coefficients () const
 
Eigen::SparseMatrix< scalar_t, Eigen::RowMajor > & get_coefficients ()
 
Eigen::VectorX< scalar_tget_amplitudes (std::shared_ptr< const ket_t > ket) const
 
Eigen::SparseMatrix< scalar_t, Eigen::RowMajor > get_amplitudes (std::shared_ptr< const BasisPair< Scalar > > other) const
 
Eigen::VectorX< real_tget_overlaps (std::shared_ptr< const ket_t > ket) const
 
Eigen::SparseMatrix< real_t, Eigen::RowMajor > get_overlaps (std::shared_ptr< const BasisPair< Scalar > > other) const
 
virtual Eigen::VectorX< scalar_tget_matrix_elements (std::shared_ptr< const ket_t > ket, OperatorType type, int q=0) const=0
 
virtual Eigen::SparseMatrix< scalar_t, Eigen::RowMajor > get_matrix_elements (std::shared_ptr< const BasisPair< Scalar > > other, OperatorType type, int q=0) const=0
 
Iterator begin () const
 
Iterator end () const
 
const Transformation< scalar_t > & get_transformation () const override
 
Transformation< scalar_tget_rotator (real_t alpha, real_t beta, real_t gamma) const override
 
Sorting get_sorter (const std::vector< TransformationType > &labels) const override
 
std::vector< IndicesOfBlockget_indices_of_blocks (const std::vector< TransformationType > &labels) const override
 
void perform_sorter_checks (const std::vector< TransformationType > &labels) const
 
void perform_blocks_checks (const std::set< TransformationType > &unique_labels) const
 
void get_sorter_without_checks (const std::vector< TransformationType > &labels, Sorting &transformation) const
 
void get_indices_of_blocks_without_checks (const std::set< TransformationType > &unique_labels, IndicesOfBlocksCreator &blocks) const
 
std::shared_ptr< const BasisPair< Scalar > > transformed (const Transformation< scalar_t > &transformation) const
 
std::shared_ptr< const BasisPair< Scalar > > transformed (const Sorting &transformation) const
 
- Public Member Functions inherited from pairinteraction::TransformationBuilderInterface< traits::CrtpTraits< BasisPair< Scalar > >::scalar_t >
virtual ~TransformationBuilderInterface ()=default
 
virtual const Transformation< traits::CrtpTraits< BasisPair< Scalar > >::scalar_t > & get_transformation () const=0
 
virtual Transformation< traits::CrtpTraits< BasisPair< Scalar > >::scalar_t > get_rotator (real_t alpha, real_t beta, real_t gamma) const=0
 
Transformation< traits::CrtpTraits< BasisPair< Scalar > >::scalar_t > get_rotator (const std::array< real_t, 3 > &to_z_axis, const std::array< real_t, 3 > &to_y_axis) const
 
virtual Sorting get_sorter (const std::vector< TransformationType > &labels) const=0
 
virtual std::vector< IndicesOfBlockget_indices_of_blocks (const std::vector< TransformationType > &labels) const=0
 

Friends

class BasisPairCreator< Scalar >
 

Additional Inherited Members

- Protected Member Functions inherited from pairinteraction::Basis< BasisPair< Scalar > >
 Basis (ketvec_t &&kets)
 
int get_ket_index_from_ket (std::shared_ptr< const ket_t > ket) const
 
- Protected Attributes inherited from pairinteraction::Basis< BasisPair< Scalar > >
ketvec_t kets
 

Detailed Description

template<typename Scalar>
class pairinteraction::BasisPair< Scalar >

Definition at line 44 of file BasisPair.hpp.

Member Typedef Documentation

◆ ket_t

template<typename Scalar >
using pairinteraction::BasisPair< Scalar >::ket_t = typename traits::CrtpTraits<Type>::ket_t

Definition at line 54 of file BasisPair.hpp.

◆ ketvec_t

template<typename Scalar >
using pairinteraction::BasisPair< Scalar >::ketvec_t = typename traits::CrtpTraits<Type>::ketvec_t

Definition at line 55 of file BasisPair.hpp.

◆ map_indices_t

template<typename Scalar >
using pairinteraction::BasisPair< Scalar >::map_indices_t = std::unordered_map<std::vector<size_t>, size_t, utils::hash<std::vector<size_t> >>

Definition at line 59 of file BasisPair.hpp.

◆ map_range_t

template<typename Scalar >
using pairinteraction::BasisPair< Scalar >::map_range_t = std::unordered_map<size_t, range_t>

Definition at line 58 of file BasisPair.hpp.

◆ map_size_t

template<typename Scalar >
using pairinteraction::BasisPair< Scalar >::map_size_t = std::unordered_map<size_t, size_t>

Definition at line 57 of file BasisPair.hpp.

◆ range_t

template<typename Scalar >
using pairinteraction::BasisPair< Scalar >::range_t = Range<size_t>

Definition at line 56 of file BasisPair.hpp.

◆ real_t

template<typename Scalar >
using pairinteraction::BasisPair< Scalar >::real_t = typename traits::CrtpTraits<Type>::real_t

Definition at line 53 of file BasisPair.hpp.

◆ Type

template<typename Scalar >
using pairinteraction::BasisPair< Scalar >::Type = BasisPair<Scalar>

Definition at line 52 of file BasisPair.hpp.

Constructor & Destructor Documentation

◆ BasisPair()

template<typename Scalar >
pairinteraction::BasisPair< Scalar >::BasisPair ( Private  ,
ketvec_t &&  kets,
map_range_t &&  map_range_of_state_index2,
map_indices_t &&  state_indices_to_ket_index,
std::shared_ptr< const BasisAtom< Scalar > >  basis1,
std::shared_ptr< const BasisAtom< Scalar > >  basis2 
)

Definition at line 21 of file BasisPair.cpp.

Member Function Documentation

◆ get_amplitudes() [1/2]

template<typename Scalar >
Eigen::SparseMatrix< Scalar, Eigen::RowMajor > pairinteraction::BasisPair< Scalar >::get_amplitudes ( std::shared_ptr< const BasisAtom< Scalar > >  other1,
std::shared_ptr< const BasisAtom< Scalar > >  other2 
) const

Definition at line 66 of file BasisPair.cpp.

◆ get_amplitudes() [2/2]

template<typename Scalar >
Eigen::VectorX< Scalar > pairinteraction::BasisPair< Scalar >::get_amplitudes ( std::shared_ptr< const KetAtom ket1,
std::shared_ptr< const KetAtom ket2 
) const

Definition at line 57 of file BasisPair.cpp.

◆ get_basis1()

template<typename Scalar >
std::shared_ptr< const BasisAtom< Scalar > > pairinteraction::BasisPair< Scalar >::get_basis1

Definition at line 38 of file BasisPair.cpp.

◆ get_basis2()

template<typename Scalar >
std::shared_ptr< const BasisAtom< Scalar > > pairinteraction::BasisPair< Scalar >::get_basis2

Definition at line 43 of file BasisPair.cpp.

◆ get_index_range()

template<typename Scalar >
const BasisPair< Scalar >::range_t & pairinteraction::BasisPair< Scalar >::get_index_range ( size_t  state_index1) const

Definition at line 33 of file BasisPair.cpp.

◆ get_ket_index_from_tuple()

template<typename Scalar >
int pairinteraction::BasisPair< Scalar >::get_ket_index_from_tuple ( size_t  state_index1,
size_t  state_index2 
) const

Definition at line 48 of file BasisPair.cpp.

◆ get_matrix_elements() [1/6]

template<typename Scalar >
Eigen::SparseMatrix< Scalar, Eigen::RowMajor > pairinteraction::BasisPair< Scalar >::get_matrix_elements ( std::shared_ptr< const BasisAtom< Scalar > >  final1,
std::shared_ptr< const BasisAtom< Scalar > >  final2,
OperatorType  type1,
OperatorType  type2,
int  q1 = 0,
int  q2 = 0 
) const

Definition at line 189 of file BasisPair.cpp.

References pairinteraction::BasisPairCreator< Scalar >::add().

+ Here is the call graph for this function:

◆ get_matrix_elements() [2/6]

template<typename Scalar >
Eigen::VectorX< Scalar > pairinteraction::BasisPair< Scalar >::get_matrix_elements ( std::shared_ptr< const ket_t ket,
OperatorType  type1,
OperatorType  type2,
int  q1 = 0,
int  q2 = 0 
) const

Definition at line 207 of file BasisPair.cpp.

◆ get_matrix_elements() [3/6]

template<typename Scalar >
Eigen::VectorX< Scalar > pairinteraction::BasisPair< Scalar >::get_matrix_elements ( std::shared_ptr< const ket_t ,
OperatorType  ,
int   
) const
overridevirtual

Implements pairinteraction::Basis< BasisPair< Scalar > >.

Definition at line 153 of file BasisPair.cpp.

◆ get_matrix_elements() [4/6]

template<typename Scalar >
Eigen::VectorX< Scalar > pairinteraction::BasisPair< Scalar >::get_matrix_elements ( std::shared_ptr< const KetAtom ket1,
std::shared_ptr< const KetAtom ket2,
OperatorType  type1,
OperatorType  type2,
int  q1 = 0,
int  q2 = 0 
) const

Definition at line 218 of file BasisPair.cpp.

References pairinteraction::BasisPairCreator< Scalar >::add(), and pairinteraction::Basis< Derived >::get_canonical_state_from_ket().

+ Here is the call graph for this function:

◆ get_matrix_elements() [5/6]

template<typename Scalar >
Eigen::SparseMatrix< Scalar, Eigen::RowMajor > pairinteraction::BasisPair< Scalar >::get_matrix_elements ( std::shared_ptr< const Type final,
OperatorType  type1,
OperatorType  type2,
int  q1 = 0,
int  q2 = 0 
) const

Definition at line 168 of file BasisPair.cpp.

References pairinteraction::utils::calculate_tensor_product().

+ Here is the call graph for this function:

◆ get_matrix_elements() [6/6]

template<typename Scalar >
Eigen::SparseMatrix< Scalar, Eigen::RowMajor > pairinteraction::BasisPair< Scalar >::get_matrix_elements ( std::shared_ptr< const Type ,
OperatorType  ,
int   
) const
overridevirtual

Implements pairinteraction::Basis< BasisPair< Scalar > >.

Definition at line 161 of file BasisPair.cpp.

◆ get_overlaps() [1/2]

template<typename Scalar >
Eigen::SparseMatrix< typename BasisPair< Scalar >::real_t, Eigen::RowMajor > pairinteraction::BasisPair< Scalar >::get_overlaps ( std::shared_ptr< const BasisAtom< Scalar > >  other1,
std::shared_ptr< const BasisAtom< Scalar > >  other2 
) const

Definition at line 147 of file BasisPair.cpp.

◆ get_overlaps() [2/2]

template<typename Scalar >
Eigen::VectorX< typename BasisPair< Scalar >::real_t > pairinteraction::BasisPair< Scalar >::get_overlaps ( std::shared_ptr< const KetAtom ket1,
std::shared_ptr< const KetAtom ket2 
) const

Definition at line 140 of file BasisPair.cpp.

Friends And Related Function Documentation

◆ BasisPairCreator< Scalar >

template<typename Scalar >
friend class BasisPairCreator< Scalar >
friend

Definition at line 46 of file BasisPair.hpp.


The documentation for this class was generated from the following files: