xerus
a general purpose tensor library
xerus::ALSVariant::ALSAlgorithmicData Struct Reference

#include <als.h>

Collaboration diagram for xerus::ALSVariant::ALSAlgorithmicData:

Classes

struct  ContractedTNCache
 

Public Member Functions

 ALSAlgorithmicData (const ALSVariant &, const TTOperator *, TTTensor &, const TTTensor &)
 
void choose_energy_functional ()
 chooses the fitting energy functional according to settings and whether an operator A was given More...
 
TensorNetwork localOperatorSlice (size_t _pos)
 
TensorNetwork localRhsSlice (size_t _pos)
 
void move_to_next_index ()
 performs one step in direction, updating all stacks More...
 
void prepare_stacks ()
 prepares the initial stacks for the local operator and local right-hand-side More...
 
void prepare_x_for_als ()
 Finds the range of notes that need to be optimized and orthogonalizes _x properly. More...
 

Public Attributes

const TTOperatorA
 global operator A More...
 
const ALSVariantALS
 the algorithm this data belongs to More...
 
const TTTensorb
 global right-hand-side More...
 
bool canonicalizeAtTheEnd
 whether _x should be canonicalized at the end More...
 
size_t corePosAtTheEnd
 core position that should be restored at the end of the algorithm More...
 
size_t currIndex
 position that is currently being optimized More...
 
Direction direction
 direction of current sweep More...
 
value_t energy
 current value of the energy residual More...
 
std::function< value_t()> energy_f
 the energy functional used for this calculation More...
 
size_t halfSweepCount
 current count of halfSweeps More...
 
value_t lastEnergy
 energy at the end of last halfsweep More...
 
value_t lastEnergy2
 energy at the end of last full sweep More...
 
ContractedTNCache localOperatorCache
 stacks for the local operator (either xAx or xAtAx) More...
 
value_t normB
 norm of the (global) right hand side More...
 
std::pair< size_t, size_t > optimizedRange
 range of indices for the nodes of _x that need to be optimized More...
 
std::function< value_t()> residual_f
 the functional to calculate the current residual More...
 
ContractedTNCache rhsCache
 stacks for the right-hand-side (either xb or xAtb) More...
 
std::vector< size_t > targetRank
 rank for the final x More...
 
TTTensorx
 current iterate x More...
 

Detailed Description

Definition at line 44 of file als.h.

Constructor & Destructor Documentation

◆ ALSAlgorithmicData()

xerus::ALSVariant::ALSAlgorithmicData::ALSAlgorithmicData ( const ALSVariant _ALS,
const TTOperator _A,
TTTensor _x,
const TTTensor _b 
)

Definition at line 322 of file als.cpp.

Member Function Documentation

◆ choose_energy_functional()

void xerus::ALSVariant::ALSAlgorithmicData::choose_energy_functional ( )

chooses the fitting energy functional according to settings and whether an operator A was given

sets energy_f, residual_f

Definition at line 255 of file als.cpp.

◆ localOperatorSlice()

TensorNetwork xerus::ALSVariant::ALSAlgorithmicData::localOperatorSlice ( size_t  _pos)

Definition at line 184 of file als.cpp.

◆ localRhsSlice()

TensorNetwork xerus::ALSVariant::ALSAlgorithmicData::localRhsSlice ( size_t  _pos)

Definition at line 202 of file als.cpp.

◆ move_to_next_index()

void xerus::ALSVariant::ALSAlgorithmicData::move_to_next_index ( )

performs one step in direction, updating all stacks

requires fully initialized data modifies xAxL, xAxR, bxL, bxR, currIndex

Definition at line 340 of file als.cpp.

◆ prepare_stacks()

void xerus::ALSVariant::ALSAlgorithmicData::prepare_stacks ( )

prepares the initial stacks for the local operator and local right-hand-side

requires optimziedRange sets xAxL, xAxR, bxL, bxR

