CheMPS2
|
#include <Sobject.h>
Public Member Functions | |
Sobject (const int index, SyBookkeeper *denBK) | |
Constructor. More... | |
virtual | ~Sobject () |
Destructor. | |
int | gNKappa () const |
Get the number of symmetry blocks. More... | |
double * | gStorage () |
Get the pointer to the storage. More... | |
int | gKappa (const int NL, const int TwoSL, const int IL, const int N1, const int N2, const int TwoJ, const int NR, const int TwoSR, const int IR) const |
Get the index corresponding to a certain symmetry block. More... | |
int | gKappa2index (const int kappa) const |
Get the storage jump corresponding to a certain symmetry block. More... | |
double * | gStorage (const int NL, const int TwoSL, const int IL, const int N1, const int N2, const int TwoJ, const int NR, const int TwoSR, const int IR) |
Get the pointer to the storage of a certain symmetry block. More... | |
int | gIndex () const |
Get the location index. More... | |
void | Join (TensorT *Tleft, TensorT *Tright) |
Join two sites to form a composite S-object. More... | |
double | Split (TensorT *Tleft, TensorT *Tright, const int virtualdimensionD, const bool movingright, const bool change) |
SVD an S-object into 2 TensorT's. More... | |
void | addNoise (const double NoiseLevel) |
Add noise to the current S-object. More... | |
void | prog2symm () |
Convert the storage from diagram convention to symmetric Hamiltonian convention. | |
void | symm2prog () |
Convert the storage from symmetric Hamiltonian convention to diagram convention. | |
int | gNL (const int ikappa) const |
Get the left particle number symmetry of block ikappa. More... | |
int | gTwoSL (const int ikappa) const |
Get the left spin symmetry of block ikappa. More... | |
int | gIL (const int ikappa) const |
Get the left irrep symmetry of block ikappa. More... | |
int | gN1 (const int ikappa) const |
Get the left local particle number symmetry of block ikappa. More... | |
int | gN2 (const int ikappa) const |
Get the right local particle number symmetry of block ikappa. More... | |
int | gTwoJ (const int ikappa) const |
Get the central spin symmetry of block ikappa. More... | |
int | gNR (const int ikappa) const |
Get the right particle number symmetry of block ikappa. More... | |
int | gTwoSR (const int ikappa) const |
Get the right spin symmetry of block ikappa. More... | |
int | gIR (const int ikappa) const |
Get the right irrep symmetry of block ikappa. More... | |
int | gReorder (const int ikappa) const |
Get the blocks from large to small: blocksize(reorder[i])>=blocksize(reorder[i+1]) More... | |
Sobject class.
Handles the storage of a spin-coupled two-site object, as is needed for the effective Hamiltonian DMRG equations. Extra functionalities are:
CheMPS2::Sobject::Sobject | ( | const int | index, |
SyBookkeeper * | denBK | ||
) |
Constructor.
index | The first index ( S spans index & index + 1 ). |
denBK | Contains the virtual dimensions. Not constant as Sobject is allowed to set the virtual dimensions of symmetry sectors based on the Schmidt spectrum. |
Definition at line 36 of file Sobject.cpp.
void CheMPS2::Sobject::addNoise | ( | const double | NoiseLevel | ) |
Add noise to the current S-object.
NoiseLevel | The noise added to the S-object is of size (-0.5 < random number < 0.5) * NoiseLevel / infinity-norm(gStorage()) |
Definition at line 650 of file Sobject.cpp.
int CheMPS2::Sobject::gIL | ( | const int | ikappa | ) | const |
Get the left irrep symmetry of block ikappa.
ikappa | The tensor block number |
Definition at line 204 of file Sobject.cpp.
int CheMPS2::Sobject::gIndex | ( | ) | const |
Get the location index.
Definition at line 200 of file Sobject.cpp.
int CheMPS2::Sobject::gIR | ( | const int | ikappa | ) | const |
Get the right irrep symmetry of block ikappa.
ikappa | The tensor block number |
Definition at line 210 of file Sobject.cpp.
int CheMPS2::Sobject::gKappa | ( | const int | NL, |
const int | TwoSL, | ||
const int | IL, | ||
const int | N1, | ||
const int | N2, | ||
const int | TwoJ, | ||
const int | NR, | ||
const int | TwoSR, | ||
const int | IR | ||
) | const |
Get the index corresponding to a certain symmetry block.
NL | The left particle number sector |
TwoSL | The left spin symmetry sector |
IL | The left irrep sector |
N1 | The first site particle number sector |
N2 | The second site particle number sector |
TwoJ | The recoupled two-site spin symmetry sector |
NR | The right particle number sector |
TwoSR | The right spin symmetry sector |
IR | The right irrep sector |
Definition at line 172 of file Sobject.cpp.
int CheMPS2::Sobject::gKappa2index | ( | const int | kappa | ) | const |
Get the storage jump corresponding to a certain symmetry block.
kappa | The symmetry block |
Definition at line 190 of file Sobject.cpp.
int CheMPS2::Sobject::gN1 | ( | const int | ikappa | ) | const |
Get the left local particle number symmetry of block ikappa.
ikappa | The tensor block number |
Definition at line 205 of file Sobject.cpp.
int CheMPS2::Sobject::gN2 | ( | const int | ikappa | ) | const |
Get the right local particle number symmetry of block ikappa.
ikappa | The tensor block number |
Definition at line 206 of file Sobject.cpp.
int CheMPS2::Sobject::gNKappa | ( | ) | const |
Get the number of symmetry blocks.
Definition at line 166 of file Sobject.cpp.
int CheMPS2::Sobject::gNL | ( | const int | ikappa | ) | const |
Get the left particle number symmetry of block ikappa.
ikappa | The tensor block number |
Definition at line 202 of file Sobject.cpp.
int CheMPS2::Sobject::gNR | ( | const int | ikappa | ) | const |
Get the right particle number symmetry of block ikappa.
ikappa | The tensor block number |
Definition at line 208 of file Sobject.cpp.
int CheMPS2::Sobject::gReorder | ( | const int | ikappa | ) | const |
Get the blocks from large to small: blocksize(reorder[i])>=blocksize(reorder[i+1])
ikappa | The index which counts from large to small |
Definition at line 170 of file Sobject.cpp.
double * CheMPS2::Sobject::gStorage | ( | ) |
Get the pointer to the storage.
return pointer to the storage
Definition at line 168 of file Sobject.cpp.
double * CheMPS2::Sobject::gStorage | ( | const int | NL, |
const int | TwoSL, | ||
const int | IL, | ||
const int | N1, | ||
const int | N2, | ||
const int | TwoJ, | ||
const int | NR, | ||
const int | TwoSR, | ||
const int | IR | ||
) |
Get the pointer to the storage of a certain symmetry block.
NL | The left particle number sector |
TwoSL | The left spin symmetry sector |
IL | The left irrep sector |
N1 | The first site particle number sector |
N2 | The second site particle number sector |
TwoJ | The recoupled two-site spin symmetry sector |
NR | The right particle number sector |
TwoSR | The right spin symmetry sector |
IR | The right irrep sector |
Definition at line 192 of file Sobject.cpp.
int CheMPS2::Sobject::gTwoJ | ( | const int | ikappa | ) | const |
Get the central spin symmetry of block ikappa.
ikappa | The tensor block number |
Definition at line 207 of file Sobject.cpp.
int CheMPS2::Sobject::gTwoSL | ( | const int | ikappa | ) | const |
Get the left spin symmetry of block ikappa.
ikappa | The tensor block number |
Definition at line 203 of file Sobject.cpp.
int CheMPS2::Sobject::gTwoSR | ( | const int | ikappa | ) | const |
Get the right spin symmetry of block ikappa.
ikappa | The tensor block number |
Definition at line 209 of file Sobject.cpp.
Join two sites to form a composite S-object.
Tleft | Left TensorT to form the composite S-object |
Tright | Right TensorT to form the composite S-object |
Definition at line 212 of file Sobject.cpp.
double CheMPS2::Sobject::Split | ( | TensorT * | Tleft, |
TensorT * | Tright, | ||
const int | virtualdimensionD, | ||
const bool | movingright, | ||
const bool | change | ||
) |
SVD an S-object into 2 TensorT's.
Tleft | Left TensorT storage space. At output left normalized. |
Tright | Right TensorT storage space. At output right normalized. |
virtualdimensionD | The virtual dimension which is partitioned over the different symmetry blocks based on the Schmidt spectrum |
movingright | When true, the singular values are multiplied into V^T, when false, into U. |
change | Whether or not the symmetry virtual dimensions are allowed to change (when false: D doesn't matter) |
Definition at line 260 of file Sobject.cpp.