Documentation

Formula parses a string representation of quantum mechanical matrix elements and related expressions.

Public Types

enum  Notation { Notation::Invalid = -1, Notation::Chemical = 0, Notation::Physical = 1 }
 Types of Notation. More...
 
enum  Position { Position::Invalid = -1, Position::Bra = 0, Position::Ket = 1 }
 Position = Bra or Ket. More...
 
enum  Option {
  Option::Invalid = -1, Option::Null = Invalid, Option::DensityFitting = 0, Option::Inverse = 1,
  Option::InverseSquareRoot = 2
}
 Types of Options. More...
 

Public Member Functions

 Formula ()
 
 Formula (Formula const &)=default
 
 Formula (Formula &&)=default
 
Formulaoperator= (Formula const &)=default
 
Formulaoperator= (Formula &&)=default
 
 Formula (std::wstring formula)
 
std::wstring string () const
 
math::PetiteList::Symmetry symmetry () const
 Symmetry accessor. More...
 
template<typename Transformer = detail::identity>
std::string to_ta_expression (Transformer transform_op=detail::identity()) const
 
index functions
std::size_t rank () const
 dimension of formula(2, 3 or 4) More...
 
bool has_index (const OrbitalIndex &index) const
 
bool is_ao () const
 
const std::vector< OrbitalIndex > & bra_indices () const
 return bra_index More...
 
std::vector< OrbitalIndex > & bra_indices ()
 return bra_index More...
 
const std::vector< OrbitalIndex > & ket_indices () const
 return ket_index More...
 
std::vector< OrbitalIndex > & ket_indices ()
 return ket_index More...
 
void set_ket_indices (const std::vector< OrbitalIndex > &bra_idxs)
 set ket_index More...
 
void set_bra_indices (const std::vector< OrbitalIndex > &ket_idxs)
 set bra index More...
 
Notation functions
const Notationnotation () const
 Notation accessor. More...
 
void reset_notation (const Notation &n)
 resets Notation to not (does not update the state otherwise) More...
 
void notation (const Notation &n)
 changes Notation to n (unlike reset_notation updates state accordingly) More...
 
Operator functions
void set_operator (const Operator &oper)
 set Operator More...
 
void set_operator_type (const Operator::Type &oper_type)
 set Operator type More...
 
const Operatoroper () const
 Operator accessor. More...
 
Formula options functions
const std::vector< Option > & options () const
 option accessor More...
 
Formulaadd_option (Option op)
 
bool has_option (Option op) const
 
Formulaclear_option ()
 
Formularemove_option (Option op)
 
Comparison operators
bool operator< (const Formula &other) const
 
bool operator== (const Formula &other) const
 
bool operator!= (const Formula &other) const
 

Static Public Attributes

static const std::map< Option, std::wstring > option_to_string
 

Member Enumeration Documentation

◆ Notation

Types of Notation.

Enumerator
Invalid 
Chemical 
Physical 

◆ Option

enum mpqc::Formula::Option
strong

Types of Options.

Enumerator
Invalid 
Null 
DensityFitting 
Inverse 
InverseSquareRoot 

◆ Position

Position = Bra or Ket.

Enumerator
Invalid 
Bra 
Ket 

Constructor & Destructor Documentation

◆ Formula() [1/4]

mpqc::Formula::Formula ( )
inline

◆ Formula() [2/4]

mpqc::Formula::Formula ( Formula const &  )
default

◆ Formula() [3/4]

mpqc::Formula::Formula ( Formula &&  )
default

◆ Formula() [4/4]

mpqc::Formula::Formula ( std::wstring  formula)

Constructor parses the string in one of the following formats:

  • Physical Notation <braindex1 braindex2|operator|ketindex1 ketindex2>[option1,option2]
  • Chemical Notation (braindex1 ketindex1|operator|braindex2 ketindex2)[option]

where the index keys braindex1 , ketindex1 , etc. are parsed by mpqc::lcao::OrbitalIndex, the operator key operator is parsed by Operator , and the option keys can be one of the following:

Member Function Documentation

◆ add_option()

