mpqc::PrimitiveOperator< Nc, Na, Index1 > Class Template Reference

Documentation

template<size_t Nc, size_t Na, typename Index1>
class mpqc::PrimitiveOperator< Nc, Na, Index1 >

basic non-conserving operator in sp representation

Template Parameters
Ncnumber of created particles
Nanumber of annihilated particles

Public Types

using state_index_type = Index1
 

Public Member Functions

 PrimitiveOperator ()=default
 
template<typename Int = state_index_type>
 PrimitiveOperator (const std::array< Int, Nc > &t, const std::array< Int, Na > &f)
 
const std::array< state_index_type, Nc > & cre () const
 
const std::array< state_index_type, Na > & ann () const
 
PrimitiveOperator< Na, Nc > adjoint () const
 
template<typename String >
void apply_to (String &os) const
 
template<typename String >
void apply_to_unsafe (String &os) const
 
template<typename String >
std::decay_t< String > apply (String &&os) const
 
template<typename String >
std::decay_t< String > apply_unsafe (String &&os) const
 
template<typename FString >
bool sign (const FString &s) const
 
template<typename FString >
bool sign_apply_to (FString &os) const
 
template<typename FString >
std::pair< bool, std::decay_t< FString > > operator() (FString &&os) const
 

Member Typedef Documentation

◆ state_index_type

template<size_t Nc, size_t Na, typename Index1 >
using mpqc::PrimitiveOperator< Nc, Na, Index1 >::state_index_type = Index1

Constructor & Destructor Documentation

◆ PrimitiveOperator() [1/2]

template<size_t Nc, size_t Na, typename Index1 >
mpqc::PrimitiveOperator< Nc, Na, Index1 >::PrimitiveOperator ( )
default

◆ PrimitiveOperator() [2/2]

template<size_t Nc, size_t Na, typename Index1 >
template<typename Int = state_index_type>
mpqc::PrimitiveOperator< Nc, Na, Index1 >::PrimitiveOperator ( const std::array< Int, Nc > &  t,
const std::array< Int, Na > &  f 
)
inline

Member Function Documentation

◆ adjoint()

template<size_t Nc, size_t Na, typename Index1 >
PrimitiveOperator<Na, Nc> mpqc::PrimitiveOperator< Nc, Na, Index1 >::adjoint ( ) const
inline
Returns
the adjoint of this operator

◆ ann()

template<size_t Nc, size_t Na, typename Index1 >
const std::array<state_index_type, Na>& mpqc::PrimitiveOperator< Nc, Na, Index1 >::ann ( ) const
inline

reports the states in which particles are annihilated

Returns
the states in which particles are annihilated

◆ apply()

template<size_t Nc, size_t Na, typename Index1 >
template<typename String >
std::decay_t<String> mpqc::PrimitiveOperator< Nc, Na, Index1 >::apply ( String &&  os) const
inline

applies this operator to string os and returns the result. Unsafe, but fast.

Parameters
[in,out]osthe String object
Returns
string obtained by removing a particle from_ from_ and adding a particle to to_.

◆ apply_to()

template<size_t Nc, size_t Na, typename Index1 >
template<typename String >
void mpqc::PrimitiveOperator< Nc, Na, Index1 >::apply_to ( String &  os) const
inline

applies this operator to string os in-place.

Parameters
[in,out]osthe String object

◆ apply_to_unsafe()

template<size_t Nc, size_t Na, typename Index1 >
template<typename String >
void mpqc::PrimitiveOperator< Nc, Na, Index1 >::apply_to_unsafe ( String &  os) const
inline

applies this operator to string os in-place.

Parameters
[in,out]osthe String object
Warning
unsafe, fast

◆ apply_unsafe()

template<size_t Nc, size_t Na, typename Index1 >
template<typename String >
std::decay_t<String> mpqc::PrimitiveOperator< Nc, Na, Index1 >::apply_unsafe ( String &&  os) const
inline

applies this operator to string os and returns the result. Unsafe, but fast.

Parameters
[in,out]osthe String object
Returns
string obtained by removing a particle from_ from_ and adding a particle to to_.

◆ cre()

template<size_t Nc, size_t Na, typename Index1 >
const std::array<state_index_type, Nc>& mpqc::PrimitiveOperator< Nc, Na, Index1 >::cre ( ) const
inline

reports the states in which particles are created

Returns
the states in which particles are created

◆ operator()()

template<size_t Nc, size_t Na, typename Index1 >
template<typename FString >
std::pair<bool, std::decay_t<FString> > mpqc::PrimitiveOperator< Nc, Na, Index1 >::operator() ( FString &&  os) const
inline

similar to sign_apply_to(), but nonmutating

Parameters
[in]osthe input FString object
Returns
new pair[sign_change,FString]

◆ sign()

template<size_t Nc, size_t Na, typename Index1 >
template<typename FString >
bool mpqc::PrimitiveOperator< Nc, Na, Index1 >::sign ( const FString &  s) const
inline

reports whether application of this operator to fermionic string str changes the sign

Note
the sign changes if the number of occupied states "crossed" by the operator is odd
Parameters
[in]sthe FString object
Returns
true is the sign of the state changes

◆ sign_apply_to()

template<size_t Nc, size_t Na, typename Index1 >
template<typename FString >
bool mpqc::PrimitiveOperator< Nc, Na, Index1 >::sign_apply_to ( FString &  os) const
inline

same as apply_to(), but returns whether application operator changes the sign of the state for a fermionic string; the sign changes if the number of occupied states "crossed" by the operator is odd

Parameters
[in,out]osthe FString object
Returns
true is the sign of the state changes

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