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 | |
Formula & | operator= (Formula const &)=default |
Formula & | operator= (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 Notation & | notation () 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 Operator & | oper () const |
Operator accessor. More... | |
Formula options functions | |
const std::vector< Option > & | options () const |
option accessor More... | |
Formula & | add_option (Option op) |
bool | has_option (Option op) const |
Formula & | clear_option () |
Formula & | remove_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
|
strong |
◆ Option
|
strong |
◆ Position
|
strong |
Constructor & Destructor Documentation
◆ Formula() [1/4]
|
inline |
◆ Formula() [2/4]
|
default |
◆ Formula() [3/4]
|
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:
df
-> Option::DensityFittinginv
-> Option::Inverseinv_sqr
-> Option::InverseSquareRoot<symm>
-> math::PetiteList::Symmetry
Member Function Documentation
◆ add_option()
- Parameters
-
op a Formula::Option object; if op==Formula::Option::Null
this is a no-op
- Postcondition
has_option(op)
will returntrue
- Returns
- reference to
this
◆ bra_indices() [1/2]
|
inline |
return bra_index
◆ bra_indices() [2/2]
|
inline |
return bra_index
◆ clear_option()
Formula & mpqc::Formula::clear_option | ( | ) |
clears all options
- Postcondition
has_option(op)
will returnfalse
for anyop
- 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
-
op a 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]
|
inline |
return ket_index
◆ ket_indices() [2/2]
|
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()
◆ operator!=()
|
inline |
◆ operator<()
bool mpqc::Formula::operator< | ( | const Formula & | other | ) | const |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
bool mpqc::Formula::operator== | ( | const Formula & | other | ) | const |
◆ options()
|
inline |
option accessor
◆ rank()
std::size_t mpqc::Formula::rank | ( | ) | const |
dimension of formula(2, 3 or 4)
◆ remove_option()
- Parameters
-
op a Formula::Option object; if op==Formula::Option::Null
this is a no-op
- Postcondition
has_option(op)
will returnfalse
- 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()
|
inline |
set bra index
◆ set_ket_indices()
|
inline |
set ket_index
◆ set_operator()
◆ set_operator_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()
|
inline |
Symmetry accessor.
◆ to_ta_expression()
std::string mpqc::Formula::to_ta_expression | ( | Transformer | transform_op = detail::identity() | ) | const |
converts this to a TA expression annotation
- Template Parameters
-
Transformer a unary functor class
- Parameters
-
transform_op used to transform index keys
Member Data Documentation
◆ option_to_string
|
static |
The documentation for this class was generated from the following files:
- mpqc/chemistry/qc/lcao/expression/formula.h
- mpqc/chemistry/qc/lcao/expression/formula.cpp