Cytnx v0.9.7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
cytnx::Symmetry Class Reference

the symmetry object More...

#include <Symmetry.hpp>

Public Member Functions

Symmetry clone () const
 return a clone instance of current Symmetry object.
 
int stype () const
 return the symmetry type-id of current Symmetry object, see cytnx::SymType.
 
int & n () const
 return the descrete n of current Symmetry object.
 
std::string stype_str () const
 return the symmetry type name of current Symmetry object in string form, see cytnx::SymType.
 
bool check_qnum (const cytnx_int64 &qnum)
 check the quantum number qnum is within the valid value range of current Symmetry.
 
bool check_qnums (const std::vector< cytnx_int64 > &qnums)
 check all the quantum numbers \qnums are within the valid value range of current Symmetry.
 
std::vector< cytnx_int64combine_rule (const std::vector< cytnx_int64 > &inL, const std::vector< cytnx_int64 > &inR)
 apply combine rule of current symmetry to two quantum number lists.
 
void combine_rule_ (std::vector< cytnx_int64 > &out, const std::vector< cytnx_int64 > &inL, const std::vector< cytnx_int64 > &inR)
 apply combine rule of current symmetry to two quantum number lists, and store it into parameter out.
 
cytnx_int64 combine_rule (const cytnx_int64 &inL, const cytnx_int64 &inR, const bool &is_reverse=false) const
 apply combine rule of current symmetry to two quantum numbers.
 
void combine_rule_ (cytnx_int64 &out, const cytnx_int64 &inL, const cytnx_int64 &inR, const bool &is_reverse=false)
 apply combine rule of current symmetry to two quantum numbers, and store the combined quntun number into parameter
 
void reverse_rule_ (cytnx_int64 &out, const cytnx_int64 &in)
 Apply reverse rule of current symmetry to a given quantum number and store in parameter out.
 
cytnx_int64 reverse_rule (const cytnx_int64 &in) const
 Apply reverse rule of current symmetry to a given quantum number and return the result.
 
void Save (const std::string &fname) const
 Save the current Symmetry object to a file.
 
void Save (const char *fname) const
 Same as Save(const std::string &fname) const;.
 
void print_info () const
 Print the information of current Symmetry object.
 
bool operator== (const Symmetry &rhs) const
 the equality operator of the Symmetry object.
 
bool operator!= (const Symmetry &rhs) const
 the inequality operator of the Symmetry object.
 

Static Public Member Functions

static Symmetry U1 ()
 create a U1 symmetry object
 
static Symmetry Zn (const int &n)
 create a Zn descrete symmetry object with \(n\in\mathbb{N}\)
 
static Symmetry Load (const std::string &fname)
 Load a Symmetry object from a file.
 
static Symmetry Load (const char *fname)
 Same as static Symmetry Load(const std::string &fname);.
 

Detailed Description

the symmetry object

Member Function Documentation

◆ check_qnum()

bool cytnx::Symmetry::check_qnum ( const cytnx_int64 qnum)
inline

check the quantum number qnum is within the valid value range of current Symmetry.

Parameters
[in]qnuma singule quantum number.
Returns
[bool]

◆ check_qnums()

bool cytnx::Symmetry::check_qnums ( const std::vector< cytnx_int64 > &  qnums)
inline

check all the quantum numbers \qnums are within the valid value range of current Symmetry.

Parameters
[in]qnumsthe list of quantum numbers
Returns
[bool]

◆ clone()

Symmetry cytnx::Symmetry::clone ( ) const
inline

return a clone instance of current Symmetry object.

Returns
[Symmetry]

Example:

c++ API:

output>

 

python API:

output>

 

◆ combine_rule() [1/2]

cytnx_int64 cytnx::Symmetry::combine_rule ( const cytnx_int64 inL,
const cytnx_int64 inR,
const bool &  is_reverse = false 
) const
inline

apply combine rule of current symmetry to two quantum numbers.

Parameters
[in]inLthe #1 quantum number.
[in]inRthe #2 quantum number.
Returns
the combined quantum number.

◆ combine_rule() [2/2]

std::vector< cytnx_int64 > cytnx::Symmetry::combine_rule ( const std::vector< cytnx_int64 > &  inL,
const std::vector< cytnx_int64 > &  inR 
)
inline

apply combine rule of current symmetry to two quantum number lists.

Parameters
[in]inLthe #1 quantum number list that is to be combined.
[in]inRthe #2 quantum number list that is to be combined.
Returns
the combined quantum numbers.

◆ combine_rule_() [1/2]