Formula & mpqc::Formula::add_option ( Option  op)
Parameters
opa Formula::Option object; if op==Formula::Option::Null this is a no-op
Postcondition
has_option(op) will return true
Returns
reference to this

◆ bra_indices() [1/2]

std::vector<OrbitalIndex>& mpqc::Formula::bra_indices ( )
inline

return bra_index

◆ bra_indices() [2/2]

const std::vector<OrbitalIndex>& mpqc::Formula::bra_indices ( ) const
inline

return bra_index

◆ clear_option()

Formula & mpqc::Formula::clear_option ( )

clears all options

Postcondition
has_option(op) will return false for any op
Returns
reference to this

◆ has_index()

bool mpqc::Formula::has_index ( const OrbitalIndex index) const
Returns
true if this contains index

◆ has_option()

bool mpqc::Formula::has_option ( Formula::Option  op) const
Parameters
opa Formula::Option object;
Precondition
op!=Formula::Option::Null
Returns
true if this formula has option op

◆ is_ao()

bool mpqc::Formula::is_ao ( ) const
Returns
true if it only contains AO indices

◆ ket_indices() [1/2]

std::vector<OrbitalIndex>& mpqc::Formula::ket_indices ( )
inline

return ket_index

◆ ket_indices() [2/2]

const std::vector<OrbitalIndex>& mpqc::Formula::ket_indices ( ) const
inline

return ket_index

◆ notation() [1/2]

const Formula::Notation & mpqc::Formula::notation ( ) const

Notation accessor.

◆ notation() [2/2]

void mpqc::Formula::notation ( const Notation n)

changes Notation to n (unlike reset_notation updates state accordingly)

◆ oper()

const Operator& mpqc::Formula::oper ( ) const
inline

Operator accessor.

◆ operator!=()

bool mpqc::Formula::operator!= ( const Formula other) const
inline

◆ operator<()

bool mpqc::Formula::operator< ( const Formula other) const

◆ operator=() [1/2]

Formula& mpqc::Formula::operator= ( Formula &&  )
default

◆ operator=() [2/2]

Formula& mpqc::Formula::operator= ( Formula const &  )
default

◆ operator==()

bool mpqc::Formula::operator== ( const Formula other) const

◆ options()

const std::vector<Option>& mpqc::Formula::options ( ) const
inline

option accessor

◆ rank()

std::size_t mpqc::Formula::rank ( ) const

dimension of formula(2, 3 or 4)

◆ remove_option()

Formula & mpqc::Formula::remove_option ( Option  op)
Parameters
opa Formula::Option object; if op==Formula::Option::Null this is a no-op
Postcondition
has_option(op) will return false
Returns
reference to this

◆ reset_notation()

void mpqc::Formula::reset_notation ( const Notation n)

resets Notation to not (does not update the state otherwise)

◆ set_bra_indices()

void mpqc::Formula::set_bra_indices ( const std::vector< OrbitalIndex > &  ket_idxs)
inline

set bra index

◆ set_ket_indices()

void mpqc::Formula::set_ket_indices ( const std::vector< OrbitalIndex > &  bra_idxs)
inline

set ket_index

◆ set_operator()

void mpqc::Formula::set_operator ( const Operator oper)
inline

set Operator

◆ set_operator_type()

void mpqc::Formula::set_operator_type ( const Operator::Type oper_type)
inline

set Operator type

See also
Operator::Type

◆ string()

std::wstring mpqc::Formula::string ( ) const

reconstruct a std::wstring representation of the formula

See also
Formula::to_ta_expression()

◆ symmetry()

math::PetiteList::Symmetry mpqc::Formula::symmetry ( ) const
inline

Symmetry accessor.

◆ to_ta_expression()

template<typename Transformer >
std::string mpqc::Formula::to_ta_expression ( Transformer  transform_op = detail::identity()) const

converts this to a TA expression annotation

Template Parameters
Transformera unary functor class
Parameters
transform_opused to transform index keys

Member Data Documentation

◆ option_to_string

const std::map< Formula::Option, std::wstring > mpqc::Formula::option_to_string
static

The documentation for this class was generated from the following files:
const Vector3d & L() const
Definition: group.cpp:74