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

#include <Gncon.hpp>

Public Member Functions

void Fromfile (const std::string &fname, const int &Gncon_type=GNType.Regular)
 Construct Gncon from Gncon file.
 
void FromString (const std::vector< std::string > &contents, const int &Gncon_type=GNType.Regular)
 Construct Gncon from a list of strings, where each string is the same as each line in Gncon file.
 
 Gncon (const std::string &fname, const int &Gncon_type=GNType.Regular)
 
void PutUniTensor (const std::string &name, const UniTensor &utensor)
 
void PutUniTensor (const cytnx_uint64 &idx, const UniTensor &utensor)
 
void PutUniTensors (const std::vector< std::string > &name, const std::vector< UniTensor > &utensors)
 
std::string getOptimalOrder (const int &Gncon_type=GNType.Regular)
 
UniTensor Launch (const bool &optimal, const std::string &contract_order="", const int &Gncon_type=GNType.Regular)
 
void clear ()
 
Gncon clone ()
 
void PrintNet ()
 
void Savefile (const std::string &fname)
 

Static Public Member Functions

static Gncon Contract (const std::vector< UniTensor > &tensors, const std::string &Tout, const std::vector< std::string > &alias={}, const std::string &contract_order="")
 

Constructor & Destructor Documentation

◆ Gncon()

cytnx::Gncon::Gncon ( const std::string &  fname,
const int &  Gncon_type = GNType.Regular 
)
inline

Member Function Documentation

◆ clear()

void cytnx::Gncon::clear ( )
inline

◆ clone()

Gncon cytnx::Gncon::clone ( )
inline

◆ Contract()

static Gncon cytnx::Gncon::Contract ( const std::vector< UniTensor > &  tensors,
const std::string &  Tout,
const std::vector< std::string > &  alias = {},
const std::string &  contract_order = "" 
)
inlinestatic

◆ Fromfile()

void cytnx::Gncon::Fromfile ( const std::string &  fname,
const int &  Gncon_type = GNType.Regular 
)
inline

Construct Gncon from Gncon file.

Parameters
fnameThe Gncon file path
Gncon_typeThe type of Gncon. This can be [GNType.Regular] or [GNType.Fermion.]. Currently, only Regular Gncon is support!

note:

  1. each Gncon file cannot have more than 1024 lines.

detail:

Format of a Gncon file:

  • each line defines a UniTensor, that takes the format '[name] : [Labels]'
  • the name can be any alphabets A-Z, a-z
  • There are two reserved name: 'TOUT' and 'ORDER' (all capital)
  • One can use 'TOUT' line to specify the output UniTensor's bond order using labels
  • The 'ORDER' line is used to specify the contraction order

About [Labels]:

  • each label should seperate by a comma ","
  • one ';' is needed and used to seperate Rowrank and column rank

About [ORDER]:

  • The contraction order, it can be specify using the standard mathmetical bracket ruls.
  • Without specify this line, the default contraction order will be from the first line to the last line

example Gncon file:

example code for load the Gncon file:

c++ API:

output>

 

python API

output>

 

◆ FromString()

void cytnx::Gncon::FromString ( const std::vector< std::string > &  contents,
const int &  Gncon_type = GNType.Regular 
)
inline

Construct Gncon from a list of strings, where each string is the same as each line in Gncon file.

Parameters
contentsThe Gncon file descriptions
Gncon_typeThe type of Gncon. This can be [GNType.Regular] or [GNType.Fermion.]. Currently, only Regular Gncon is support!

note:

  1. contents cannot have more than 1024 lines/strings.

detail:

Format of each string follows the same policy as Fromfile.

example code for load the Gncon file:

c++ API:

output>

 

python API

output>

 

◆ getOptimalOrder()

std::string cytnx::Gncon::getOptimalOrder ( const int &  Gncon_type = GNType.Regular)
inline

◆ Launch()

UniTensor cytnx::Gncon::Launch ( const bool &  optimal,
const std::string &  contract_order = "",
const int &  Gncon_type = GNType.Regular 
)
inline

◆ PrintNet()

void cytnx::Gncon::PrintNet ( )
inline

◆ PutUniTensor() [1/2]

void cytnx::Gncon::PutUniTensor ( const cytnx_uint64 idx,
const UniTensor utensor 
)
inline

◆ PutUniTensor() [2/2]

void cytnx::Gncon::PutUniTensor ( const std::string &  name,
const UniTensor utensor 
)
inline

◆ PutUniTensors()

void cytnx::Gncon::PutUniTensors ( const std::vector< std::string > &  name,
const std::vector< UniTensor > &  utensors 
)
inline

◆ Savefile()

void cytnx::Gncon::Savefile ( const std::string &  fname)
inline

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