void cytnx::Symmetry::combine_rule_ ( cytnx_int64 out,
const cytnx_int64 inL,
const cytnx_int64 inR,
const bool &  is_reverse = false 
)
inline

apply combine rule of current symmetry to two quantum numbers, and store the combined quntun number into parameter

Parameters
out.
[out]outthe output quantum number.
[in]inLthe #1 quantum number.
[in]inRthe #2 quantum number.

◆ combine_rule_() [2/2]

void cytnx::Symmetry::combine_rule_ ( std::vector< cytnx_int64 > &  out,
const std::vector< cytnx_int64 > &  inL,
const std::vector< cytnx_int64 > &  inR 
)
inline

apply combine rule of current symmetry to two quantum number lists, and store it into parameter out.

Parameters
[out]outthe output quantum number list.
[in]inLthe #1 quantum number list that is to be combined.
[in]inRthe #2 quantum number list that is to be combined.

◆ Load() [1/2]

static Symmetry cytnx::Symmetry::Load ( const char *  fname)
static

◆ Load() [2/2]

static Symmetry cytnx::Symmetry::Load ( const std::string &  fname)
static

Load a Symmetry object from a file.

Parameters
[in]fnamethe file name.
Precondition
the file extension must be ".cysym".
Returns
the loaded Symmetry object.

◆ n()

int & cytnx::Symmetry::n ( ) const
inline

return the descrete n of current Symmetry object.

Returns
[int]
Note
  1. for U1, n=1 will be returned.
  2. for Zn, n is the descrete symmetry number. (ex: Z2, n=2)

◆ operator!=()

bool cytnx::Symmetry::operator!= ( const Symmetry rhs) const

the inequality operator of the Symmetry object.

◆ operator==()

bool cytnx::Symmetry::operator== ( const Symmetry rhs) const

the equality operator of the Symmetry object.

◆ print_info()

void cytnx::Symmetry::print_info ( ) const
inline

Print the information of current Symmetry object.

◆ reverse_rule()

cytnx_int64 cytnx::Symmetry::reverse_rule ( const cytnx_int64 in) const
inline

Apply reverse rule of current symmetry to a given quantum number and return the result.

that means, \( o = -i \), where \( o \) is the reverse quantum number, and \( i \) is the input quantum number in.

Parameters
[in]inthe input quantum number.
Returns
the reverse quantum number.

◆ reverse_rule_()

void cytnx::Symmetry::reverse_rule_ ( cytnx_int64 out,
const cytnx_int64 in 
)
inline

Apply reverse rule of current symmetry to a given quantum number and store in parameter out.

that means, \( o = -i \), where \( o \) is the output quantum number out, and \( i \) is the input quantum number in.

Parameters
[out]outthe output quantum number.
[in]inthe input quantum number.

◆ Save() [1/2]

void cytnx::Symmetry::Save ( const char *  fname) const

◆ Save() [2/2]

void cytnx::Symmetry::Save ( const std::string &  fname) const

Save the current Symmetry object to a file.

Parameters
[in]fnamethe file name.
Postcondition
the file extension will be automatically added as ".cysym".

◆ stype()

int cytnx::Symmetry::stype ( ) const
inline

return the symmetry type-id of current Symmetry object, see cytnx::SymType.

Returns
[int] the symmetry type-id.

◆ stype_str()

std::string cytnx::Symmetry::stype_str ( ) const
inline

return the symmetry type name of current Symmetry object in string form, see cytnx::SymType.

Returns
[std::string] the symmetry type name.

◆ U1()

static Symmetry cytnx::Symmetry::U1 ( )
inlinestatic

create a U1 symmetry object

valid qnum value range:

\f$(-\infty , \infty)\f$

combine rule:

Q + Q

description:

create a new U1 symmetry object that serive as a generator. The symmetry object is a property of Bond . It is used to identify the symmetry of the quantum number set, as well as providing the combining rule for the quantum number when Bonds are combined.

Example:

c++ API:

output>

 

python API:

output>

 

◆ Zn()

static Symmetry cytnx::Symmetry::Zn ( const int &  n)
inlinestatic

create a Zn descrete symmetry object with \(n\in\mathbb{N}\)

valid qnum value range:

\f$[0 , n)\f$

combine rule:

(Q + Q)%n

description:

create a new Zn descrete symmetry object with integer \( n \) that serive as a generator. The symmetry object is a property of Bond . It is used to identify the symmetry of the quantum number set, as well as providing the combining rule for the quantum number when Bonds are combined.

Example:

c++ API:

output>

 

python API:

output>

 

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