VMPS++
|
General tensor with quantum number blocks.
Nlegs | : Amount of tensor legs, must be >=2. A two-legged tensor is coded separately as Biped. |
Symmetry | : A class providing all relevant functions and infos that are determined by the Symmetry. Click here for more information. |
MatrixType | : MatrixXd or MatrixXcd |
Tripod<Symmetry,MatrixType>
(Nlegs=3
, e.g. the transfer matrix in ) Quadruped<Symmetry,MatrixType>
(Nlegs=4
, e.g. the transfer matrix in ). Definition at line 32 of file Multipede.h.
#include <Multipede.h>
Public Types | |
typedef Symmetry::qType | qType |
typedef MatrixType::Scalar | Scalar |
Public Member Functions | |
Multipede () | |
Multipede (const Biped< Symmetry, MatrixType > &B, qType Q=Symmetry::qvacuum()) | |
constexpr size_t | rank () const |
Multipede< Nlegs, Symmetry, MatrixType > & | operator= (const Multipede< Nlegs, Symmetry, MatrixType > &Vin) |
double | memory (MEMUNIT memunit=GB) const |
double | overhead (MEMUNIT memunit=MB) const |
string | dict_info () const |
string | print (const bool &SHOW_MATRICES=false, const size_t &precision=3) const |
void | clear () |
void | setZero () |
void | setVacuum () |
void | setTarget (std::array< qType, Nlegs > Q) |
void | setTarget (vector< std::array< qType, Nlegs > > Q) |
void | setIdentity (size_t Drows, size_t Dcols, size_t amax=1, size_t bmax=1) |
void | setIdentity (size_t amax, size_t bmax, const Qbasis< Symmetry > &base, const qarray< Symmetry::Nq > &Q=Symmetry::qvacuum()) |
void | addScale (const Scalar &factor, const Multipede< Nlegs, Symmetry, MatrixType > &Mrhs) |
void | save (string filename, bool PRINT=false) const |
void | load (string filename, bool PRINT=false) |
qType | in (size_t q) const |
qType | out (size_t q) const |
qType | mid (size_t q) const |
qType | bot (size_t q) const |
qType | top (size_t q) const |
void | push_back (std::array< qType, Nlegs > quple, const boost::multi_array< MatrixType, LEGLIMIT > &M) |
void | push_back (std::initializer_list< qType > qlist, const boost::multi_array< MatrixType, LEGLIMIT > &M) |
void | insert (std::pair< qType, size_t > ab, const Multipede< Nlegs, Symmetry, MatrixType > &Trhs) |
template<typename OtherMatrixType > | |
Multipede< Nlegs, Symmetry, OtherMatrixType > | cast () const |
Scalar | compare (const Multipede< Nlegs, Symmetry, MatrixType > &Mrhs) const |
Biped< Symmetry, MatrixType > | BipedSliceQmid (qType qslice=Symmetry::qvacuum()) const |
size_t | dim = 0 |
vector< std::array< qType, Nlegs > > | index |
vector< boost::multi_array< MatrixType, LEGLIMIT > > | block |
unordered_map< std::array< qType, Nlegs >, size_t > | dict |
std::size_t | size () const |
typedef Symmetry::qType Multipede< Nlegs, Symmetry, MatrixType >::qType |
Definition at line 34 of file Multipede.h.
typedef MatrixType::Scalar Multipede< Nlegs, Symmetry, MatrixType >::Scalar |
Definition at line 35 of file Multipede.h.
|
inline |
Definition at line 37 of file Multipede.h.
|
inlineexplicit |
Converts a Biped to a Tripod, adding a trivial middle leg equal to the vacuum. Made explicit to prohibit automatic conversion between Biped and Multipede.
Definition at line 43 of file Multipede.h.
void Multipede< Nlegs, Symmetry, MatrixType >::addScale | ( | const Scalar & | factor, |
const Multipede< Nlegs, Symmetry, MatrixType > & | Mrhs | ||
) |
Deletes the contents of index
, block
, dict
.
Definition at line 257 of file Multipede.h.
Biped< Symmetry, MatrixType > Multipede< Nlegs, Symmetry, MatrixType >::BipedSliceQmid | ( | qType | qslice = Symmetry::qvacuum() | ) | const |
Takes Biped-slice from a Tripod over the middle quantum number qslice
.
Definition at line 716 of file Multipede.h.
|
inline |
Convenience function to return a quantum number of the block q
to preserve the sanity of the programmer. For the naming convention see Multipede::index.
Definition at line 156 of file Multipede.h.
|
inline |
Casts tensors to OtherMatrixType
, i.e. usually from real to complex.
Definition at line 180 of file Multipede.h.
void Multipede< Nlegs, Symmetry, MatrixType >::clear |
Deletes the contents of index
, block
, dict
.
Definition at line 408 of file Multipede.h.
MatrixType::Scalar Multipede< Nlegs, Symmetry, MatrixType >::compare | ( | const Multipede< Nlegs, Symmetry, MatrixType > & | Mrhs | ) | const |
Shifts qin
and qout
by Q
, qmid
is unchanged Shifts qmid
and qout
by Q
, qin
is unchanged
Definition at line 698 of file Multipede.h.
string Multipede< Nlegs, Symmetry, MatrixType >::dict_info |
Prints Multipede<Nlegs,Symmetry,MatrixType>::dict into a string.
Definition at line 359 of file Multipede.h.
|
inline |
Convenience function to return a quantum number of the block q
to preserve the sanity of the programmer. For the naming convention see Multipede::index.
Definition at line 152 of file Multipede.h.
void Multipede< Nlegs, Symmetry, MatrixType >::insert | ( | std::pair< qType, size_t > | ab, |
const Multipede< Nlegs, Symmetry, MatrixType > & | Trhs | ||
) |
Adds a new block to the tensor specified by the incoming quantum numbers quple
.
Definition at line 555 of file Multipede.h.
void Multipede< Nlegs, Symmetry, MatrixType >::load | ( | string | filename, |
bool | PRINT = false |
||
) |
Definition at line 797 of file Multipede.h.
double Multipede< Nlegs, Symmetry, MatrixType >::memory | ( | MEMUNIT | memunit = GB | ) | const |
Calculates the (theoretically) allocated memory (note: by default in GB).
Definition at line 374 of file Multipede.h.
|
inline |
Convenience function to return a quantum number of the block q
to preserve the sanity of the programmer. For the naming convention see Multipede::index.
Definition at line 154 of file Multipede.h.
|
inline |
Definition at line 216 of file Multipede.h.
|
inline |
Convenience function to return a quantum number of the block q
to preserve the sanity of the programmer. For the naming convention see Multipede::index.
Definition at line 153 of file Multipede.h.
double Multipede< Nlegs, Symmetry, MatrixType >::overhead | ( | MEMUNIT | memunit = MB | ) | const |
Calculates the (theoretical) additional memory associated with the subspace blocks (note: by default in MB).
Definition at line 387 of file Multipede.h.
std::string Multipede< Nlegs, Symmetry, MatrixType >::print | ( | const bool & | SHOW_MATRICES = false , |
const size_t & | precision = 3 |
||
) | const |
Calculates the (theoretically) allocated memory (note: by default in GB).
Definition at line 593 of file Multipede.h.
void Multipede< Nlegs, Symmetry, MatrixType >::push_back | ( | std::array< qType, Nlegs > | quple, |
const boost::multi_array< MatrixType, LEGLIMIT > & | M | ||
) |
Adds a new block to the tensor specified by the incoming quantum numbers quple
.
Definition at line 438 of file Multipede.h.
void Multipede< Nlegs, Symmetry, MatrixType >::push_back | ( | std::initializer_list< qType > | qlist, |
const boost::multi_array< MatrixType, LEGLIMIT > & | M | ||
) |
Adds a new block to the tensor specified by the initializer list qlist
(must be of size Nlegs
). For the ordering convention see Multipede::index.
Definition at line 452 of file Multipede.h.
|
inlineconstexpr |
Const reference to the number of legs Nlegs
Definition at line 59 of file Multipede.h.
void Multipede< Nlegs, Symmetry, MatrixType >::save | ( | string | filename, |
bool | PRINT = false |
||
) | const |
Definition at line 734 of file Multipede.h.
void Multipede< Nlegs, Symmetry, MatrixType >::setIdentity | ( | size_t | amax, |
size_t | bmax, | ||
const Qbasis< Symmetry > & | base, | ||
const qarray< Symmetry::Nq > & | Q = Symmetry::qvacuum() |
||
) |
Deletes the contents of index
, block
, dict
.
Definition at line 529 of file Multipede.h.
void Multipede< Nlegs, Symmetry, MatrixType >::setIdentity | ( | size_t | Drows, |
size_t | Dcols, | ||
size_t | amax = 1 , |
||
size_t | bmax = 1 |
||
) |
Deletes the contents of index
, block
, dict
.
Definition at line 508 of file Multipede.h.
void Multipede< Nlegs, Symmetry, MatrixType >::setTarget | ( | std::array< qType, Nlegs > | Q | ) |
Creates a single block of size 1x1 containing 1 and the corresponding quantum numbers according to the input Q
. Needed for the transfer matrix from the last site in matrix element calculations.
Definition at line 479 of file Multipede.h.
void Multipede< Nlegs, Symmetry, MatrixType >::setTarget | ( | vector< std::array< qType, Nlegs > > | Q | ) |
Deletes the contents of index
, block
, dict
.
Definition at line 492 of file Multipede.h.
void Multipede< Nlegs, Symmetry, MatrixType >::setVacuum |
Creates a single block of size 1x1 containing 1 and the corresponding quantum numbers to the vacuum (all of them). Needed in for the transfer matrix to the first site in matrix element calculations.
Definition at line 462 of file Multipede.h.
void Multipede< Nlegs, Symmetry, MatrixType >::setZero |
Sets all matrices in Multipede<Nlegs,Symmetry,MatrixType>::block to zero, preserving the rows and columns.
Definition at line 397 of file Multipede.h.
|
inline |
Convenience access to the amount of blocks. Equal to either of the following: index.size()
, block.size()
Definition at line 67 of file Multipede.h.
|
inline |
Convenience function to return a quantum number of the block q
to preserve the sanity of the programmer. For the naming convention see Multipede::index.
Definition at line 157 of file Multipede.h.
vector<boost::multi_array<MatrixType,LEGLIMIT> > Multipede< Nlegs, Symmetry, MatrixType >::block |
Vector of quantum number blocks. The matrix block
[q] is characterized by the quantum number array index
[q]. Since the handling of template-sized arrays is no fun at all, the implementation is done in the following way: block
[q] is always a boost multi_array
of dimension LEGLIMIT
which is set = 2. Tripods need only one dimension (two are already absorbed into MatrixType
), therefore the rest needs to be set to 1 and the access goes by T.block
[q][a][0]. LEGLIMIT
can be increased and some code adjustment can be made (filling in dummy "[0]") if bigger tensors are required.
Definition at line 88 of file Multipede.h.
unordered_map<std::array<qType,Nlegs>,size_t> Multipede< Nlegs, Symmetry, MatrixType >::dict |
Dictionary allowing one to find the index of block
for a given array of Nlegs
quantum numbers in operations without looping over the blocks. For the ordering convention see Multipede::index.
Definition at line 95 of file Multipede.h.
size_t Multipede< Nlegs, Symmetry, MatrixType >::dim = 0 |
Convenience access to the amount of blocks. Equal to either of the following: index.size()
, block.size()
Definition at line 66 of file Multipede.h.
vector<std::array<qType,Nlegs> > Multipede< Nlegs, Symmetry, MatrixType >::index |
Vector of all incoming quantum numbers. The entries are arrays of size Nlegs
. The sorting is according to the following convention:
Nlegs=3
)Nlegs=4
) The middle, bottom and top quantum numbers are always outgoing for the left transfer matrix and incoming for the right transfer matrix in matrix element calculations. Definition at line 77 of file Multipede.h.