pairinteraction
A Rydberg Interaction Calculator
pairinteraction::utils Namespace Reference

Data Structures

struct  hash
 Hash function. More...
 
struct  hash< Parity >
 
struct  hash< std::array< T, N > >
 
struct  hash< std::complex< T > >
 
struct  hash< std::vector< T > >
 

Functions

bool is_sorting (TransformationType label)
 
template<typename T >
void hash_combine (std::size_t &seed, T const &v)
 Combine hashes. More...
 
template<typename It >
std::size_t hash_range (It first, It last)
 Combine hashes of values in a range. More...
 
size_t get_linearized_id_in_database (size_t id, double quantum_number_m)
 
template<typename Scalar >
Eigen::SparseMatrix< Scalar, Eigen::RowMajor > calculate_tensor_product (const std::shared_ptr< const BasisPair< Scalar > > &basis_initial, const std::shared_ptr< const BasisPair< Scalar > > &basis_final, const Eigen::SparseMatrix< Scalar, Eigen::RowMajor > &matrix1, const Eigen::SparseMatrix< Scalar, Eigen::RowMajor > &matrix2)
 
template Eigen::SparseMatrix< double, Eigen::RowMajor > calculate_tensor_product (const std::shared_ptr< const BasisPair< double > > &, const std::shared_ptr< const BasisPair< double > > &, const Eigen::SparseMatrix< double, Eigen::RowMajor > &, const Eigen::SparseMatrix< double, Eigen::RowMajor > &)
 
template Eigen::SparseMatrix< std::complex< double >, Eigen::RowMajor > calculate_tensor_product (const std::shared_ptr< const BasisPair< std::complex< double > > > &, const std::shared_ptr< const BasisPair< std::complex< double > > > &, const Eigen::SparseMatrix< std::complex< double >, Eigen::RowMajor > &, const Eigen::SparseMatrix< std::complex< double >, Eigen::RowMajor > &)
 

Variables

constexpr size_t OFFSET = 500
 
constexpr std::string_view SQL_TERM_FOR_LINEARIZED_ID_IN_DATABASE = "id*1000+(2*m+500)::bigint"
 

Function Documentation

◆ calculate_tensor_product() [1/3]

template Eigen::SparseMatrix< double, Eigen::RowMajor > pairinteraction::utils::calculate_tensor_product ( const std::shared_ptr< const BasisPair< double > > &  ,
const std::shared_ptr< const BasisPair< double > > &  ,
const Eigen::SparseMatrix< double, Eigen::RowMajor > &  ,
const Eigen::SparseMatrix< double, Eigen::RowMajor > &   
)

◆ calculate_tensor_product() [2/3]

template<typename Scalar >
Eigen::SparseMatrix< Scalar, Eigen::RowMajor > pairinteraction::utils::calculate_tensor_product ( const std::shared_ptr< const BasisPair< Scalar > > &  basis_initial,
const std::shared_ptr< const BasisPair< Scalar > > &  basis_final,
const Eigen::SparseMatrix< Scalar, Eigen::RowMajor > &  matrix1,
const Eigen::SparseMatrix< Scalar, Eigen::RowMajor > &  matrix2 
)

Definition at line 20 of file tensor.cpp.

Referenced by pairinteraction::BasisPair< Scalar >::get_matrix_elements().

+ Here is the caller graph for this function:

◆ calculate_tensor_product() [3/3]

template Eigen::SparseMatrix< std::complex< double >, Eigen::RowMajor > pairinteraction::utils::calculate_tensor_product ( const std::shared_ptr< const BasisPair< std::complex< double > > > &  ,
const std::shared_ptr< const BasisPair< std::complex< double > > > &  ,
const Eigen::SparseMatrix< std::complex< double >, Eigen::RowMajor > &  ,
const Eigen::SparseMatrix< std::complex< double >, Eigen::RowMajor > &   
)

◆ get_linearized_id_in_database()

size_t pairinteraction::utils::get_linearized_id_in_database ( size_t  id,
double  quantum_number_m 
)
inline

Definition at line 18 of file id_in_database.hpp.

References OFFSET.

Referenced by pairinteraction::Database::get_ket().

+ Here is the caller graph for this function:

◆ hash_combine()

template<typename T >
void pairinteraction::utils::hash_combine ( std::size_t &  seed,
T const &  v 
)
inline

Combine hashes.

@function hash_combine

The implementation of hash_combine is copied from Boost but simplified.

Parameters
seedstart hash
vvalue whose hash is to be added to seed
Template Parameters
Ttype to be hashed

Definition at line 43 of file hash.hpp.

Referenced by pairinteraction::Database::Database(), hash_range(), pairinteraction::Ket::hash::operator()(), pairinteraction::KetAtom::hash::operator()(), pairinteraction::KetPair< Scalar >::hash::operator()(), and pairinteraction::utils::hash< std::complex< T > >::operator()().

+ Here is the caller graph for this function:

◆ hash_range()

template<typename It >
std::size_t pairinteraction::utils::hash_range ( It  first,
It  last 
)
inline

Combine hashes of values in a range.

@function hash_range

Parameters
firstforward iterator
lastforward iterator
Returns
combined hash
Template Parameters
Itforward iterator

Definition at line 62 of file hash.hpp.

References hash_combine().

Referenced by pairinteraction::utils::hash< std::array< T, N > >::operator()(), and pairinteraction::utils::hash< std::vector< T > >::operator()().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_sorting()

Variable Documentation

◆ OFFSET

constexpr size_t pairinteraction::utils::OFFSET = 500
constexpr

Definition at line 10 of file id_in_database.hpp.

Referenced by get_linearized_id_in_database().

◆ SQL_TERM_FOR_LINEARIZED_ID_IN_DATABASE

constexpr std::string_view pairinteraction::utils::SQL_TERM_FOR_LINEARIZED_ID_IN_DATABASE = "id*1000+(2*m+500)::bigint"
constexpr

Definition at line 15 of file id_in_database.hpp.

Referenced by pairinteraction::Database::get_basis().