Definition at line 217 of file als.cpp.

◆ prepare_x_for_als()

void xerus::ALSVariant::ALSAlgorithmicData::prepare_x_for_als ( )

Finds the range of notes that need to be optimized and orthogonalizes _x properly.

finds full-rank nodes (these can wlog be set to identity and need not be optimized) requires canonicalizeAtTheEnd and corePosAtTheEnd to be set sets optimizedRange modifies x

Definition at line 105 of file als.cpp.

Member Data Documentation

◆ A

const TTOperator* xerus::ALSVariant::ALSAlgorithmicData::A

global operator A

Definition at line 49 of file als.h.

◆ ALS

const ALSVariant& xerus::ALSVariant::ALSAlgorithmicData::ALS

the algorithm this data belongs to

Definition at line 48 of file als.h.

◆ b

const TTTensor& xerus::ALSVariant::ALSAlgorithmicData::b

global right-hand-side

Definition at line 51 of file als.h.

◆ canonicalizeAtTheEnd

bool xerus::ALSVariant::ALSAlgorithmicData::canonicalizeAtTheEnd

whether _x should be canonicalized at the end

Definition at line 57 of file als.h.

◆ corePosAtTheEnd

size_t xerus::ALSVariant::ALSAlgorithmicData::corePosAtTheEnd

core position that should be restored at the end of the algorithm

Definition at line 58 of file als.h.

◆ currIndex

size_t xerus::ALSVariant::ALSAlgorithmicData::currIndex

position that is currently being optimized

Definition at line 62 of file als.h.

◆ direction

Direction xerus::ALSVariant::ALSAlgorithmicData::direction

direction of current sweep

Definition at line 67 of file als.h.

◆ energy

value_t xerus::ALSVariant::ALSAlgorithmicData::energy

current value of the energy residual

Definition at line 65 of file als.h.

◆ energy_f

std::function<value_t()> xerus::ALSVariant::ALSAlgorithmicData::energy_f

the energy functional used for this calculation

Definition at line 59 of file als.h.

◆ halfSweepCount

size_t xerus::ALSVariant::ALSAlgorithmicData::halfSweepCount

current count of halfSweeps

Definition at line 66 of file als.h.

◆ lastEnergy

value_t xerus::ALSVariant::ALSAlgorithmicData::lastEnergy

energy at the end of last halfsweep

Definition at line 64 of file als.h.

◆ lastEnergy2

value_t xerus::ALSVariant::ALSAlgorithmicData::lastEnergy2

energy at the end of last full sweep

Definition at line 63 of file als.h.

◆ localOperatorCache

ContractedTNCache xerus::ALSVariant::ALSAlgorithmicData::localOperatorCache

stacks for the local operator (either xAx or xAtAx)

Definition at line 53 of file als.h.

◆ normB

value_t xerus::ALSVariant::ALSAlgorithmicData::normB

norm of the (global) right hand side

Definition at line 55 of file als.h.

◆ optimizedRange

std::pair<size_t, size_t> xerus::ALSVariant::ALSAlgorithmicData::optimizedRange

range of indices for the nodes of _x that need to be optimized

Definition at line 56 of file als.h.

◆ residual_f

std::function<value_t()> xerus::ALSVariant::ALSAlgorithmicData::residual_f

the functional to calculate the current residual

Definition at line 60 of file als.h.

◆ rhsCache

ContractedTNCache xerus::ALSVariant::ALSAlgorithmicData::rhsCache

stacks for the right-hand-side (either xb or xAtb)

Definition at line 54 of file als.h.

◆ targetRank

std::vector<size_t> xerus::ALSVariant::ALSAlgorithmicData::targetRank

rank for the final x

Definition at line 52 of file als.h.

◆ x

TTTensor& xerus::ALSVariant::ALSAlgorithmicData::x

current iterate x

Definition at line 50 of file als.h.


The documentation for this struct was generated from the following files: