VMPS++
|
Compressor for MPS. Needed to obtain various operations containing MPSs and MPOs with a variational approach.
Symmetry | : A class providing all relevant functions and infos that are determined by the Symmetry. Click here for more information. |
Scalar | : double or complex<double> |
MpoScalar | : double or complex<double> |
Definition at line 37 of file MpsCompressor.h.
#include <MpsCompressor.h>
Public Member Functions | |
MpsCompressor (DMRG::VERBOSITY::OPTION VERBOSITY=DMRG::VERBOSITY::SILENT) | |
void | lincomboCompress (const vector< Mps< Symmetry, Scalar > > &Vin, const vector< Scalar > &factors, Mps< Symmetry, Scalar > &Vout, const Mps< Symmetry, Scalar > &Vguess, size_t Minit, size_t Mincr=100, size_t Mlimit=10000, double tol=1e-4, size_t max_halfsweeps=40, size_t min_halfsweeps=1) |
string | info () const |
string | t_info () const |
double | memory (MEMUNIT memunit=GB) const |
void | stateCompress (const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout, size_t Minit, size_t Mincr=100, size_t Mlimit=10000, double tol=1e-4, size_t max_halfsweeps=40, size_t min_halfsweeps=1) |
template<typename MpOperator > | |
void | prodCompress (const MpOperator &H, const MpOperator &Hdag, const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout, qarray< Symmetry::Nq > Qtot_input, size_t Minit, size_t Mincr=100, size_t Mlimit=10000, double tol=1e-4, size_t max_halfsweeps=100, size_t min_halfsweeps=1, std::size_t savePeriod=0, std::string saveName="backup", bool MEASURE_DISTANCE=true, const MpOperator *HdagH=NULL) |
template<typename MpOperator > | |
void | polyCompress (const MpOperator &H, const Mps< Symmetry, Scalar > &Vin1, double polyB, const Mps< Symmetry, Scalar > &Vin2, Mps< Symmetry, Scalar > &Vout, size_t Minit, size_t Mincr=100, size_t Mlimit=10000, double tol=DMRG_POLYCOMPRESS_TOL, size_t max_halfsweeps=DMRG_POLYCOMPRESS_MAX, size_t min_halfsweeps=DMRG_POLYCOMPRESS_MIN) |
Private Types | |
typedef Matrix< Scalar, Dynamic, Dynamic > | MatrixType |
Private Member Functions | |
string | print_dist () const |
void | prepSweep (const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout) |
void | stateOptimize1 (const Mps< Symmetry, Scalar > &Vin, const Mps< Symmetry, Scalar > &Vout, PivotVector< Symmetry, Scalar > &Aout) |
void | stateOptimize1 (const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout) |
void | stateOptimize2 (const Mps< Symmetry, Scalar > &Vin, const Mps< Symmetry, Scalar > &Vout, PivotVector< Symmetry, Scalar > &ApairOut) |
void | stateOptimize2 (const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout) |
void | build_L (size_t loc, const Mps< Symmetry, Scalar > &Vbra, const Mps< Symmetry, Scalar > &Vket, bool RANDOMIZE=false) |
void | build_R (size_t loc, const Mps< Symmetry, Scalar > &Vbra, const Mps< Symmetry, Scalar > &Vket, bool RANDOMIZE=false) |
template<typename MpOperator > | |
void | prepSweep (const MpOperator &H, const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout, bool RANDOMIZE=false) |
template<typename MpOperator > | |
void | prodOptimize1 (const MpOperator &H, const Mps< Symmetry, Scalar > &Vin, const Mps< Symmetry, Scalar > &Vout, PivotVector< Symmetry, Scalar > &Aout) |
template<typename MpOperator > | |
void | prodOptimize1 (const MpOperator &H, const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout) |
template<typename MpOperator > | |
void | prodOptimize2 (const MpOperator &H, const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout) |
template<typename MpOperator > | |
void | prodOptimize2 (const MpOperator &H, const Mps< Symmetry, Scalar > &Vin, const Mps< Symmetry, Scalar > &Vout, PivotVector< Symmetry, Scalar > &ApairOut) |
template<typename MpOperator > | |
void | build_LW (size_t loc, const Mps< Symmetry, Scalar > &Vbra, const MpOperator &H, const Mps< Symmetry, Scalar > &Vket, bool RANDOMIZE=false) |
template<typename MpOperator > | |
void | build_RW (size_t loc, const Mps< Symmetry, Scalar > &Vbra, const MpOperator &H, const Mps< Symmetry, Scalar > &Vket, bool RANDOMIZE=false) |
template<typename MpOperator > | |
void | prepSweep (const MpOperator &H, const Mps< Symmetry, Scalar > &Vin1, const Mps< Symmetry, Scalar > &Vin2, Mps< Symmetry, Scalar > &Vout, bool RANDOMIZE=false) |
template<typename MpOperator > | |
void | build_LRW (const MpOperator &H, const Mps< Symmetry, Scalar > &Vin1, const Mps< Symmetry, Scalar > &Vin2, Mps< Symmetry, Scalar > &Vout) |
void | prepSweep (const vector< Mps< Symmetry, Scalar > > &Vin, Mps< Symmetry, Scalar > &Vout) |
void | stateOptimize1 (const vector< Mps< Symmetry, Scalar > > &Vin, const Mps< Symmetry, Scalar > &Vout, vector< PivotVector< Symmetry, Scalar > > &Aout) |
void | stateOptimize2 (const vector< Mps< Symmetry, Scalar > > &Vin, const Mps< Symmetry, Scalar > &Vout, vector< PivotVector< Symmetry, Scalar > > &ApairOut) |
void | build_L (size_t loc, const Mps< Symmetry, Scalar > &Vbra, const vector< Mps< Symmetry, Scalar > > &Vket, bool RANDOMIZE=false) |
void | build_R (size_t loc, const Mps< Symmetry, Scalar > &Vbra, const vector< Mps< Symmetry, Scalar > > &Vket, bool RANDOMIZE=false) |
void | build_LR (const vector< Mps< Symmetry, Scalar > > &Vin, Mps< Symmetry, Scalar > &Vout) |
size_t | loc1 () const |
size_t | loc2 () const |
void | sweep_to_edge (const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout, bool BUILD_LR) |
template<typename MpOperator > | |
void | sweep_to_edge (const MpOperator &H, const Mps< Symmetry, Scalar > &Vin1, const Mps< Symmetry, Scalar > &Vin2, Mps< Symmetry, Scalar > &Vout, bool BUILD_LR, bool BUILD_LWRW) |
void | sweep_to_edge (const vector< Mps< Symmetry, Scalar > > &Vin, Mps< Symmetry, Scalar > &Vout, bool BUILD_LR) |
Private Attributes | |
DMRG::VERBOSITY::OPTION | CHOSEN_VERBOSITY |
vector< PivotOverlap1< Symmetry, Scalar > > | Env |
vector< PivotMatrix1< Symmetry, Scalar, MpoScalar > > | Heff |
vector< vector< PivotOverlap1< Symmetry, Scalar > > > | Envs |
size_t | N_sites |
size_t | N_sweepsteps |
size_t | N_halfsweeps |
size_t | Mcutoff |
size_t | Mcutoff_new |
size_t | Mmax |
size_t | Mmax_new |
double | sqdist |
double | tol |
int | pivot |
DMRG::DIRECTION::OPTION | CURRENT_DIRECTION |
double | t_opt = 0 |
double | t_AA = 0 |
double | t_sweep = 0 |
double | t_LR = 0 |
double | t_ohead = 0 |
double | t_tot = 0 |
|
private |
Definition at line 39 of file MpsCompressor.h.
|
inline |
Definition at line 43 of file MpsCompressor.h.
|
private |
Definition at line 616 of file MpsCompressor.h.
|
private |
Definition at line 918 of file MpsCompressor.h.
|
private |
Definition at line 948 of file MpsCompressor.h.
|
private |
Definition at line 1670 of file MpsCompressor.h.
|
private |
Definition at line 1351 of file MpsCompressor.h.
|
private |
Definition at line 625 of file MpsCompressor.h.
|
private |
Definition at line 933 of file MpsCompressor.h.
|
private |
Definition at line 1361 of file MpsCompressor.h.
string MpsCompressor< Symmetry, Scalar, MpoScalar >::info |
Prints some info about this class.
Definition at line 236 of file MpsCompressor.h.
void MpsCompressor< Symmetry, Scalar, MpoScalar >::lincomboCompress | ( | const vector< Mps< Symmetry, Scalar > > & | Vin, |
const vector< Scalar > & | factors, | ||
Mps< Symmetry, Scalar > & | Vout, | ||
const Mps< Symmetry, Scalar > & | Vguess, | ||
size_t | Minit, | ||
size_t | Mincr = 100 , |
||
size_t | Mlimit = 10000 , |
||
double | tol = 1e-4 , |
||
size_t | max_halfsweeps = 40 , |
||
size_t | min_halfsweeps = 1 |
||
) |
Definition at line 638 of file MpsCompressor.h.
|
inlineprivate |
Definition at line 207 of file MpsCompressor.h.
|
inlineprivate |
Definition at line 208 of file MpsCompressor.h.
double MpsCompressor< Symmetry, Scalar, MpoScalar >::memory | ( | MEMUNIT | memunit = GB | ) | const |
Calculates the (theoretically) allocated memory (note: by default in GB).
Definition at line 290 of file MpsCompressor.h.
void MpsCompressor< Symmetry, Scalar, MpoScalar >::polyCompress | ( | const MpOperator & | H, |
const Mps< Symmetry, Scalar > & | Vin1, | ||
double | polyB, | ||
const Mps< Symmetry, Scalar > & | Vin2, | ||
Mps< Symmetry, Scalar > & | Vout, | ||
size_t | Minit, | ||
size_t | Mincr = 100 , |
||
size_t | Mlimit = 10000 , |
||
double | tol = DMRG_POLYCOMPRESS_TOL , |
||
size_t | max_halfsweeps = DMRG_POLYCOMPRESS_MAX , |
||
size_t | min_halfsweeps = DMRG_POLYCOMPRESS_MIN |
||
) |
Compresses an orthogonal iteration step . Needs to calculate , and . Works optimally with OpenMP and (at least) 3 threads, as the last overlap is cheap to do in the mixed-canonical representation. If convergence is not reached after 4 half-sweeps, the bond dimension of Vout
is increased and it is set to random.
C_n
and A_n
already. [in] | H | : Hamiltonian (an Mps with Mpo::Qtarget() = Symmetry::qvacuum()) rescaled by 2 |
[in] | Vin1 | : input state to be multiplied |
[in] | polyB | : the coefficient before the subtracted vector |
[in] | Vin2 | : input state to be subtracted |
[out] | Vout | : compressed output state |
[in] | Minit | : initial matrix size cutoff per site for Vout |
[in] | Mincr | : matrix size cutoff increment per site for Vout |
[in] | Mlimit | : maximal allowable matrix size cutoff per site for Vout |
[in] | tol | : tolerance for the square norm of the difference: |
tol
will lead to bad convergence. Try something of the order of 1e-3 to 1e-4. [in] | max_halfsweeps | : maximal amount of half-sweeps |
[in] | min_halfsweeps | : minimal amount of half-sweeps |
Definition at line 1371 of file MpsCompressor.h.
|
private |
Definition at line 1203 of file MpsCompressor.h.
|
private |
Definition at line 1609 of file MpsCompressor.h.
|
private |
Definition at line 508 of file MpsCompressor.h.
|
private |
Definition at line 836 of file MpsCompressor.h.
|
private |
void MpsCompressor< Symmetry, Scalar, MpoScalar >::prodCompress | ( | const MpOperator & | H, |
const MpOperator & | Hdag, | ||
const Mps< Symmetry, Scalar > & | Vin, | ||
Mps< Symmetry, Scalar > & | Vout, | ||
qarray< Symmetry::Nq > | Qtot_input, | ||
size_t | Minit, | ||
size_t | Mincr = 100 , |
||
size_t | Mlimit = 10000 , |
||
double | tol = 1e-4 , |
||
size_t | max_halfsweeps = 100 , |
||
size_t | min_halfsweeps = 1 , |
||
std::size_t | savePeriod = 0 , |
||
std::string | saveName = "backup" , |
||
bool | MEASURE_DISTANCE = true , |
||
const MpOperator * | HdagH = NULL |
||
) |
Compresses a matrix-vector product . Needs to calculate . Works optimally with OpenMP and (at least) 2 threads. If convergence is not reached after 2 half-sweeps, the bond dimension of Vout
is increased and it is set to random.
[in] | H | : Operator |
[in] | Hdag | : Adjoint operator |
[in] | Vin | : input state |
[out] | Vout | : compressed output state |
[in] | Qtot_input | : Resulting quantum number for Vout |
[in] | Minit | : matrix size cutoff per site for Vout , good guess: Vin.calc_Mmax() |
[in] | Mincr | : matrix size cutoff increment per site for Vout |
[in] | Mlimit | : maximal allowable matrix size cutoff per site for Vout |
[in] | tol | : tolerance for the square norm of the difference: |
[in] | max_halfsweeps | : maximal amount of half-sweeps |
[in] | min_halfsweeps | : minimal amount of half-sweeps |
[in] | HdagH | : set this if Hdag*H is available as an MPO |
Definition at line 960 of file MpsCompressor.h.
|
private |
Definition at line 1244 of file MpsCompressor.h.
|
private |
Definition at line 1263 of file MpsCompressor.h.
|
private |
Definition at line 1293 of file MpsCompressor.h.
|
private |
Definition at line 1330 of file MpsCompressor.h.
void MpsCompressor< Symmetry, Scalar, MpoScalar >::stateCompress | ( | const Mps< Symmetry, Scalar > & | Vin, |
Mps< Symmetry, Scalar > & | Vout, | ||
size_t | Minit, | ||
size_t | Mincr = 100 , |
||
size_t | Mlimit = 10000 , |
||
double | tol = 1e-4 , |
||
size_t | max_halfsweeps = 40 , |
||
size_t | min_halfsweeps = 1 |
||
) |
Compresses a given Mps . If convergence is not reached after 2 half-sweeps, the bond dimension of Vout
is increased and it is set to random.
[in] | Vin | : input state to be compressed |
[out] | Vout | : compressed output state |
[in] | Minit | : initial matrix size cutoff per site for Vout |
[in] | Mincr | : matrix size cutoff increment per site for Vout |
[in] | Mlimit | : maximal allowable matrix size cutoff per site for Vout |
[in] | tol | : tolerance for the square norm of the difference: |
[in] | max_halfsweeps | : maximal amount of half-sweeps; break if exceeded |
[in] | min_halfsweeps | : minimal amount of half-sweeps |
Definition at line 399 of file MpsCompressor.h.
|
private |
Definition at line 535 of file MpsCompressor.h.
|
private |
Definition at line 550 of file MpsCompressor.h.
|
private |
Definition at line 865 of file MpsCompressor.h.
|
private |
Definition at line 576 of file MpsCompressor.h.
|
private |
Definition at line 602 of file MpsCompressor.h.
|
private |
Definition at line 886 of file MpsCompressor.h.
|
private |
Definition at line 308 of file MpsCompressor.h.
|
private |
Definition at line 343 of file MpsCompressor.h.
|
private |
Definition at line 369 of file MpsCompressor.h.
string MpsCompressor< Symmetry, Scalar, MpoScalar >::t_info |
Prints some info about this class.
Definition at line 270 of file MpsCompressor.h.
|
private |
Definition at line 130 of file MpsCompressor.h.
|
private |
Definition at line 225 of file MpsCompressor.h.
|
private |
Definition at line 135 of file MpsCompressor.h.
|
private |
Definition at line 187 of file MpsCompressor.h.
|
private |
Definition at line 153 of file MpsCompressor.h.
|
private |
Definition at line 220 of file MpsCompressor.h.
|
private |
Definition at line 220 of file MpsCompressor.h.
|
private |
Definition at line 221 of file MpsCompressor.h.
|
private |
Definition at line 221 of file MpsCompressor.h.
|
private |
Definition at line 219 of file MpsCompressor.h.
|
private |
Definition at line 218 of file MpsCompressor.h.
|
private |
Definition at line 219 of file MpsCompressor.h.
|
private |
Definition at line 224 of file MpsCompressor.h.
|
private |
Definition at line 222 of file MpsCompressor.h.
|
private |
Definition at line 228 of file MpsCompressor.h.
|
private |
Definition at line 230 of file MpsCompressor.h.
|
private |
Definition at line 231 of file MpsCompressor.h.
|
private |
Definition at line 227 of file MpsCompressor.h.
|
private |
Definition at line 229 of file MpsCompressor.h.
|
private |
Definition at line 232 of file MpsCompressor.h.
|
private |
Definition at line 222 of file MpsCompressor.h.