|
xerus
a general purpose tensor library
|
Wrapper class for all ALS variants (dmrg etc.) More...
#include <als.h>
Classes | |
| struct | ALSAlgorithmicData |
Public Types | |
| enum | Direction { Increasing, Decreasing } |
| using | LocalSolver = std::function< void(const TensorNetwork &, std::vector< Tensor > &, const TensorNetwork &, const ALSAlgorithmicData &)> |
| the algorithm that is used to solve the local problems More... | |
Public Member Functions | |
| ALSVariant (uint _sites, size_t _numHalfSweeps, LocalSolver _localSolver, bool _assumeSPD, bool _useResidual=false) | |
| fully defining constructor. alternatively ALSVariants can be created by copying a predefined variant and modifying it More... | |
| double | operator() (const TTOperator &_A, TTTensor &_x, const TTTensor &_b, value_t _convergenceEpsilon, PerformanceData &_perfData=NoPerfData) const |
| double | operator() (const TTOperator &_A, TTTensor &_x, const TTTensor &_b, size_t _numHalfSweeps, PerformanceData &_perfData=NoPerfData) const |
| double | operator() (const TTOperator &_A, TTTensor &_x, const TTTensor &_b, PerformanceData &_perfData=NoPerfData) const |
| double | operator() (TTTensor &_x, const TTTensor &_b, value_t _convergenceEpsilon, PerformanceData &_perfData=NoPerfData) const |
| double | operator() (TTTensor &_x, const TTTensor &_b, size_t _numHalfSweeps, PerformanceData &_perfData=NoPerfData) const |
| double | operator() (TTTensor &_x, const TTTensor &_b, PerformanceData &_perfData=NoPerfData) const |
Static Public Member Functions | |
| static void | ASD_solver (const TensorNetwork &_A, std::vector< Tensor > &_x, const TensorNetwork &_b, const ALSAlgorithmicData &_data) |
| static void | lapack_solver (const TensorNetwork &_A, std::vector< Tensor > &_x, const TensorNetwork &_b, const ALSAlgorithmicData &_data) |
| local solver that calls the corresponding lapack routines (LU solver) More... | |
Public Attributes | |
| bool | assumeSPD |
| if true the operator A will be assumed to be symmetric positive definite More... | |
| value_t | convergenceEpsilon |
| default value for the change in the energy functional at which the ALS assumes it is converged More... | |
| const size_t | FLAG_FINISHED_FULLSWEEP = 3 |
| const size_t | FLAG_FINISHED_HALFSWEEP = 1 |
| LocalSolver | localSolver |
| size_t | numHalfSweeps |
| maximum number of sweeps to perform. set to 0 for infinite More... | |
| bool | preserveCorePosition |
| if true the core will be moved to its original position at the end More... | |
| uint | sites |
| the number of sites that are simultaneously optimized More... | |
| bool | useResidualForEndCriterion |
| calculates the residual to decide if the ALS converged. recommended if _perfdata is given. implied if assumeSPD = false More... | |
Protected Member Functions | |
| bool | check_for_end_of_sweep (ALSAlgorithmicData &_data, size_t _numHalfSweeps, value_t _convergenceEpsilon, PerformanceData &_perfData) const |
| TensorNetwork | construct_local_operator (ALSAlgorithmicData &_data) const |
| TensorNetwork | construct_local_RHS (ALSAlgorithmicData &_data) const |
| double | solve (const TTOperator *_Ap, TTTensor &_x, const TTTensor &_b, size_t _numHalfSweeps, value_t _convergenceEpsilon, PerformanceData &_perfData=NoPerfData) const |
Wrapper class for all ALS variants (dmrg etc.)
By creating a new object of this class and modifying the member variables, the behaviour of the solver can be modified. The local solver will be ignored for all calls to the x=b variants (ie. without operator A)
| using xerus::ALSVariant::LocalSolver = std::function<void(const TensorNetwork &, std::vector<Tensor> &, const TensorNetwork &, const ALSAlgorithmicData &)> |
|
inline |
|
static |
|
protected |
|
protected |
|
protected |
|
static |
|
inline |
call to solve \( A\cdot x = b\) for \( x \) (in a least-squares sense)
| _A | operator to solve for | |
| [in,out] | _x | in: initial guess, out: solution as found by the algorithm |
| _b | right-hand side of the equation to be solved | |
| _convergenceEpsilon | minimum change in residual / energy under which the algorithm terminates | |
| _perfData | vector of performance data (residuals after every microiteration) |
|
inline |
call to solve \( A\cdot x = b\) for \( x \) (in a least-squares sense)
| _A | operator to solve for | |
| [in,out] | _x | in: initial guess, out: solution as found by the algorithm |
| _b | right-hand side of the equation to be solved | |
| _numHalfSweeps | maximum number of half-sweeps to perform | |
| _perfData | vector of performance data (residuals after every microiteration) |
|
inline |
call to solve \( A\cdot x = b\) for \( x \) (in a least-squares sense)
| _A | operator to solve for | |
| [in,out] | _x | in: initial guess, out: solution as found by the algorithm |
| _b | right-hand side of the equation to be solved | |
| _perfData | vector of performance data (residuals after every microiteration) |
|
inline |
call to minimze \( \|x - b\|^2 \) for \( x \)
| [in,out] | _x | in: initial guess, out: solution as found by the algorithm |
| _b | right-hand side of the equation to be solved | |
| _convergenceEpsilon | minimum change in residual / energy under which the algorithm terminates | |
| _perfData | vector of performance data (residuals after every microiteration) |
|
inline |
call to minimze \( \|x - b\|^2 \) for \( x \)
| [in,out] | _x | in: initial guess, out: solution as found by the algorithm |
| _b | right-hand side of the equation to be solved | |
| _numHalfSweeps | maximum number of half-sweeps to perform | |
| _perfData | vector of performance data (residuals after every microiteration) |
|
inline |
|
protected |
| bool xerus::ALSVariant::assumeSPD |
| value_t xerus::ALSVariant::convergenceEpsilon |
| LocalSolver xerus::ALSVariant::localSolver |
| size_t xerus::ALSVariant::numHalfSweeps |
| bool xerus::ALSVariant::preserveCorePosition |
| uint xerus::ALSVariant::sites |
| bool xerus::ALSVariant::useResidualForEndCriterion |