TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
triqs::operators::canonical_ops_t

#include <triqs/operators/many_body_operator.hpp>

Detailed Description

Second quantization creation/annihilation operator.

A canonical second quantization operator, \( \hat{c}_{\alpha_i} \) or \( \hat{c}_{\alpha_i}^\dagger \), is defined by

  • a single particle state index \( \alpha_i = (\beta^{(i)}_1, \dots, \beta^{(i)}_{k_i}) \), where each \( \beta^{(i)}_j \) is an integer, a string, a double or an array of integers, and
  • a boolean flag dagger indicating whether it is a creation (true) or annihilation (false) operator.

Definition at line 87 of file many_body_operator.hpp.

Public Member Functions

void deserialize (auto &ar)
 Deserialize the canonical operator from a generic archive.
auto operator<=> (canonical_ops_t const &b) const
 Three-way comparison operator for canonical operators.
bool operator== (canonical_ops_t const &b) const
 Equality operator for canonical operators.
void serialize (auto &ar) const
 Serialize the canonical operator to a generic archive.

Public Attributes

bool dagger {false}
 True for creation ( \( \hat{c}_{\alpha_i}^{\dagger} \)), false for annihilation ( \( \hat{c}_{\alpha_i} \)) operators.
indices_t indices {}
 Single particle state index \( \alpha_i \).

Member Function Documentation

◆ deserialize()

void triqs::operators::canonical_ops_t::deserialize ( auto & ar)
inline

Deserialize the canonical operator from a generic archive.

Parameters
arArchive to deserialize from.

Definition at line 161 of file many_body_operator.hpp.

◆ operator<=>()

auto triqs::operators::canonical_ops_t::operator<=> ( canonical_ops_t const & b) const
inline

Three-way comparison operator for canonical operators.

The ordering is defined as follows:

  • All creation operators are less than all annihilation operators, i.e. \( \hat{c}_{\alpha_i}^\dagger < \hat{c}_{\alpha_j} \) for any \( \alpha_i \) and \( \alpha_j \).
  • Among canonical operators with the same dagger flag, indices are compared element-wise. For each element, the active type of std::variant is compared first (long < std::string < double < std::array<long, 3>), and only when the active types agree are the underlying values compared.
  • For annihilation operators, the index comparison is reversed, so that with the same set of indices the ordering becomes \( \hat{c}_{\alpha_1}^\dagger < \hat{c}_{\alpha_2}^\dagger < \dots < \hat{c}_{\alpha_2} < \hat{c}_{\alpha_1} \). For example, with integer indices \( 1, 2, 3 \) the ascending order is \(\hat{c}_1^\dagger < \hat{c}_2^\dagger < \hat{c}_3^\dagger < \hat{c}_3 < \hat{c}_2 < \hat{c}_1 \).
Note
The order induced by this operator is in general different from the order in triqs::hilbert_space::fundamental_operator_set.
Parameters
bRight hand side operator.
Returns
std::strong_ordering result of the comparison.

Definition at line 117 of file many_body_operator.hpp.

◆ operator==()

bool triqs::operators::canonical_ops_t::operator== ( canonical_ops_t const & b) const
inline

Equality operator for canonical operators.

Parameters
bRight hand side operator.
Returns
True if both operators are creation (annihilation) operators with the same indices, false otherwise.

Definition at line 149 of file many_body_operator.hpp.

◆ serialize()

void triqs::operators::canonical_ops_t::serialize ( auto & ar) const
inline

Serialize the canonical operator to a generic archive.

Parameters
arArchive to serialize to.

Definition at line 155 of file many_body_operator.hpp.


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