MPQC  3.0.0-alpha
sc::FermionBasicNCOper< Nb, FString > Class Template Reference

basic Nb-body number-conserving (nc) operator in sp representation More...

#include <chemistry/qc/nbody/string.h>

Public Types

typedef FString::state_index_type state_index_type
 

Public Member Functions

template<typename Int >
 FermionBasicNCOper (const std::array< Int, Rank > &t, const std::array< Int, Rank > &f)
 
const std::array< state_index_type, Rank > & cre () const
 reports the states in which particles are created More...
 
const std::array< state_index_type, Rank > & ann () const
 reports the states in which particles are annihilated More...
 
void apply (FString &os) const
 applies this operator to_ FermionOccupationNBitString os. More...
 
bool apply_sign (FString &os) const
 same as apply(), but returns whether application operator changes the sign of the state; the sign changes if the number of occupied states "crossed" by the operator is odd More...
 
std::pair< bool, FString > operator() (const FString &os) const
 similar to_ apply_sign(), but keeps the argument unchanged More...
 

Static Public Attributes

static const size_t Rank = Nb
 

Detailed Description

template<size_t Nb, typename FString>
class sc::FermionBasicNCOper< Nb, FString >

basic Nb-body number-conserving (nc) operator in sp representation

Template Parameters
Nbrank of the operator (number of particles that possibly change states)

Member Function Documentation

◆ ann()

template<size_t Nb, typename FString>
const std::array<state_index_type,Rank>& sc::FermionBasicNCOper< Nb, FString >::ann ( ) const
inline

reports the states in which particles are annihilated

Returns
the states in which particles are annihilated

◆ apply()

template<size_t Nb, typename FString>
void sc::FermionBasicNCOper< Nb, FString >::apply ( FString &  os) const
inline

applies this operator to_ FermionOccupationNBitString os.

Unsafe, but fast.

Parameters
osthe FermionOccupationNBitString object
Returns
FermionOccupationNBitString obtained by removing a particle from_ from_ and adding a particle to_ to_.

◆ apply_sign()

template<size_t Nb, typename FString>
bool sc::FermionBasicNCOper< Nb, FString >::apply_sign ( FString &  os) const
inline

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

Parameters
osthe FermionOccupationNBitString object
Returns
true is the sign of the state changes

Referenced by sc::FermionBasicNCOper< 1, FString >::operator()(), and sc::FermionBasicNCOper< Rank, FString >::operator()().

◆ cre()

template<size_t Nb, typename FString>
const std::array<state_index_type,Rank>& sc::FermionBasicNCOper< Nb, FString >::cre ( ) const
inline

reports the states in which particles are created

Returns
the states in which particles are created

◆ operator()()

template<size_t Nb, typename FString>
std::pair<bool,FString > sc::FermionBasicNCOper< Nb, FString >::operator() ( const FString &  os) const
inline

similar to_ apply_sign(), but keeps the argument unchanged

Parameters
osthe FermionOccupationNBitString object
Returns
new pair[sign_change,FermionOccupationNBitString]

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

Generated at Sun Jan 26 2020 23:24:05 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.