Full Doxygen Index

class AbstractNode

This is an abstract node in the tree of a TTBasis.

Public Functions

AbstractNode()
virtual ~AbstractNode()
virtual size_t nTotalNodes() const = 0
virtual size_t nNodes() const = 0
virtual size_t nLeaves() const = 0
virtual AbstractNode *nextNode() = 0
virtual AbstractNode *nextSCFNode(AbstractNode *in) = 0
virtual AbstractNode *nextNodeManthe() = 0
virtual void info(ostream &os) const = 0
virtual void write(ostream &os) const = 0
virtual int type() const = 0
virtual void setParent(AbstractNode *Up) = 0
virtual void update(const NodePosition &p) = 0
class ActiveCounter : public NodeAttribute<vector<size_t>>
#include <ActiveCounter.h>

Counts how many nodes are active per summand in a SOP.

Public Functions

ActiveCounter()
~ActiveCounter()
void initialize(SparseMatrixTreescd &hmats, SparseMatrixTreescd &hcons, const SOPcd &S, const Tree &tree)
class BlockTree

Public Functions

BlockTree()
~BlockTree()
BlockTree(const Tree &tree, const Range &range, const vector<Labels> &leaf_labels, size_t max_dim)
void initialize(const Tree &tree, const Range &range, const vector<Labels> &leaf_labels, size_t max_dim)
BlockTensor bottomBlockTensor(const Labels &labels)
ConfigurationTensor upperTensorUp(const Label &label, const Node &node)
size_t nNeighbors(const Node &node, int hole)

1: 01, 10, | 00 00 | 01, 10 2: 11 | 00 (2+0) 00 | 11 (0+2) 01, 10 | 01, 10 (1+1)

BlockTensor randomBlockTensor(const Node &node, int hole, const Range &range, const Tree &tree)
void print(const Tree &tree)
template<class Q, class T, typename U>
class BS_integrator
#include <BS_integrator.h>

This is a Bulirsch-Stoer Integrator.

The design of this class is loosely related to the implementation of a numerical recipes book.

class CDVR

Public Functions

CDVR(const Tree &tree)
~CDVR()
void Update(const Wavefunction &Psi, const PotentialOperator &V, const Tree &tree, size_t part = 0, bool out = false, ostream &os = cout)
Tensorcd apply(Tensorcd Phi, const SpectralDecompositioncd &rho_x, const Node &node) const
Tensorcd applySym(Tensorcd Phi, const SpectralDecompositioncd &rho_x, const Node &node) const
void update(SymTensorTree &Psi, const PotentialOperator &V, const Tree &tree, size_t part = 0, bool out = false, ostream &os = std::cout)

Public Members

TDDVR tddvr_

Private Members

Tree ltree_
TensorTreecd Vnode_
MatrixTreed Vedge_
DeltaVTree deltaV_
TensorTreecd Cdown_
TensorTreecd Cup_
WorkMemorycd mem_
class CMFIntegrator
#include <CMFIntegrator.h>

The constant mean-field integrator for solving the mctdh-EOM.

In the CMF-Integrator the mctdh-Matrices are assumed to be constant for a given time to propagate a Wavefunction.

Public Functions

CMFIntegrator(const Hamiltonian &H, const Tree &tree, const Tree &cdvrtree, complex<double> phase)
CMFIntegrator(const Hamiltonian &H, const Tree &tree, complex<double> phase)
~CMFIntegrator()
void Integrate(IntegratorVariables &ivars, ostream &os = cout)
double Error(const Wavefunction &Psi, const Wavefunction &Chi, const MatrixTreecd &rho, const Tree &tree) const
void Output(double time, const Wavefunction &Psi, const Wavefunction &Psistart, const Hamiltonian &H, const Tree &tree, ostream &os)

Private Functions

void CMFstep(Wavefunction &Psi, double time, double timeend, double accuracy_leaf, const Tree &tree)

Private Members

ofstream cdvr_file_
size_t cdvr_nr_
HamiltonianRepresentation matrices_
vector<bs_integrator> bs_integrators_
vector<double> dt_bs_
vector<LayerInterface> interfaces_
double tconst_
double max_increase_
template<typename T = size_t>
class Configuration : public vector<T>

Public Types

template<>
using Base = vector<T>

Public Functions

Configuration()
~Configuration()
Configuration(const vector<T> &a)
Configuration(const initializer_list<T> &list)
Configuration operator*(const Configuration &r) const
bool operator==(const Configuration &r) const
template<typename T = size_t>
class ConfigurationTensor : public vector<Configuration<T>>

Public Types

template<>
using Base = vector<Configuration<T>>

Public Functions

ConfigurationTensor()
~ConfigurationTensor()
ConfigurationTensor(size_t len)
ConfigurationTensor(const initializer_list<Configuration<T>> &list)
ConfigurationTensor(const initializer_list<initializer_list<T>> &list)
bool operator==(const ConfigurationTensor &r) const
ConfigurationTensor operator+(const ConfigurationTensor &r) const
ConfigurationTensor operator*(const ConfigurationTensor &r) const
template<typename T = size_t>
class ConfigurationTree

Public Functions

ConfigurationTree()
~ConfigurationTree()
ConfigurationTree(const Tree &tree)
void initialize(const Tree &tree)
void print(const Tree &tree) const

Public Members

NodeAttribute<ConfigurationTensor<T>> up_
NodeAttribute<ConfigurationTensor<T>> down_
NodeAttribute<Configuration<T>> idx_up_
NodeAttribute<Configuration<T>> idx_down_
class CoordinateTransformation

Public Functions

CoordinateTransformation()
~CoordinateTransformation()
virtual Vectord transform(const Vectord &x) const
class DeltaMemory

Public Functions

DeltaMemory(const Tensorcd &Phi, const vector<SparseMatrixTreecd> &Hmats, const SOPcd &sop, const Node &node)
~DeltaMemory()

Public Members

Matrixcd ml_
Tensorcd workA
Tensorcd workB
class DeltaOperator

Public Functions

DeltaOperator(const Tensorcd &Phi, const vector<SparseMatrixTreecd> &Hmats, const vector<SparseMatrixTreecd> &Holes, const SOPcd &sop, const Node &node)
~DeltaOperator()
size_t dim1() const
size_t dim2() const

Public Members

vector<Tensorcd> hPhi_
const vector<SparseMatrixTreecd> &holes_
size_t npart_
const Node &node_
class DeltaVTree : public NodeAttribute<Tensorcd>

Public Functions

DeltaVTree(const Tree &tree)
~DeltaVTree()
void Initialize(const Tree &tree)
void print(const Tree &tree)
struct Diagonalizer

Public Functions

Diagonalizer(mt19937 &gen)

Public Members

size_t p = 10
mt19937 &gen_
class DVRBasis : public LeafInterface

Subclassed by HO_Basis, LegendrePolynomials

Public Functions

DVRBasis()
DVRBasis(int dim)
virtual ~DVRBasis()
void initialize(double par0, double par1, double par2, double par3) = 0
void initSPF(Tensorcd &A) const = 0
void applyX(Tensorcd &uA, const Tensorcd &A) const
void applyX2(Tensorcd &uA, const Tensorcd &A) const
void applyP(Tensorcd &uA, const Tensorcd &A) const
void applyKin(Tensorcd &uA, const Tensorcd &A) const
void toGrid(Tensorcd &uA, const Tensorcd &A) const
void fromGrid(Tensorcd &uA, const Tensorcd &A) const
int oSQR() const
Vectord &getX()
const Vectord &getX() const
bool hasDVR() const

Protected Attributes

Vectord x_
Matrixd trafo_
Matrixd kin_
Matrixcd p_
double omega_
double r0_
double wfr0_
double wfomega_
int dim_
class Edge

Public Functions

Edge(const Node &down, const Node &up)
const Node &down() const
const Node &up() const
size_t downIdx() const
size_t upIdx() const

Private Members

const Node *down_
const Node *up_
template<class A>
class EdgeAttribute : public vector<A>

Public Functions

A &operator[](const Edge &e)
const A &operator[](const Edge &e) const
class EntropyTree : public NodeAttribute<double>

Public Functions

EntropyTree()
~EntropyTree()
EntropyTree(const Tree &tree)
void initialize(const Tree &tree)
void calculate(const TensorTreecd &Psi, const Tree &tree)
void perplexity(const TensorTreecd &Psi, const Tree &tree, size_t power = 1)
void print(const Tree &tree)
double metric(const Tree &tree) const
class FFT

Public Functions

FFT()
~FFT()
Tensorcd forwardFFT(const Tensorcd &in)
Tensorcd backwardFFT(const Tensorcd &in)

Protected Functions

Tensorcd generalFFT(const Tensorcd &in, const int sign)
Tensorcd factor2FFT(const Tensorcd &in, const int sign)
Tensorcd dft(const Tensorcd &in, const int sign)
Tensorcd reverseOrder(const Tensorcd &in)
void danielsonLanczosAlgorithm(Tensorcd &in, const int sign)
size_t getGoodSize(size_t size)
vector<size_t> primeFactorization(size_t number) const
class FFTCooleyTukey

Public Functions

FFTCooleyTukey()
~FFTCooleyTukey()
void Reverse(Vectorcd &A)
void init(int dim)
void fft(Vectorcd &A)
void ifft(Vectorcd &A)
Vectorcd subfft(const Vectorcd &A, int offset, int parts, const Vectorcd &twiddle)

Protected Attributes

int dim_
int logdim_
Vectorcd trafo_
Vectorcd trafoback_
class FFTGrid : public LeafInterface

Public Functions

FFTGrid(int dim)
~FFTGrid()
void initialize(double omega, double r0, double wfr0, double wfomega)
void applyX(Tensorcd &uA, const Tensorcd &A) const
void applyX2(Tensorcd &uA, const Tensorcd &A) const
void applyP(Tensorcd &uA, const Tensorcd &A) const
void applyKin(Tensorcd &uA, const Tensorcd &A) const
void initSPF(Tensorcd &A) const
const Vectord &getX() const
Vectord &getX()
void toGrid(Tensorcd &uA, const Tensorcd &A) const
void fromGrid(Tensorcd &uA, const Tensorcd &A) const
int oSQR() const
bool hasDVR() const

Protected Attributes

Vectord x_
Vectord p_
Matrixcd trafo_
double x0_
double x1_
double wfr0_
double wfomega_
int dim_
struct Fidelity
#include <TreeApplyOperator.h>

The mlmcApply namespace contains functions that can be used to apply operators on a wavefunction.

The namespace provides a method for applying SOPcd operators on wavefunctions that scales quadratically with respect to the number of summands. Furthermore, some functions are used by other classes that allow to apply SOPcd operators on wavefunctions.

The present scheme for applying operators is described in Ref. [1]

[1] R. Ellerbrock, T. J. Martínez, to be submitted (2019)

Public Functions

void append(double f)

simple tracker for fidelity

void calculate(const TensorTreecd &Psi, const TensorTreecd &Psilast, const SOPcd &u, const Tree &tree, WorkMemorycd *mem)
void print(ostream &os = cout) const
void write(const string &name = "fidelity.dat", const string &header = "")

Public Members

vector<double> history_
double avg_ = 1.
double total_ = 1.

geometric average

double logTotal_ = 0.
size_t numberOperations_ = 0
ofstream os_ = ofstream("fidelity.dat")
class FortranOperator : public LeafOperator<complex<double>>

Public Functions

FortranOperator()
~FortranOperator()
void Initialize(int part_, int mode_, int dim_, FortranSystemH SystemH_)
void apply(const LeafInterface &grid, Tensorcd &hAcoeff, const Tensorcd &Acoeff) const

Protected Attributes

int part
int mode
int dim
FortranSystemH SystemH
class FortranSOP : public SumOfProductsOperator<complex<double>>

Public Functions

FortranSOP(const Tree &basis)
FortranSOP()
~FortranSOP()
Wavefunction ApplyFlux(const Wavefunction &Psi, const Tree &tree)
Wavefunction ApplyDividingSurface(const Wavefunction &Psi, const Tree &tree)
void InitializeFortranPara(const Tree &tree)

Protected Functions

void SpecialInitialize(const Tree &tree)

Protected Attributes

int nparts
int nmodes
vector<Matrixd> matrix
vector<Matrixd> trafo
MLOcd FluxOperator
MLOcd DividingSurface
FortranSystemH SystemH

Private Functions

void callHinit(Vectorcd &coeffs, Matrix<int> &diag)
void InitOperator()
class Hamiltonian : public SumOfProductsOperator<complex<double>>

Public Functions

Hamiltonian()
~Hamiltonian()

Public Members

PotentialOperator V_
bool hasV
class HamiltonianRepresentation

Public Functions

HamiltonianRepresentation(const Hamiltonian &H, const Tree &tree, const Tree &cdvrtree, bool tail = true)
HamiltonianRepresentation(const Hamiltonian &H, const Tree &tree)
void initializeDense(const Hamiltonian &H, const Tree &tree)
~HamiltonianRepresentation()
void build(const Hamiltonian &H, const Wavefunction &Psi, const Tree &tree, double time)
void buildUp(const Hamiltonian &H, const Wavefunction &Psi, const Node &node, double time)
void buildDown(const Hamiltonian &H, const Wavefunction &Psi, const Node &node, double time)
void buildSCF(const Hamiltonian &H, const Wavefunction &Psi, const Tree &tree, double time)
void buildSCF(const Hamiltonian &H, const Wavefunction &Psi, const Node &node, const Node &next, double time)
void buildUpCorrection(const Hamiltonian &H, const Wavefunction &Psi, const Node &node)
void buildDownCorrection(const Hamiltonian &H, const Wavefunction &Psi, const Node &node)
void buildCorrection(const Hamiltonian &H, const Wavefunction &Psi, const Tree &tree)
void print(const Tree &tree, ostream &os = cout)

Public Members

int counter_ = 0
MatrixTreecd rho_
SpectralDecompositionTreecd rho_decomposition_
MatrixTreecd rho_inverse_
SparseMatrixTreescd hMats_
SparseMatrixTreescd hContractions_
bool corrections_
SparseMatrixTreecd hCorr_

decides whether corrections are turned on or off

SparseMatrixTreecd hConCorr_

correction term for hMats

ActiveCounter nActives_

correction term for hCon

WorkMemorycd mem_
CDVR cdvr_
class HO_Basis : public DVRBasis

Public Functions

HO_Basis()
~HO_Basis()
HO_Basis(int dim)
void initialize(double omega, double r0, double wfr0, double wfomega)
void initSPF(Tensorcd &phi) const

Protected Functions

Matrixd InitXmat()
Matrixcd InitPmat()
Matrixd InitKin()
class IntegratorInterface

Public Functions

IntegratorInterface(const Hamiltonian &H, const Tree &tree, complex<double> phase = 1.)
~IntegratorInterface()
Wavefunction Derivative(double t, const Wavefunction &Psi)

Private Members

const Hamiltonian &H_
const Tree &tree_
complex<double> phase_
HamiltonianRepresentation hRep_
Wavefunction dPsi_
struct IntegratorVariables

Public Functions

IntegratorVariables(double time_now_, double time_end_, double dt_, double out_, double accuracy_root_, double accuracy_leaf_, Wavefunction &Psi_, const Hamiltonian &h_, const Tree &tree_, const Tree &cdvrtree_, string ofname_, string ifname_, bool append, bool cmf_bottom = true, bool cmf_upper = true, bool cmf_top = true)

Public Members

double time_now
double time_end
double dt
double out
double accuracy_root
double accuracy_leaf
TensorTreecd *psi
const Hamiltonian *h
const Tree *tree
const Tree *cdvrtree
string ofname
string ifname
bool append_
bool cmf_bottom_
bool cmf_upper_
bool cmf_top_
struct KrylovSpace

Public Functions

KrylovSpace(const TensorShape &shape, size_t size)
KrylovSpace(vector<Tensorcd> space, SpectralDecompositioncd spectrum)

Public Members

vector<Tensorcd> space_
SpectralDecompositioncd spectrum_
class LabelDimensionTree

Public Functions

LabelDimensionTree()
~LabelDimensionTree()
LabelDimensionTree(const LabelTree &label_tree, size_t max_dim, const Tree &tree)
LabelDimension createDimension(const NodeAttribute<Labels> &labels, size_t nbox, size_t max_dim, const Node &node)
void initialize(const LabelTree &label_tree, size_t max_dim, const Tree &tree)
void print(const Tree &tree) const
class LabelTree

Public Functions

LabelTree()
~LabelTree()
LabelTree(const Tree &tree, const vector<Labels> &leaf_labels, const Range &range)
void initialize(const Tree &tree, const vector<Labels> &leaf_labels, const Range &range)
void print(const Tree &tree)

Public Members

NodeAttribute<Labels> up_
NodeAttribute<Labels> down_
template<class A, typename k>
class Lanzcos

Public Functions

Lanzcos()
void buildKrylovSpace(const Tensor<k> &v, size_t N, double parameter, A Operator, function<void(A&, const double, Tensor<k>&, const Tensor<k>&)> apply)
void diagonalizeKrylovSpace()
Tensorcd applyfunction(double parameter, function<double(double)> fun) const
Tensorcd getEigenstates()
vector<double> getEigenvalues()

Private Functions

void checkBuild() const
void checkDiagonal() const

Private Members

vector<Matrixcd> a_
vector<Matrixcd> b_
vector<Tensor<k>> kV_
Matrixcd transformation_
Vectord eigenvalues_
bool diagonal_
class LayerInterface

Public Functions

LayerInterface(const Hamiltonian &H, const HamiltonianRepresentation &hRep, const Node &node, complex<double> propagation_phase)
~LayerInterface()
void Derivative(double time, Tensorcd &dPhi, const Tensorcd &Phi)
double Error(const Tensorcd &Phi, const Tensorcd &Chi) const

Public Members

complex<double> propagation_phase_

Private Members

const Hamiltonian *h_
const HamiltonianRepresentation *hRep_
const Node *node_
class Leaf
#include <Leaf.h>

This class represents the leaf in the tree of a TTBasis.

The leafs represent the lowest layer (even below the bottomlayer) in a tree of a TTBasis. Leaves contain abstract class pointers to PrimitiveBasis which provides the interface to the problem under consideration.

template<typename T>
class LeafFunction
#include <LeafFunction.h>

This class allows to use functions as LeafOperators.

class LeafInterface

Subclassed by DVRBasis, FFTGrid, SpinGroup

Public Functions

LeafInterface()
virtual ~LeafInterface()
virtual void initialize(double par0, double par1, double par2, double par3) = 0
virtual void initSPF(Tensorcd &A) const = 0
virtual void initSPF(Tensord &A) const
virtual void applyX(Tensorcd &xA, const Tensorcd &A) const = 0
virtual void applyX2(Tensorcd &x2A, const Tensorcd &A) const = 0
virtual void applyP(Tensorcd &pA, const Tensorcd &A) const = 0
virtual void applyKin(Tensorcd &kinA, const Tensorcd &A) const = 0
void identity(Tensorcd &IPhi, const Tensorcd &Phi) const
virtual const Vectord &getX() const = 0
virtual Vectord &getX() = 0
virtual void toGrid(Tensorcd &UA, const Tensorcd &A) const = 0
virtual void fromGrid(Tensorcd &UA, const Tensorcd &A) const = 0
virtual int oSQR() const = 0
virtual bool hasDVR() const = 0
template<typename T>
class LeafMatrix
#include <LeafMatrix.h>

This class allows to create LeafOperators from (factor) Matrices.

template<typename T>
class LeafOperator
#include <LeafOperator.h>

This class represents a single particle operator acting on a single leaf.

Subclassed by FortranOperator

class LegendrePolynomials : public DVRBasis

Public Functions

LegendrePolynomials(int dim)
void initialize(double omega, double r0, double wfr0, double wfomega)
void initSPF(Tensorcd &Acoeffs) const
void applyP(Tensorcd &pA, const Tensorcd &A) const

Protected Functions

Matrixd InitXmat()
Matrixd InitKin()
class LinearizedLeaves
#include <LinearizedLeaves.h>

The class holds a vector of references to the leaves in the TTBasis.

template<typename T>
class Matrix

This class represents a Matrix.

This is a simple Matrix-class. The functions that are implemented are specially suited for QuantumDynamics simulations.

Usage:

Matrixcd M(dim1, dim2);
Matrixcd A(M);
A = M * (A + M);

Bracket Operators

Group of functions for accessing Matrix elements

T &operator()(const size_t i, const size_t j) const

Two-indexed accessor.

Return

Value

Parameters
  • i: Row

  • j: Column

T &operator()(const size_t i, const size_t j)

Two-indexed accessor.

Return

Value

Parameters
  • i: Row

  • j: Column

T &operator[](const size_t idx) const

Compound-index accessor.

Return

Value

Parameters
  • idx: Compound index

T &operator[](const size_t idx)

Compound-index accessor.

Return

Value

Parameters
  • idx: Compound index

Arithmetic Operators

Group of functions and operator overloadings for performing arithmetic operations on Matrices

Matrix<T> &operator+=(const Matrix<T> &B)

In-place elementwise matrix addition.

Return

Incremented Matrix

Parameters

Matrix<T> &operator-=(const Matrix<T> &B)

In-place elementwise matrix subtraction.

Return

Decremented Matrix

Parameters

Matrix<T> &operator*=(T coeff)

In-place elementwise scalar matrix multiplication.

Return

Scaled Matrix

Parameters
  • coeff: Scalar

Matrix<T> &operator/=(T coeff)

In-place elementwise scalar matrix division.

Return

Scaled Matrix

Parameters
  • coeff: Scalar

bool operator==(const Matrix<T> &A) const

Matrix equality.

Return

True if precisely equal, False otherwise

Parameters

bool operator!=(const Matrix<T> &A) const

Matrix inequality.

Return

True if not precisely equal, False otherwise

Parameters

template<typename U>
Matrix operator*(const U sca, const Matrix &B)

Scalar elementwise multiplication.

Return

Scaled Matrix

Template Parameters
  • U: Type for scalar

Parameters
  • sca: Scalar value

  • B: Target Matrix

template<typename U>
Matrix operator*(const Matrix &B, const U sca)
Vector<T> operator*(const Matrix &A, const Vector<T> v)

Matrix-vector product.

Return

Result of A*v

Parameters

Matrix operator*(const Matrix &A, const Matrix &B)

Matrix-matrix product.

Return

Result of A*B

Parameters

Matrix operator+(const Matrix &A, const Matrix &B)

Elementwise matrix addition.

Return

Result of A + B

Parameters

Matrix operator-(const Matrix &A, const Matrix &B)

Elementwise matrix subtraction.

Return

Result of A - B

Parameters

Math Operators

Group of functions for common Matrix mathematical operations

double frobeniusNorm() const

Return

Frobenius norm

T trace() const

Return

trace of matrix

Matrix<T> adjoint() const

Return

Adjoint of matrix

Matrix<T> conjugate() const

Return

conjugate of matrix

Matrix<T> transpose() const

Return

Transposed matrix

Matrix<T> cInv() const

invert a complex Matrix

Return

Inverted Matrix

void rDiag(Matrix<double> &Transformation, Vector<double> &ev) const

Diagonalization of a real Matrix.

Uses Eigen to diagonalize the Matrix. Phases eigenvectors s.t. first element is always positive.

Parameters
  • Transformation: Matrix of eigenvectors

  • ev: Vector of eigenvalues

SpectralDecompositiond rDiag() const

Diagonalization of a real Matrix.

Exactly like Matrix::rDiag(Matrixd&, Vectord&) but returns copies instead of pass by reference

Return

Eigenvectors/value as a pair of <Matrixd, Vectord>

void cDiag(Matrix<complex<double>> &Transformation, Vector<double> &ev) const

Diagonalization of a complex Matrix.

Uses Eigen to diagonalize the Matrix. Phases eigenvectors s.t. first element is always positive.

Parameters
  • Transformation: Matrix of eigenvectors

  • ev: Vector of eigenvalues

SpectralDecompositioncd cDiag() const

Diagonalization of a complex Matrix.

Exactly like Matrix::cDiag(Matrixcd&, Vectord&) but returns copies instead of pass by reference

Return

Eigenvectors/value as a pair of <Matrixcd, Vectord>

Vectord solveSLE(const Vectord &b)

Solve linear system of equations.

In the system of equations Ax=b, solve for x given A and b

Return

x Vector

Parameters
  • b: RHS vector

void zero()

Zero out the Matrix.

I/O Operators

Group of functions for input and output

void print(ostream &os = cout) const
void write(const string &filename) const
void write(ostream &os) const
void read(const string &filename)
void read(istream &os)

Getters/Setters

Vector<T> row(size_t i) const
Vector<T> col(size_t i) const
Vector<T> diag() const
size_t dim1() const
size_t dim2() const
T *ptr() const

Public Functions

Matrix()

Zero constructor equivalent to Matrix(1,1);.

Matrix(size_t dim1, size_t dim2)

Zero constructor.

Parameters
  • dim1: size of first dimension

  • dim2: size of second dimension

Matrix(size_t dim1, size_t dim2, T *ptr, bool ownership, bool InitZero)

Zero constructor.

Parameters
  • dim1: size of first dimension

  • dim2: size of second dimension

  • ptr: pointer to pre-allocated memory

  • ownership: if true, matrix will take care of deallocation

  • InitZero: if true, set entries to zero

Matrix(istream &is)

Constructor from input stream.

Parameters
  • is: Input stream passed to read()

Matrix(const string &filename)

Constructor from file.

Parameters
  • filename: File to load and pass to read()

Matrix(const Matrix &old)

Copy constructor.

Parameters

Matrix(Matrix &&old)

Move constructor.

Parameters

Matrix<T> &operator=(const Matrix &other)

Copy assignment constructor.

Return

Copied matrix

Parameters

Matrix<T> &operator=(Matrix &&other)

Move assignment constructor.

Return

Moved Matrix

Parameters

~Matrix()

Destructor.

Protected Attributes

T *coeffs_
size_t dim1_
size_t dim2_
bool ownership_
class MatrixTensorTree : public pair<TensorTreecd, MatrixTreecd>, public pair<Wavefunction, MatrixTreecd>

Public Functions

MatrixTensorTree()
MatrixTensorTree(const Wavefunction &Psi, const Tree &tree, bool orthogonal)
void initialize(const Wavefunction &Psi, const Tree &tree, bool orthogonal)

All-normalized wavefunction representation with A’s and B_inv’s.

const TensorTreecd &nodes() const
TensorTreecd &nodes()
const MatrixTreecd &edges() const
MatrixTreecd &edges()
const TensorTreecd &DensityWeighted() const
void buildNodes(TensorTreecd Psi, const Tree &tree)
void buildEdges(const Tree &tree)
void buildFromWeighted(const Tree &tree)
TensorTreecd topDownNormalized(const Tree &tree) const
TensorTreecd bottomUpNormalized(const Tree &tree) const
MatrixTensorTree()
MatrixTensorTree(const TensorTreecd &Psi, const Tree &tree, bool orthogonal)
void initialize(TensorTreecd Psi, const Tree &tree)

All-normalized wavefunction representation with A’s and B_inv’s.

const TensorTreecd &nodes() const
TensorTreecd &nodes()
const MatrixTreecd &edges() const
MatrixTreecd &edges()
const TensorTreecd &densityWeighted() const
void buildNodes(const TensorTreecd &Psi, const Tree &tree)
void buildEdges(const Tree &tree)
void buildFromWeighted(const Tree &tree)
TensorTreecd topDownNormalized(const Tree &tree) const
TensorTreecd bottomUpNormalized(const Tree &tree) const
template<typename T>
class MatrixTree
template<typename T>
class MatrixTree
class MultiIndex

Public Functions

MultiIndex(vector<size_t> &boundaries)
MultiIndex(size_t size, size_t length)
MultiIndex(const MultiIndex &multi)
void Zero()
void Max()
void print() const
void operator++(int a)
void operator--(int a)
size_t operator()(size_t a) const
size_t operator[](size_t a) const
bool Below() const
bool After() const
MultiIndex operator+(MultiIndex &multi)
void Erase(size_t position)
void Erase(size_t startPosition, size_t endPosition)
void pop_back()
void Replace(size_t position, size_t newBoundary)
size_t Linearize()
size_t FastLinearize()
size_t Before(size_t a)
size_t Active(size_t a)
size_t After(size_t a)
size_t DimTot() const

Protected Functions

void calculateTotal()

Protected Attributes

vector<size_t> currentState_
vector<size_t> boundaries_
size_t length_
size_t linear_
size_t total_
template<typename T>
class MultiLeafOperator
#include <MultiLeafOperator.h>

A MultiLeafOperator (MLO) is a product of general single-particle operators.

A MultiLeafOperator is one summand in a SumofProducts operator. It can be applied to a TensorTree resulting in a wavefunction with a different bottomlayer-Tensors. The MLO is central for building hamiltonians.

Please note:

  • The recommended operator to build MLO is SPOf or SPOM (due to performance)

  • SPO initialization might be removed in the future

  • TensorTrees with different lower-node Tensors cannot (straightforwardly) be added without loss of information.

class Node
#include <Node.h>

This class manages a node in the tree-structured TTBasis representation.

The class holds the tensor-dimensions (TensorDim) at the current node and holds the connectivity to the parent & all child nodes (parent and child(s)). The node also knows wether it is a toplayer or bottomlayer-node. If the Node is a bottomlayer node, it holds a Leaf. Accessing Leaf or sublying Nodes (non-leaves) for incorrect nodes will stop the program. Please use the TTBasis iterator to swipe over all nodes in a TTBasis. The parent and child getters should only be used to access local connectivity.

template<class A>
class NodeAttribute
#include <NodeAttribute.h>

Base class for creating objects at every node in a tree.

For every node in a TTBasis, there is one corresponding Object of class A. Inherit from this class for fast prototyping. Make sure that attributes_ gets cleared and filled in a constructor. Automatically provides iterators and bracket operators for Node objects.

class NodeContent

Public Functions

NodeContent()
NodeContent(size_t n_, size_t f_ = 1)
~NodeContent()
void print(size_t indent = 0, std::ostream &os = std::cout) const

Public Members

size_t f
size_t n
int nextnodenr_
size_t address_
TensorDim tdim_
Path path_
class NodeOperator

Public Functions

NodeOperator(size_t part, size_t mode)
~NodeOperator()
size_t mode() const
size_t part() const
bool operator==(const NodeOperator &h) const
void Print(const vector<string> &names, size_t indent = 0) const

Private Members

size_t mode_
size_t part_
class NodePosition
#include <NodePosition.h>

This class manages the position information in a tree, mainly for I/O purposes.

class NodeSOP : public vector<NodeProductOperator>

Public Functions

NodeSOP()
~NodeSOP()
void push_back(const NodeProductOperator &M, const complex<double> coeff)
complex<double> Coeff(size_t part) const

Private Members

vector<complex<double>> coeffs
class Parameter

a leaf.

class Potential

Public Functions

Potential()
virtual ~Potential()
virtual void initialize(const Tree &tree)
virtual double evaluate(const Vectord &Xv, size_t part) const = 0
class PotentialOperator
#include <PotentialOperator.h>

This Operator tells if a potential operator is present.

This Operator marks a potential operator in a MultiLeafOperator.

This operator tells that a potential acts is present. It also manages the number of degrees of freedom used in the PES and the state_ used in the PES.

The class is only relevant when working with quadrature methods on tensor trees.

class Range
#include <U1Symmetry.h>

range of allowed labels, e.g. particle number <= 5 and >= 0

Public Functions

Range(Label min, Label max)
bool isAllowed(size_t x) const
Labels numbers() const

Public Members

Label min_ = {0}
Label max_ = {1}
template<class Container, class Model, typename U>
class RK_integrator
#include <RungeKutta4.h>

This class performs a 4th order Runge-Kutta integration for a given Model, Container and Type.

Template Parameters
  • Container: is a class holding all required memory to obtain the derivatives

  • Model: is the object you want to integrate. E.g. a Tensor, a TensorTree, etc.

  • U: is the underlying datatype, E.g. double, complex<double>, float, etc.

Public Functions

RK_integrator()
RK_integrator(size_t dim, const Model &empty)
~RK_integrator()
void Integrate(Model &y, double &t, double tend, double &dt, double eps, function<void(Container&, double, Model&, const Model&)> ddx, function<double(Container&, Model&, Model&)> err, Container &I, )
void step(U &t, Model &y, U dt, Container &I, function<void(Container&, double, Model&, const Model&)> ddx)

Parameters
  • t: is current time

  • y: is current Model (Tensor, TensorTree, …)

  • dt: is stepsize in time

  • I: is the memory container

  • ddx:

  • container:

Public Members

Model k1
Model k2
Model k3
Model k4
struct SCF_parameters

Public Members

size_t nIter = {20}
size_t nKrylov = {5}

how many iterations

size_t nITP = {0}

how large is the krylov space

double beta = {1.}

how many steps of imaginary time propagation

size_t output = {0}

how large should beta be?

double conversion = {219474.6313705e0}

output wavefunction every iteration

TensorTreecd *psi = {nullptr}
const Hamiltonian *h = {nullptr}
const Tree *tree = {nullptr}
class SimultaneousDiagonalization
#include <SimultaneousDiagonalization.h>

This class performs a simulatneous diagonalization.

Attempts to diagonalize a set of, potentially not commuting, matrices.

Public Functions

SimultaneousDiagonalization()
~SimultaneousDiagonalization()
void initialization(vector<Matrixcd> &A, double eps)
void calculate(vector<Matrixcd> &A, Matrixcd &trafo)

Protected Functions

void jacobiRotations(vector<Matrixcd> &A, Matrixcd &trafo)
double measureOffDiagonals(const vector<Matrixcd> &A)
double measureDiagonality(vector<Matrixcd> &A)
void initialTransformation(vector<Matrixcd> &A, Matrixcd &trafo)

Protected Attributes

int dim_
int nmat_
double eps_
template<typename T>
class SOPMatrixTrees

Public Functions

SOPMatrixTrees(const SOP<T> &H, const Tree &tree)
void print() const
size_t size() const

Public Members

vector<SparseMatrixTree<T>> matrices_
vector<SparseMatrixTree<T>> contractions_
template<typename T>
class SOPVector
#include <SOPVector.h>

Dressed up vector of SOPs.

template<typename T>
class SparseMatrixTree : public SparseNodeAttribute<Matrix<T>>

Public Functions

SparseMatrixTree(shared_ptr<SparseTree> active_, const Tree &tree)

Create HoleMatrixTree for a given tree-marker.

SparseMatrixTree(const Tree &tree)
SparseMatrixTree(const MLO<T> &M, const Tree &tree, bool tail = true, bool inverse_tree = false)

Create HoleMatrixTree only for relevant nodes for a given Operator.

SparseMatrixTree(const vector<size_t> &targets, const Tree &tree, bool tail = true, bool inverse_tree = false)

Create HoleMatrixTree only for relevant nodes for a given Operator.

~SparseMatrixTree()
void initialize(const Tree &tree)

Create Matrices for active_ nodes in the tree.

void print(ostream &os = cout) const

I/O.

void write(ostream &os) const
void write(const string &filename) const
void read(istream &is)
void read(const string &filename)
template<typename T>
class SparseTensorTree : public SparseNodeAttribute<Tensor<T>>

Public Functions

SparseTensorTree(const SparseTree &stree, const Tree &tree)
SparseTensorTree(shared_ptr<SparseTree> &stree, const Tree &tree)
SparseTensorTree(const vector<size_t> &leaf_indices, const Tree &tree, bool tail = true, bool inverse_tree = false)

Create HoleMatrixTree only for relevant nodes for a given Operator.

~SparseTensorTree()
void initialize(const Tree &tree)

Private Members

T *mem_
template<class A>
class SparseTreeStructuredObject
#include <SparseNodeAttribute.h>

This is a central base class for objects that are sparsely tree-structured.

This is a sparse version of the TreeStructuredObject. It provides a sparse handling for objects that are only present at some nodes.

class SparseVectorTreed : public SparseNodeAttribute<Vectord>

Public Functions

SparseVectorTreed(const MLOcd &M, const Tree &tree, bool tail = true, bool inverse_tree = false)
SparseVectorTreed(const SparseTree &stree, const Tree &tree)
void initialize(const Tree &tree)
template<typename T>
class SpectralDecompositionTree : public NodeAttribute<SpectralDecomposition<T>>

Public Functions

SpectralDecompositionTree()
SpectralDecompositionTree(const Tree &tree)
SpectralDecompositionTree(const MatrixTree<T> &H, const Tree &tree)
~SpectralDecompositionTree()
void initialize(const Tree &tree)
void calculate(const MatrixTree<T> &H, const Tree &tree)
MatrixTree<T> invert(const Tree &tree, double eps = 1e-7)
void print(const Tree &tree) const

I/O.

class SpinGroup : public LeafInterface

Public Functions

SpinGroup(size_t dim)
~SpinGroup()
void initialize(double par0, double par1, double par2, double par3)
void applyX(Tensorcd &uA, const Tensorcd &A) const
void applyX2(Tensorcd &uA, const Tensorcd &A) const
void applyP(Tensorcd &uA, const Tensorcd &A) const
void applyKin(Tensorcd &uA, const Tensorcd &A) const
void initSPF(Tensorcd &Acoeffs) const
const Vectord &getX() const
Vectord &getX()
void toGrid(Tensorcd &uA, const Tensorcd &Acoeffs) const
void fromGrid(Tensorcd &uA, const Tensorcd &Acoeffs) const
int oSQR() const
bool hasDVR() const

Private Members

Vectord x_
size_t dim_
bool last_
double alpha_
template<typename T>
class SumOfProductsOperator
#include <SumOfProductsOperator.h>

This class represents a sum-of-products operator.

SOPs are sums of MultiParticleOperators. The class provides basic arithmetics that allows to perform high-level operations on operators.

class SymMatrixTree : public pair<SparseMatrixTreecd, SparseMatrixTreecd>

Public Functions

SymMatrixTree(const Tree &tree)
SymMatrixTree(const SparseMatrixTreecd &A, const SparseMatrixTreecd &B)
const SparseMatrixTreecd &up() const
SparseMatrixTreecd &up()
const SparseMatrixTreecd &down() const
SparseMatrixTreecd &down()
class SymTensorTree

Public Functions

SymTensorTree(double eps = 1e-6)
SymTensorTree(TensorTreecd Psi, const Tree &tree)
~SymTensorTree()
void initialize(const Tree &tree)

Goal: create a symmetric TTN that has a weighted Tensor ONLY at the root node Add weighted tensor at other nodes in future implementation.

SymTensorTree(mt19937 &gen, const Tree &tree, bool delta_lowest = true)
void orthogonal(const Tree &tree)
void orthogonalUp(const Tree &tree)
void orthogonalDown(const Tree &tree)
void normalizeWeighted(const Tree &tree)
void normalize(const Tree &tree)

Public Members

TensorTreecd weighted_
TensorTreecd up_
TensorTreecd down_
double eps_
class SymTreeGrid : public pair<TreeGrids, TreeGrids>

Public Functions

SymTreeGrid()
~SymTreeGrid()
SymTreeGrid(const Tree &tree)
const TreeGrids &up() const
TreeGrids &up()
const TreeGrids &down() const
TreeGrids &down()
void print(const Tree &tree) const
class SymXMatrixTrees

Public Functions

SymXMatrixTrees(const Tree &tree)
~SymXMatrixTrees()
void update(const SymTensorTree &Psi, const Tree &tree)

Public Members

SOPcd xops_
SymMatrixTrees xmat_
class TDDVR

Public Functions

TDDVR(const Wavefunction &Psi, const Tree &tree)
TDDVR(const Tree &tree)
void GridTransformation(MatrixTensorTree &Psi, const Tree &tree, bool inverse = false) const
void GridTransformation(SymTensorTree &Psi, const Tree &tree, bool inverse = false) const
void update(const Wavefunction &Psi, const Tree &tree)
void update(const SymTensorTree &Psi, const Tree &tree)
void print(const Tree &tree) const
void NodeTransformation(Tensorcd &Phi, const Node &node, bool inverse) const
void downTransformation(Tensorcd &Phi, const Node &node, bool inverse) const
void upTransformation(Tensorcd &Phi, const Node &node, bool inverse) const
void upTransformation(SymTensorTree &Psi, const Tree &tree, bool inverse) const
void downTransformation(SymTensorTree &Psi, const Tree &tree, bool inverse) const

Public Members

TreeGrids grids_
MatrixTreecd trafo_
TreeGrids hole_grids_
MatrixTreecd hole_trafo_
XMatrixTrees Xs_
SymXMatrixTrees symx_
SymMatrixTree strafo_
SymTreeGrid sgrids_

Private Functions

void NodeTransformation(Wavefunction &Psi, const Tree &tree, bool inverse) const
void EdgeTransformation(Matrixcd &B_inv, const Edge &edge, bool inverse) const
void EdgeTransformation(MatrixTreecd &B_inv, const Tree &tree, bool inverse) const

Private Members

MatrixTreecd rho_
WorkMemorycd mem_
double eps_ = {1e-8}
template<typename T>
class Tensor
#include <Tensor.h>

This class represents a set of mathematical Tensors of n-th order.

The class allows to handle arithmentic operations on Tensors like matrix-products, etc. The set of tensors can be interpreted simultaneously as a set of vectors and thus operations are available like orthogonalizations, Dot-products, etc. Superindex mappings are used frequently throughout the class functions.

Usage: TensorDim dim_({2, 3, 4}, 1); Tensorcd A(dim_);

class TensorDim
#include <TensorShape.h>

This class manages the dimensions of a Tensor.

This class holds the tensor dimensions n=(n_1,…,n_order). It is a decorated vector of (unsigned) integers (the dimensions). The class, furthermore, manages contracted dimensions for quick reshapings. doxygen/xml/TensorDim_1.pngdoxygen/xml/TensorDim_1.eps_

Usage: TensorDim tdim({2, 3, 4});

class TensorDimTree

Public Functions

TensorDimTree()
~TensorDimTree()
TensorDimTree(size_t n_layers, size_t n, size_t N, size_t d)
void Update()
void print(ostream &os = cout) const
vector<reference_wrapper<TreeNode>>::const_iterator begin() const
vector<reference_wrapper<TreeNode>>::const_iterator end() const
size_t nLeaves() const
const TreeNode &Leaf(size_t k) const
TreeNode &Leaf(size_t k)

Private Members

TreeNode root_
vector<reference_wrapper<TreeNode>> nodes_
vector<reference_wrapper<TreeNode>> phys_nodes_
template<typename T>
class TensorOperatorRepresentation : public TensorTree<T>

Public Functions

TensorOperatorRepresentation()
TensorOperatorRepresentation(const Tree &tree, const SOP<T> &S)
~TensorOperatorRepresentation()
template<typename T>
class TensorTree
#include <TensorTree.h>

This class represents tensor trees.

Usage: Tree tree = balancedTree(12, 2, 2); // Create Tensor with Zero-entry tensors at every node TensorTreecd Psi(tree); Psi.Write(“filename.dat”); TensorTreecd Chi(“filename.dat”);

Subclassed by TensorOperatorRepresentation< T >, TensorTreeOperator< T >

template<typename T>
class TensorTreeOperator : public TensorTree<T>

Public Functions

TensorTreeOperator()
TensorTreeOperator(const Tree &optree)
TensorTreeOperator(const Tree &optree, mt19937 &gen)
TensorTreeOperator(const MLO<T> &M, const Tree &optree)
TensorTreeOperator(const SOP<T> &S, const Tree &optree)
~TensorTreeOperator()
void occupy(const Tree &optree)
void occupy(const Tree &optree, mt19937 &gen)
void print(const Tree &optree) const
void setLeafOperator(const Matrix<T> &M, size_t operator_idx, const Node &node)
void setLeafOperator(const LeafMatrix<T> &M, size_t operator_idx, const Node &node)
class Tree

This class manages the tensor tree tree.

TensorTreeBasis (TTBasis) holds and manages the tree structure and holds tensor dimensions at every node. It provides iterators for swiping over every node in a tree. For a bottom-up swipe though the tree use the iterator; for a top-down swipe use a regular for loop and get Nodes via GetNode(i).

Usage: Tree tree(n_leaves dim_leaves, dim_nodes); // Create close to balanced tree for (const Node& node : tree) { // Do something - bottom-up swipe }

for (int i = tree.nNodes() - 1; i > 0; i) { const Node& node = tree.GetNode(i); // Do something - Top-child swipe } or for (auto it = tree.rbegin(); it != tree.rend(); it++) {

}

for (size_t l = 0; l < nLeaves; ++l) { const Leaf& leaf = GetLeaf(l); // Do something - for every leaf }

Public Functions

Tree()

Default constructor.

~Tree()

Default Destructor.

Tree(istream &is)

File constructor.

Tree(const string &filename)

Stream constructor.

Tree(const Tree &T)

Copy constructor.

Tree(Tree &&T)

Move constructor.

Tree &operator=(const Tree &T)

Copy assignment operator.

Tree &operator=(Tree &&T)

Move assignment operator.

void read(istream &is)

read Basis from ASCII-file

I/O.

void read(const string &filename)
void write(ostream &os = cout) const

Write the tree to a stream in ASCII output.

void update()

re-initialize the tree from Tree

void info(ostream &os = cout) const

Print out tree information.

size_t nTotalNodes() const

number of Nodes

size_t nNodes() const

number of logical nodes

size_t nLeaves() const

number of physical nodes

size_t nStates() const

Number of states.

AbstractNode &nextNode()

Return the reference to the next node. This routine is only used for initialization once. Please use the iterator, or mctdhNode(i) functions to address nodes!

Leaf &getLeaf(size_t i)

get reference to Physical Coordinate i/nPhysNodes

const Leaf &getLeaf(size_t i) const
Node &getNode(size_t i)

get reference to mctdh-node i/nmctdhNodes

const Node &getNode(size_t i) const
Node &topNode()

get reference to the mctdh topnode

const Node &topNode() const
void reindexLeafModes(map<size_t, size_t> Map)

Assign new indices to leaves.

void resetLeafModes()

Reset indices of leaves.

void expandNode(Node &node)

Expand a node in the Basis.

void replaceNode(Node &old_node, Node &new_node)

replace a node in the tree with a new node

void setRoot(Node &root)

Set the root of the tree and update the TreeShape.

vector<reference_wrapper<Node>>::const_iterator begin() const

Bottom-up iterator over all nodes in the mctdh-tree For top-up iteration examples refer to e.g. the density-matrix class.

vector<reference_wrapper<Node>>::const_iterator end() const

Bottom-up const iterator over all nodes in the mctdh-tree For top-up iteration examples refer to e.g. the density-matrix class.

vector<reference_wrapper<Node>>::const_reverse_iterator rbegin() const

Top-down iterator over all nodes in the mctdh-tree.

vector<reference_wrapper<Node>>::const_reverse_iterator rend() const

Bottom-up const iterator over all nodes in the mctdh-tree.

bool isWorking()

Check whether TensorTreeBasis is working correctly.

void print(ostream &os = cout) const

Human readable output of the tree shape.

const vector<Edge> &edges() const
const LinearizedNodes &nodes() const
vector<size_t> rangeLeaves() const

return range of 1 to n_leaves

vector<const Node *> neighbors(const Node &from, int hole = -1) const

Protected Functions

void linearizeNodes()
void linearizeLeaves()

Protected Attributes

LinearizedLeaves linearizedLeaves_

Reference block to physical coordinates.

LinearizedNodes linearizedNodes_

Reference block to mctdh-nodes.

vector<Edge> edges_
Node root_

MCTDH tree holds memory.

class TreeGrids : public vector<SparseVectorTreed>

Public Functions

TreeGrids()
TreeGrids(const Tree &tree, bool inverse_tree = false)
void print(const Tree &tree) const
class TreeMarker
#include <SparseTree.h>

This class marks a subset of active Nodes in a tree.

The class is used to mark Nodes when working with sparseness in tree structure. Typically, nodes are marked by providing a list of active leaves. In this case, the TreeMarker searches for the Nodes connectinb the leaves and saving the corresponding Node pointers in a list. co_address stores the mapping of the global Node address in TTBasis to the sparse address.

class TreeNode

Public Functions

TreeNode()

Rule of five-section (constructors & destructors)

A simple tree-node class.

TreeNode(size_t n)
TreeNode(NodeContent con)
~TreeNode()
TreeNode(const TreeNode &node)

Copy constructor.

TreeNode(TreeNode &&node)

Move constructor.

TreeNode &operator=(const TreeNode &old)

Copy asignment operator.

TreeNode &operator=(TreeNode &&old)

Move asignment operator.

TreeNode *NextNode()

Member functions.

void push_back(const TreeNode &node)
size_t size() const
size_t Address() const
void SetAddress(size_t addr)
const TensorDim &TDim() const
void SetTDim(const TensorDim &tdim)
const TreeNode &Down(size_t k) const
TreeNode &Down(size_t k)
void print(std::ostream &os = std::cout) const
bool IsLeaf() const
bool IsBottom() const
bool IsRoot() const
size_t Layer() const
Path GetPath() const
void SetPath(const Path &newpath)
void SetPhysicalNodes(size_t &next)
void UpdateTensorDim()
void MakeRoot()
void GenInput(ostream &os = cout) const

Public Members

NodeContent content_

Private Members

TreeNode *up_
std::vector<TreeNode *> down_
class TreeSOP : public NodeAttribute<NodeSOPlist>
#include <TreeSOP.h>

A Tree-structured Sum-of-Product (SOP) Operator.

Public Functions

TreeSOP()
TreeSOP(const Tree &tree)
~TreeSOP()
void Initialize(const Tree &tree)
LeafOperatorLib &leafOperatorLib(const Node &node)
const LeafOperatorLib &leafOperatorLib(const Node &node) const
void push_back(const LeafOperatorLib &lib, const vector<string> &names)
void print(const Tree &tree) const
vector<vector<string>> LeafOperatorLibNames() const
bool empty() const

Private Functions

virtual void SpecialInitializeBottom(const Tree &tree)
virtual void SpecialInitialize(const Tree &tree)

Private Members

vector<LeafOperatorLib> leafoperatorlibs
vector<vector<string>> leafoperatornames
template<typename T>
class TTOcontraction : public NodeAttribute<vector<Matrix<T>>>

Public Functions

TTOcontraction()
TTOcontraction(const Tree &tree, const Tree &optree)
void initialize(const Tree &tree, const Tree &optree)
~TTOcontraction()
Tensor<T> applyMatrices(Tensor<T> A, const vector<size_t> &ls, const TensorTreeOperator<T> &H, const TTOrepresentation<T> &Hrep, const Node &parent, int hole) const
void calculateLayer(const Tensor<T> &Psi, const TensorTreeOperator<T> &H, const TTOrepresentation<T> &Hrep, const Tensor<T> &Chi, const Node &opnode)
void calculate(const TensorTree<T> &Psi, const TensorTreeOperator<T> &H, const TTOrepresentation<T> &Hrep, const TensorTree<T> &Chi, const Tree &optree)
void print(const Tree &tree) const
template<typename T>
class TTOHoleTree : public NodeAttribute<Matrix<T>>

Public Functions

TTOHoleTree()
~TTOHoleTree()
TTOHoleTree(const SOP<T> &S, const Tree &tree)
void gatherMk(vector<Matrix<T>> &Mk, const Node &parent) const

Parameters
  • Mk:

  • parent: of node at which calculation is performed (NOT node itself!)

void represent(const TensorTreeOperator<T> &A, const TTOMatrixTree<T> &M, const Tree &tree)
template<typename T>
class TTOMatrixTree : public MatrixTree<T>

Public Functions

TTOMatrixTree(const SOP<T> &S, const Tree &tree)
~TTOMatrixTree()
vector<Matrix<T>> gatherMk(const Node &node) const
Tensor<T> convertToTensor(const vector<Matrix<T>> &Mk)
void representLayer(const TensorTreeOperator<T> &A, const SOP<T> &S, const Node &node)
void represent(const TensorTreeOperator<T> &A, const SOP<T> &S, const Tree &tree)
void print(const Tree &tree)
template<typename T>
class TTOrepresentation : public NodeAttribute<vector<Matrix<T>>>

Public Functions

TTOrepresentation()
TTOrepresentation(const Tree &tree, const Tree &optree)
void initialize(const Tree &tree, const Tree &optree)
~TTOrepresentation()
Tensor<T> applyMatrices(Tensor<T> A, const Tensor<T> &B, const size_t l, const Leaf &leaf) const
Tensor<T> applyMatrices(Tensor<T> A, const Tensor<T> &B, const vector<size_t> &ls, const Node &opnode, int hole) const
void calculateLayer(const Tensor<T> &Psi, const TensorTreeOperator<T> &H, const Tensor<T> &Chi, const Node &opnode)
void calculate(const TensorTree<T> &Psi, const TensorTreeOperator<T> &H, const TensorTree<T> &Chi, const Tree &optree)
void print(const Tree &tree) const
template<typename T>
class Vector

This class is a Vector represented in a basis.

The class is a simple version of a represented Vector. The class is suited for Quantum Dynamics simulations; it is not a generell purpose library class.

Public Functions

Vector()
Vector(size_t dim)

Constructors, Destructors, Asignment operators ~ Rule of Five ~

Vector(const string &filename)
Vector(istream &is)
Vector(const Vector &old)
Vector(Vector &&old)
Vector<T> &operator=(const Vector &other)
Vector<T> &operator=(Vector &&other)
~Vector()
void write(const string &filename) const
void write(ostream &os) const
void read(const string &filename)
void read(istream &is)
void print(ostream &os = cout) const
T operator()(size_t i) const
T &operator()(size_t i)
T operator[](size_t i) const
T &operator[](size_t i)
Vector<T> operator+=(Vector b)
Vector<T> operator-=(Vector b)
Vector<T> operator+(Vector b) const
Vector<T> operator-(Vector b) const
T operator*(Vector b) const
Vector<T> &operator*=(T coeff)
Vector<T> &operator/=(T coeff)
Vector<T> operator*(T coeff) const
Vector<T> operator/(T coeff) const
double norm() const
void zero()
size_t dim() const

Protected Attributes

T *coeffs_
size_t dim_

Friends

Vector operator*(T a, const Vector<T> &A)
template<typename T>
class WorkMemory

Public Functions

WorkMemory()
~WorkMemory()
WorkMemory(const Tree &tree)
WorkMemory(const SparseTree &stree)
WorkMemory(const Node &node)

Public Members

Tensor<T> work1_
Tensor<T> work2_
Tensor<T> work3_
class XMatrixTrees

Public Functions

XMatrixTrees(const Tree &tree)
~XMatrixTrees()
void Update(const Wavefunction &Psi, const Tree &tree)
void UnweightContractions(vector<SparseMatrixTreecd> &holes, const Wavefunction &Psi, const Tree &tree) const
Tensorcd Optimize(const Tensorcd &Phi, const Matrixcd &rho, const Node &node, const Node &node_small) const
Wavefunction Optimize(Wavefunction Psi, const MatrixTreecd &rho, const Tree &tree, const Tree &tree_small)
void print() const
size_t size() const

Public Members

SOPcd xops_
SparseMatrixTreescd mats_
SparseMatrixTreescd holes_
double eps_
namespace cdvr_functions

Functions

void fillXNode(Vectord &X, vector<size_t> idx, const TreeGrids &grids, const TreeGrids &holegrids, const Node &node)
void fillXEdge(Vectord &X, vector<size_t> idx, const TreeGrids &grids, const TreeGrids &holegrids, const Node &node)
void calculateDeltaVs(DeltaVTree &deltaVs, const TensorTreecd &Cup, const TensorTreecd &Cdown, const TensorTreecd &Vnodes, const MatrixTreed &Vedges, const Tree &tree)
void apply(Tensorcd &VPhi, const Tensorcd &Xi, const Tensorcd &V, const TensorTreecd &Cdown, const DeltaVTree &deltaVs, const Node &node, const WorkMemorycd &mem)
void fillX(Vectord &X, size_t idx, const TreeGrids &grids, const Node &node)

Notes on notation: Cdown: Top-down normalized, reads C^{p(p k)} in equations Cup: Bottom-up normalized, reads C^{p(p 0)} in equations Fill a vector with grid points corresponding to intex “idx”.

Parameters
  • X:

  • idx:

  • grids:

  • node:

Tensorcd buildE(const Tensorcd &subDeltaV, const Tensorcd &D, const Node &node, size_t k)
void contractEF(Tensorcd &deltaV, const Tensorcd &E, const Tensorcd &F, const Node &node, size_t k)
void deltaEdgeCorrection(Tensorcd &deltaV, const Tensorcd &Cup, const TensorTreecd &Cdown, const DeltaVTree &DeltaVs, const Node &node)
void calculateDeltaEdgeLocal(Tensorcd &deltaV, const Tensorcd &Cup, const Tensorcd &Vnode, const Matrixd &Vedge, const Node &node)
Matrixcd applyDeltaV(const Tensorcd &deltaV, const Matrixcd &x, size_t dim)
void applyCorrection(Tensorcd &VPhi, const Tensorcd &Phi, const Tensorcd &C, const Tensorcd &deltaV, const Node &child, const WorkMemorycd &mem)
namespace chrono
namespace JacobiRotationFramework

This namespace contains functions for Jacobi rotations algorithms.

namespace JordanWigner

Functions

Matrixd sigmaX()
Matrixd identity()
Matrixcd sigmaY()
Matrixd sigmaZ()
Matrixd sigmaPlus()
Matrixd sigmaMinus()
namespace OptimizeGrid

Typedefs

typedef pair<Matrixcd, size_t> MatrixIdx

Functions

Matrixcd BuildX(const Tensorcd &Phi, const Matrixcd &rho, const Node &node)
Tensorcd OptimizeUp(const Tensorcd &Phi, const Matrixcd &rho, const Node &node, const Node &node_small)
ExplicitEdgeWavefunction OptimizeUp(ExplicitEdgeWavefunction Psi, const Tree &tree, const Tree &tree_small)
namespace QM

Functions

constexpr complex<double> QM::im(0., 1.)

Variables

constexpr double pi = 3.1415926535897932384626433832795
constexpr double two_pi = 2. * pi
constexpr double cm = 219474.6313705
constexpr double eV = 27.2114
constexpr double fs = 41.362
constexpr double Ha_K = 315777.09
namespace qutree

Functions

void init_rng()

Variables

std::mt19937 rng
namespace Random

Functions

template<typename T, class LinearOperator, class Mem>
Matrix<T> randomQ(const LinearOperator &A, size_t k_plus_p, mt19937 &gen, Mem *mem)

Create matrix Q as required by random algorithms in Ref. [1].

[1] SIAM Rev., 53(2), 217–288. (72 pages)

Return

Random Matrix Q as required by Ref. [1].

Template Parameters
  • Mem: container for memory attached to linear operator

Parameters
  • A: the linear operator used for preconditioning the random matrix

  • k_plus_p: dimension of the random space. Refers to notation in Ref. [1]

template<typename T, class LinearOperator, class Mem>
SpectralDecomposition<T> diagonalizeRandom(const LinearOperator &A, size_t rank, size_t pow, mt19937 &gen, Mem *mem = nullptr)
template<typename T>
Matrix<T> randomGauss(size_t dim1, size_t dim2, mt19937 &gen)

Draw a random matrix from the gaussian unitary ensemble.

Return

Matrix with random gaussian unitary entries.

Template Parameters
  • T: base type

Parameters
  • dim1: number of rows of the matrix

  • dim2: number of columns of the matrix

  • gen: random number generator

template<typename T>
Matrix<T> gue(size_t dim, mt19937 &gen)

Return

GUE matrix created by symmetrizing a random Gaussian matrix.

Template Parameters
  • T: base type

Parameters
  • dim: dimension of square matrix

  • gen: random number generator

template<typename T>
Matrix<T> product(const Matrix<T> &x, const Matrix<T> &y, void *mem)
namespace RandomMatrices

Functions

Matrixcd randomRealGauss(size_t dim1, size_t dim2, mt19937 &gen)
Matrixcd randomGauss(size_t dim1, size_t dim2, mt19937 &gen)
Vectorcd gaussVector(size_t dim, mt19937 &gen)
Matrixcd randomProjector(size_t dim1, size_t dim2, mt19937 &gen)
Matrixcd gue(size_t dim, mt19937 &gen)
Matrixd goe(size_t dim, mt19937 &gen)
Matrixcd gueProjector(size_t dim1, size_t dim2, mt19937 &gen)

Build AP.

Matrixcd randomProjection(const Matrixcd &A, size_t stat_dim, mt19937 &gen)
Matrixcd randomQ(const Matrixcd &A, size_t k_plus_p, mt19937 &gen)
SpectralDecompositioncd diagonalizeRandom(const Matrixcd &A, size_t rank, size_t p, mt19937 &gen)

randomized Factorizations

Matrixcd buildQ(const Matrixcd &A, size_t k_plus_p, mt19937 &gen)
SVDcd svdRandom(const Matrixcd &A, size_t rank, mt19937 &gen)
Matrixcd randomSparse(size_t dim1, size_t dim2, mt19937 &gen)
Vectord probabilitiyDist(const Matrixcd &A)

entropy & cross entropy

Probability distribution framework Take absolute square of diagonals(A)

double entropy(const Vectord &p)
double crossEntropy(const Vectord &p, const Vectord &q)
double entropy(const Matrixcd &p)
double crossEntropy(const Matrixcd &p, const Matrixcd &q)
double crossEntropyDifference(const Matrixcd &p, const Matrixcd &q)
vector<Vectorcd> buildKrylovSpace(Vectorcd x, const Matrixcd &A, size_t dim_subspace)

Krylov subspace stuff.

template<typename T>
void gramSchmidt(Vector<T> &v, const vector<Vector<T>> &es)
Matrixcd toMatrix(const vector<Vectorcd> &x)
SpectralDecompositioncd gueDiag(size_t dim, mt19937 &gen)
SpectralDecompositiond goeDiag(size_t dim, mt19937 &gen)
Matrixcd gue(size_t dim1, size_t dim2, mt19937 &gen)
namespace RungeKutta4
namespace SparseMatrixTreeFunctions

This class provides functions to build SparseMatrixTrees.

SparseMatrixTrees typically appear when representing operators in a tensortree basis. Similar to MatrixTree, a SparseMatrixTree can be build bottom-up or top-down in a tree. A SparsematrixTree is build bottom-up if an operator is represented and top-down if the representation of the operator is represented.

namespace std

Functions

bool is_number(const std::string &s)

Check whether string is a natural number https://stackoverflow.com/questions/4654636/how-to-determine-if-a-string-is-a-number-with-c

namespace chrono
namespace Tensor_Extension

Functions

tuple<Tensorcd, Matrixcd, Vectord> SVD(const Tensorcd &A)
tuple<Matrixcd, Matrixcd, Vectord> SVD(const Matrixcd &A)
template<typename T>
Tensor<T> regularize(Tensor<T> A, size_t k, double eps)
Tensorcd normalize(Tensorcd A, size_t k, double eps)
template<typename T>
Matrix<T> map(const Tensor<T> &A)
template<typename T>
Tensor<T> merge(Tensor<T> A, const Tensor<T> &B)
template<typename T>
void OuterProductAdd(Matrix<T> &M, const Tensor<T> &A, const Tensor<T> &B)
template<typename T>
Matrix<T> outerProduct(const Tensor<T> &A, const Tensor<T> &B)
template<typename T>
Matrix<T> weightedOuterProduct(const Tensor<T> &A, const Tensor<T> &B, const Matrix<T> &M)
template<typename T>
void weightedOuterProductAdd(Matrix<T> &M, const Tensor<T> &A, const Tensor<T> &B, const Matrix<T> &rho)
template<typename T>
Tensor<T> doubleHoleContraction(const Tensor<T> &A, const Tensor<T> &B, size_t k1, size_t k2)
void shiftIndices(vector<size_t> &Ibreak, const TensorShape &shift, bool beforeLast, bool last)

Direct Sum + Product.

TensorShape directSum(const TensorShape &A, const TensorShape &B, bool before, bool last)
template<typename T>
Tensor<T> directSum(const Tensor<T> &A, const Tensor<T> &B, bool before, bool last)
template<typename T>
Tensor<T> directProduct(const Tensor<T> &A, const Tensor<T> &B)
template<typename T>
void generate(Tensor<T> &A, mt19937 &gen)

Random number routines for tensors.

template<typename T>
void generate(Matrix<T> &A, mt19937 &gen)
template<typename T>
void generate(Vector<T> &A, mt19937 &gen)
template<typename T>
void generateNormal(T *A, size_t n, mt19937 &gen)

Random number routines for tensors.

Randomly occupy Tensors and Matrices

template<typename T>
Matrix<T> oldStateAveragedHoleProduct(const Tensor<T> &A, const Tensor<T> &B, size_t k)
template<typename T, typename U>
Tensor<T> oldMultAB(const Matrix<U> &A, const Tensor<T> &B, size_t mode)
template<typename T, typename U>
Tensor<T> oldmultStateAb(const Matrix<U> &A, const Tensor<T> &B)
TensorShape DirectProduct(const TensorShape &A, const TensorShape &B)
size_t mergeIndex(size_t I, size_t J, const TensorShape &A, const TensorShape &B, const TensorShape &C)
namespace TreeFactory

Functions

vector<Node> partition(const vector<Node> &nodes, size_t n_partition, size_t dim_node)
vector<Node> bottomlayerNodes(size_t num_leaves, size_t dim_leaves, size_t dim_nodes, size_t leaf_type)
Tree balancedTree(size_t num_leaves, size_t dim_leaves = 2, size_t dim_nodes = 2, size_t dim_inc = 0, size_t leaf_type = 0, double omega = 1., double r0 = 0., double wfr0 = 1., double wfomega = 0.)
Tree unbalancedTree(size_t nLeaves, size_t dimLeaves, size_t dimNodes, size_t leafType)
Tree operatorTree(const Tree &tree, size_t bottom = 0)
map<size_t, size_t> leaves_staggered_integers(size_t num_integer, size_t num_bits)
Node InitTrain(const Node &bottom, size_t dimNodes)
Node TrainLayer(const Node &old_train, const Node &bottom, size_t dimNodes)
vector<Node> bottomlayerNodes(size_t num_leaves, size_t dim_leaves, size_t dim_nodes, size_t leaf_type, double omega, double r0, double wfr0, double wfomega)
Tree expandNodes(Tree tree)
namespace TreeFunctions

Typedefs

typedef complex<double> cd
typedef double d

Functions

void applyOperatorSCF(TensorTreecd &Psi, MatrixTreecd &rho, const SOPVectorcd &sop, const Tree &tree)
double applyOperatorIteration(TensorTreecd &Psi, MatrixTreecd &rho, const SOPcd &sop, const Tree &tree)

apply a SOPcd operator onto a wavefunction (the sop operator is needed in its adjoint form as well)

void applyOperatorIteration(TensorTreecd &HPsi, const TensorTreecd &Psi, MatrixTreecd &rho, SparseMatrixTreescd &Hmats, SparseMatrixTreescd &HHoles, const SOPcd &sop, const SparseTree &stree, const Tree &tree)
Tensorcd applyOperatorLocal(const Tensorcd &Phi, const MatrixTreecd &rho, const SparseMatrixTreescd &mats, const SparseMatrixTreescd &holes, const SOPcd &sop, const Node &node)
double fidelity(const TensorTreecd &Psi, const TensorTreecd &Psilast, const SparseMatrixTreescd &umat, const MatrixTreecd &rho, const SOPcd &u, const SparseTree &stree, const Tree &tree)
void applyOperator(TensorTreecd &Psi, MatrixTreecd &rho, const SOPVectorcd &sop, const SOPVectorcd &sop_adj, const Tree &tree, Fidelity &f, mt19937 &gen)
void applyOperator(TensorTreecd &Psi, MatrixTreecd &rho, const SOPcd &sop, const SOPcd &sop_adj, const Tree &tree, const Diagonalizer &par, WorkMemorycd *mem)

Routine for applying a SOPcd operator onto a wavefunction.

apply a SOPcd operator onto a wavefunction (the sop operator is needed in its adjoint form as well)

TensorTreecd add(const vector<TensorTreecd> &Psis, const Tree &tree, double eps)

Contract multiple wavefunctions in a single wavefunction.

double fidelity(const TensorTreecd &Psi, const TensorTreecd &Psilast, const SOPcd &u, const Tree &tree)
Tensorcd occupyFromMatrix(const Matrixcd &ev, const TensorShape &tdim)

Occupy a Tensor from a matrix.

Tensorcd multAdd(const vector<Tensorcd> &A, const vector<Matrixcd> &rho)

Perform a state-index matrix-tensor operators for a set of Tensors/Matrices and accumulate.

Tensorcd applyLower(const Tensorcd &Phi, const SOPcd &sop, vector<SparseMatrixTreecd> &Hmats, const vector<SparseMatrixTreecd> &Holes, const Node &node, const Diagonalizer &par, WorkMemorycd *mem)

Solve equations for applying an operator for a lower node.

Tensorcd applyTop(const Tensorcd &Acoeff, const vector<SparseMatrixTreecd> &Hmats, const SOPcd &sop, const Node &node)

Solve equations for applying an operator for the top node.

vector<SparseMatrixTreecd> buildHHoles(const TensorTreecd &Psi, const SOPcd &sop, const SOPcd &sop_adj, const MatrixTreecd &rho, const Tree &tree, shared_ptr<SparseTree> &active, WorkMemorycd *mem)

Build hole-matrices used for applying scheme.

Matrixcd buildDeltaOperator(const vector<Tensorcd> &Phis, const SOPcd &sop, const vector<SparseMatrixTreecd> &Holes, const Node &node)

Build residual operator from a set of Tensors, hole-matrices and the SOPcd operator.

void applyOperator(TensorTreecd &Psi, Tree &tree, const SOPVectorcd &sop, const SOPVectorcd &sop_adj, double eps, size_t max_spf, size_t n_plus)
void applyOperator(TensorTreecd &Psi, Tree &tree, const SOPcd &sop, const SOPcd &sop_adj, double eps, size_t max_spf, size_t n_plus)
Tensorcd applyLowerDynamic(Tensorcd Phi, const SOPcd &sop, vector<SparseMatrixTreecd> &Hmats, const vector<SparseMatrixTreecd> &Holes, Node &node, Node &parent, Tensorcd &upPhi, double eps, size_t max_spf, size_t n_plus)
size_t nOccupied_local(const Vectord &ev, double rho)
void Represent(SparseMatrixTreecd &mat, const MatrixTensorTree &Psi, const MLOcd &M, const Tree &tree)
void Contraction(SparseMatrixTreecd &hole, const MatrixTensorTree &Psi, const SparseMatrixTreecd &mat, const SparseTree &marker, const Tree &tree)
void Represent(SparseMatrixTreePaircd &mats, const MatrixTensorTree &Psi, const MLOcd &M, const Tree &tree)
void Represent(SparseMatrixTreePairscd &matset, const MatrixTensorTree &Psi, const SOPcd &H, const Tree &tree)
Tensorcd symApplyDown(const Tensorcd &Phi, const SparseMatrixTreecd &hHole, const Node &node)
Tensorcd symApply(const Tensorcd &Phi, const SparseMatrixTreePaircd &mats, const MLOcd &M, const Node &node)
Tensorcd symApply(Tensorcd Phi, const SparseMatrixTreePairscd &hMatSet, const SOPcd &H, const Node &node)
void represent(SparseMatrixTreecd &mat, const MatrixTensorTree &Psi, const MLOcd &M, const Tree &tree)
void contraction(SparseMatrixTreecd &hole, const MatrixTensorTree &Psi, const SparseMatrixTreecd &mat, const SparseTree &marker, const Tree &tree)
void represent(SparseMatrixTreePaircd &mats, const MatrixTensorTree &Psi, const MLOcd &M, const Tree &tree)
void represent(SparseMatrixTreePairscd &matset, const MatrixTensorTree &Psi, const SOPcd &H, const Tree &tree)
template<typename T>
void dotProductLocal(MatrixTree<T> &S, const Tensor<T> &Phi, Tensor<T> AChi, const Node &node)

General DotProduct for Tensor Trees.

template<typename T>
void dotProduct(MatrixTree<T> &S, const TensorTree<T> &Psi, const TensorTree<T> &Chi, const Tree &tree)
template<typename T>
MatrixTree<T> dotProduct(const TensorTree<T> &Psi, const TensorTree<T> &Chi, const Tree &tree)
template<typename T>
double residual(const TensorTree<T> &Bra, const TensorTree<T> &Ket, const Tree &tree)
template<typename T>
void contractionLocal(MatrixTree<T> &Rho, const Tensor<T> &Bra, Tensor<T> Ket, const Node &node, const MatrixTree<T> *S_opt)

General Contraction for Tensor Trees.

template<typename T>
void contraction(MatrixTree<T> &Rho, const TensorTree<T> &Psi, const TensorTree<T> &Chi, const MatrixTree<T> &S, const Tree &tree)
template<typename T>
MatrixTree<T> contraction(const TensorTree<T> &Psi, const TensorTree<T> &Chi, const MatrixTree<T> &S, const Tree &tree)
template<typename T>
void contraction(MatrixTree<T> &Rho, const TensorTree<T> &Psi, const Tree &tree, bool orthogonal)
template<typename T>
MatrixTree<T> contraction(const TensorTree<T> &Psi, const Tree &tree, bool orthogonal)
template<typename T>
void contraction(MatrixTree<T> &Rho, const TensorTree<T> &Psi, const TensorTree<T> &Chi, const Tree &tree, const MatrixTree<T> *S_opt = nullptr)
template<typename T>
Matrix<T> representUpper(const SparseMatrixTree<T> &hmat, const Tensor<T> &Bra, const Tensor<T> &Ket, const Node &node, WorkMemory<T> *mem)

Build SparseMatrixTree Bottom-parent (Forward)

template<typename T>
void representLayer(SparseMatrixTree<T> &mats, const Tensor<T> &Bra, const Tensor<T> &Ket, const MLO<T> &M, const Node &node, WorkMemory<T> *mem)
template<typename T>
void represent(SparseMatrixTree<T> &hmat, const MLO<T> &M, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const Tree &tree, WorkMemory<T> *mem = nullptr)
template<typename T>
SparseMatrixTree<T> represent(const MLO<T> &M, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const Tree &tree)
template<typename T>
void represent(SparseMatrixTree<T> &hmat, const MLO<T> &M, const TensorTree<T> &Psi, const Tree &tree)
template<typename T>
SparseMatrixTree<T> represent(const MLO<T> &M, const TensorTree<T> &Psi, const Tree &tree)
template<typename T>
void represent(vector<SparseMatrixTree<T>> &Mats, const SOP<T> &sop, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const Tree &tree)

=== vector versions ===

template<typename T>
SparseMatrixTrees<T> represent(const SOP<T> &sop, const TensorTree<T> &Bra, const TensorTree<T> &Ket, shared_ptr<SparseTree> &stree, const Tree &tree, WorkMemory<T> *mem)
template<typename T>
void represent(SOPMatrixTrees<T> &mats, const SOP<T> &sop, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const Tree &tree)
template<typename T>
void contractionLayer(SparseMatrixTree<T> &holes, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const SparseMatrixTree<T> &mats, const MatrixTree<T> *rho, const SparseTree &stree, const Node &node, WorkMemory<T> *mem)

Build SparseMatrixTree Top-child (Backward) /////////////////////////////////////////////////////////////////////.

Low-level routine for calculating mean field matrices

template<typename T>
void contraction(SparseMatrixTree<T> &holes, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const SparseMatrixTree<T> &mats, const MatrixTree<T> *rho, const SparseTree &stree, const Tree &tree, WorkMemory<T> *mem = nullptr)
template<typename T>
SparseMatrixTree<T> contraction(const TensorTree<T> &Psi, const SparseMatrixTree<T> &mats, const Tree &tree)

Build SparseMatrixTree Top-down (Backward)

template<typename T>
void contraction(SparseMatrixTree<T> &holes, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const SparseMatrixTree<T> &mats, const Tree &tree)
template<typename T>
void contraction(SparseMatrixTree<T> &holes, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const SparseMatrixTree<T> &mats, const MatrixTree<T> &rho, const SparseTree &marker, const Tree &tree)
template<typename T>
void contraction(SparseMatrixTree<T> &holes, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const SparseMatrixTree<T> &mats, const MatrixTree<T> &rho, const Tree &tree)
template<typename T>
void contraction(SparseMatrixTree<T> &holes, const TensorTree<T> &Psi, const SparseMatrixTree<T> &mats, const Tree &tree)
template<typename T>
void contraction(SparseMatrixTrees<T> &holes, const SparseMatrixTrees<T> &mat, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const Tree &tree)
template<typename T>
void contraction(SparseMatrixTrees<T> &holes, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const SparseMatrixTrees<T> &mats, const MatrixTree<T> &rho, const Tree &tree)
template<typename T>
vector<SparseMatrixTree<T>> contraction(const TensorTree<T> &Bra, const TensorTree<T> &Ket, const vector<SparseMatrixTree<T>> &mats, const MatrixTree<T> &rho, shared_ptr<SparseTree> &stree, const Tree &tree)
template<typename T>
void contraction(MatrixTree<T> &Rho, const TensorTree<T> &Psi, const SparseTree &stree, bool orthogonal = true)
template<typename T>
Tensor<T> apply(const SparseMatrixTree<T> &mat, const Tensor<T> &Phi, const MLO<T> &M, const Node &node)

apply MatrixTree

apply factor matrices locally

template<typename T>
void apply(Tensor<T> &hPhi, const SparseMatrixTree<T> &mat, const SparseMatrixTree<T> *holes, const MatrixTree<T> *rho, Tensor<T> Phi, const SparseTree &stree, const Node &node, int skip, Tensor<T> *work = nullptr)

apply SparseMatrixTree to tensor tree

template<typename T>
Tensor<T> apply(const SparseMatrixTree<T> &mat, const SparseMatrixTree<T> &holes, const MatrixTree<T> *rho, Tensor<T> Phi, const SparseTree &stree, const Node &node, int skip)
template<typename T>
Tensor<T> applyUpper(const SparseMatrixTree<T> &mat, Tensor<T> Phi, const Node &node)
template<typename T>
Tensor<T> applyHole(const SparseMatrixTree<T> &holes, Tensor<T> Phi, const Node &hole_node)
template<typename T>
void apply(Tensor<T> &hPhi, const SparseMatrixTree<T> &mat, const Tensor<T> &Phi, const MLO<T> &M, const Node &node)
template<typename T>
Matrix<T> RepresentBottom(const Tensor<T> &Bra, const Tensor<T> &Ket, const MLO<T> &M, const Node &node, const Leaf &leaf, WorkMemory<T> *mem)
template<typename T>
void represent(SparseMatrixTrees<T> &Mats, const SOP<T> &sop, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const Tree &tree)
template<typename T>
void contraction(SparseMatrixTree<T> &holes, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const SparseMatrixTree<T> &mats, const SparseTree &marker, const Tree &tree)
template<typename T>
void contraction(vector<SparseMatrixTree<T>> &holes, const SparseMatrixTrees<T> &Mats, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const Tree &tree)
void contractionUp(MatrixTreecd &S, const SymTensorTree &Bra, const SymTensorTree &Ket, const Tree &tree)
void contractionDown(MatrixTreecd &Sdown, const SymTensorTree &Bra, const SymTensorTree &Ket, const MatrixTreecd &S, const Tree &tree)
vector<double> dotProduct(const SymTensorTree &Bra, SymTensorTree Ket, const Tree &tree)
void symContractionLocal(SparseMatrixTreecd &hole, const Tensorcd &Bra, const Tensorcd &Ket, const SparseMatrixTreecd &mat, const Node &hchild)

Tree Functions.

void symContraction(SparseMatrixTreecd &hole, const TensorTreecd &Bra, const TensorTreecd &Ket, const SparseMatrixTreecd &mat, const Tree &tree)
void symRepresent(SymMatrixTree &mat, const SymTensorTree &Bra, const SymTensorTree &Ket, const MLOcd &M, const Tree &tree)
void symRepresent(SymMatrixTrees &mats, const SymTensorTree &Bra, const SymTensorTree &Ket, const SOPcd &S, const Tree &tree)
void ApplySCF(SymTensorTree &HPsi, SymMatrixTrees &mats, const SymTensorTree &Psi, const SOPcd &H, const Tree &tree, double eps, size_t max_iter, ostream *os = nullptr)
Tensorcd symApply(const Tensorcd &Ket, const SymMatrixTree &mats, const MLOcd &M, const Node &node)
void symApply(SymTensorTree &HPsi, const SymTensorTree &Psi, const SymMatrixTrees &hmats, const SOPcd &H, const Tree &tree)
void symApply(Tensorcd &HPhi, const Tensorcd &Phi, const SymMatrixTrees &hmats, const SOPcd &H, const Node &node)
SymMatrixTree weightedContraction(const SymTensorTree &Bra, const SymTensorTree &Ket, const Tree &tree)
MatrixTreecd symDotProduct(const SymTensorTree &Bra, const SymTensorTree &Ket, const Tree &tree)
MatrixTreecd mixedDotProduct(const TensorTreecd &Psi, const SymTensorTree &spsi, const Tree &tree)

dot product between tensor tree and sym. tensor tree

MatrixTreecd mixedRho(const TensorTreecd &Psi, const SymTensorTree &spsi, const Tree &tree)

density matrices between tensor tree and sym. tensor tree

template<typename T>
void adjust(TensorTree<T> &Psi, Tree &tree, const SpectralDecompositionTree<T> &X, double eps)

Compress the TensorTree for a given accuracy.

template<typename T>
void adjust(TensorTree<T> &Psi, const Tree &newtree)
template<typename T>
void sum(TensorTree<T> &Psi, Tree &tree, const TensorTree<T> &Chi, bool sharedLeafs = true, bool sumToplayer = true)

Perform a (generalized) sum of tensor trees. By default, a regular sum will be performed.

template<typename T>
void product(TensorTree<T> &Psi, Tree &tree, const TensorTree<T> &Chi)

Perform a product of tensor trees.

size_t nOccupied(const Vectord &p, double eps)
template<typename T>
void AdjustNode(Tensor<T> &Phi, Tensor<T> &A, Node &node, Node &parent, const SpectralDecomposition<T> &x, double eps)
template<typename T>
TensorTree<T> densityWeighting(TensorTree<T> Psi, const Tree &tree)
template<typename T>
TensorTree<T> contractionNormalization(TensorTree<T> Psi, const Tree &tree, bool orthogonal = true)
template<typename T>
void transform(TensorTree<T> &Chi, const TensorTree<T> &Psi, const MatrixTree<T> &M, const MatrixTree<T> &M_inv, const Tree &tree)
template<typename T>
TensorTree<T> DotProductNormalization(TensorTree<T> Psi, const Tree &tree)
template<typename T>
TensorTree<T> DirectionalInvarientRepresentation(TensorTree<T> Psi, const Tree &tree, bool orthogonal)
template<typename T>
void TransformEdgeDown(TensorTree<T> &Chi, const TensorTree<T> &Psi, const Matrix<T> &M, const Edge &e)
template<typename T>
void TransformEdgeUp(TensorTree<T> &Chi, const TensorTree<T> &Psi, const Matrix<T> &Mi, const Edge &e)
template<typename T>
void TransformEdge(TensorTree<T> &Chi, const TensorTree<T> &Psi, const Matrix<T> &M, const Matrix<T> &M_inv, const Edge &e)
Tensorcd ApplyDelta(const Tensorcd &R, const vector<Tensorcd> &hPhi, const vector<SparseMatrixTreecd> &Holes, size_t npart, const Node &node)
void ContractionLocal(SparseMatrixTreecd &hole, const Tensorcd &Phi, const SparseMatrixTreecd &mat, const Node &hchild)
template void TreeFunctions::dotProductLocal(MatrixTree< cd > & S, const Tensor < cd > & Bra, Tensor < cd > Ket, const Node & node)
template void TreeFunctions::dotProduct(MatrixTree< cd > & S, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const Tree & tree)
template MatrixTree<cd> TreeFunctions::dotProduct(const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const Tree & tree)
template double TreeFunctions::residual(const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const Tree & tree)
template void TreeFunctions::contractionLocal(MatrixTree< cd > & Rho, const Tensor < cd > & Bra, Tensor < cd > Ket, const Node & node, const MatrixTree< cd > * S)
template void TreeFunctions::contraction(MatrixTree< cd > & Rho, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const Tree & tree, const MatrixTree< cd > * S)
template void TreeFunctions::contraction(MatrixTree< cd > & Rho, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const MatrixTree< cd > & S, const Tree & tree)
template void TreeFunctions::contraction(MatrixTree< cd > & Rho, const TensorTree < cd > & Psi, const Tree & tree, bool orthogonal)
template MatrixTree<cd> TreeFunctions::contraction(const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const MatrixTree< cd > & S, const Tree & tree)
template MatrixTree<cd> TreeFunctions::contraction(const TensorTree < cd > & Psi, const Tree & tree, bool orthogonal)
template void TreeFunctions::dotProductLocal< d >(MatrixTree< d > & S, const Tensor < d > & Bra, Tensor < d > Ket, const Node & node)
template void TreeFunctions::dotProduct< d >(MatrixTree< d > & S, const TensorTree < d > & Bra, const TensorTree < d > & Ket, const Tree & tree)
template MatrixTree<d> TreeFunctions::dotProduct(const TensorTree < d > & Bra, const TensorTree < d > & Ket, const Tree & tree)
template double TreeFunctions::residual(const TensorTree < d > & Bra, const TensorTree < d > & Ket, const Tree & tree)
template void TreeFunctions::contractionLocal(MatrixTree< d > & Rho, const Tensor < d > & Bra, Tensor < d > Ket, const Node & node, const MatrixTree< d > * S)
template void TreeFunctions::contraction(MatrixTree< d > & Rho, const TensorTree < d > & Bra, const TensorTree < d > & Ket, const Tree & tree, const MatrixTree< d > * S)
template void TreeFunctions::contraction(MatrixTree< d > & Rho, const TensorTree < d > & Bra, const TensorTree < d > & Ket, const MatrixTree< d > & S, const Tree & tree)
template void TreeFunctions::contraction(MatrixTree< d > & Rho, const TensorTree < d > & Psi, const Tree & tree, bool orthogonal)
template MatrixTree<d> TreeFunctions::contraction(const TensorTree < d > & Bra, const TensorTree < d > & Ket, const MatrixTree< d > & S, const Tree & tree)
template MatrixTree<d> TreeFunctions::contraction(const TensorTree < d > & Psi, const Tree & tree, bool orthogonal)
template void TreeFunctions::represent(SparseMatrixTree < cd > & hmat, const MLO < cd > & M, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const Tree & tree, WorkMemory < cd > * mem)
template void TreeFunctions::represent(SparseMatrixTree < cd > & hmat, const MLO < cd > & M, const TensorTree < cd > & Psi, const Tree & tree)
template SparseMatrixTree<cd> TreeFunctions::represent(const MLO < cd > & M, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const Tree & tree)
template SparseMatrixTree<cd> TreeFunctions::represent(const MLO < cd > & M, const TensorTree < cd > & Psi, const Tree & tree)
template void TreeFunctions::represent< cd >(SparseMatrixTrees< cd > & Mats, const SOP < cd > & sop, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const Tree & tree)
template void TreeFunctions::represent(SOPMatrixTrees < cd > & mats, const SOP < cd > & sop, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const Tree & tree)
template void TreeFunctions::representLayer(SparseMatrixTree < cd > & mats, const Tensor < cd > & Bra, const Tensor < cd > & Ket, const MLO < cd > & M, const Node & node, WorkMemory < cd > *)
template SparseMatrixTrees<cd> TreeFunctions::represent(const SOP < cd > & sop, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, shared_ptr< SparseTree > & stree, const Tree & tree, WorkMemorycd * mem)
template void TreeFunctions::contractionLayer(SparseMatrixTree < cd > & holes, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const SparseMatrixTree < cd > & mats, const MatrixTree< cd > * rho, const SparseTree & stree, const Node & node, WorkMemory < cd > * mem)
template void TreeFunctions::contractionLayer(SparseMatrixTree < d > & holes, const TensorTree < d > & Bra, const TensorTree < d > & Ket, const SparseMatrixTree < d > & mats, const MatrixTree< d > * rho, const SparseTree & stree, const Node & node, WorkMemory < d > * mem)
template void TreeFunctions::contraction(SparseMatrixTree < cd > & holes, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const SparseMatrixTree < cd > & mats, const MatrixTree< cd > * rho, const SparseTree & stree, const Tree & tree, WorkMemory < cd > * mem)
template void TreeFunctions::contraction(SparseMatrixTree < cd > & holes, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const SparseMatrixTree < cd > & mats, const Tree & tree)
template void TreeFunctions::contraction(SparseMatrixTree < cd > & holes, const TensorTree < cd > & Psi, const SparseMatrixTree < cd > & mats, const Tree & tree)
template void TreeFunctions::contraction(vector< SparseMatrixTree < cd >> & holes, const SparseMatrixTrees< cd > & Mats, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const Tree & tree)
template void TreeFunctions::contraction(SparseMatrixTree < cd > & holes, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const SparseMatrixTree < cd > & mats, const MatrixTree< cd > & rho, const Tree & tree)
template void TreeFunctions::contraction(SparseMatrixTrees< cd > & holes, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const SparseMatrixTrees< cd > & Mats, const MatrixTree< cd > & rho, const Tree & tree)
template SparseMatrixTree<cd> TreeFunctions::contraction(const TensorTree < cd > & Bra, const SparseMatrixTree < cd > & mats, const Tree & tree)
template vector<SparseMatrixTree<cd> > TreeFunctions::contraction(const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, const vector< SparseMatrixTree < cd >> & mats, const MatrixTree< cd > & rho, shared_ptr< SparseTree > & stree, const Tree & tree)
template void TreeFunctions::contraction< cd >(MatrixTree< cd > & Rho, const TensorTree < cd > & Psi, const SparseTree & stree, bool orthogonal)
template Tensor<cd> TreeFunctions::apply(const SparseMatrixTree < cd > & mat, const Tensor < cd > & Phi, const MLO < cd > & M, const Node & node)
template void TreeFunctions::apply(Tensor < cd > & hPhi, const SparseMatrixTree < cd > & mat, const SparseMatrixTree < cd > * holes, const MatrixTree< cd > * rho, Tensor < cd > Phi, const SparseTree & stree, const Node & node, int skip, Tensor < cd > * mem)
template Tensor<cd> TreeFunctions::apply(const SparseMatrixTree < cd > & mat, const SparseMatrixTree < cd > & holes, const MatrixTree< cd > * rho, Tensor < cd > Phi, const SparseTree & stree, const Node & node, int skip)
template Tensor<cd> TreeFunctions::applyUpper(const SparseMatrixTree < cd > & mat, Tensor < cd > Phi, const Node & node)
template Tensor<cd> TreeFunctions::applyHole(const SparseMatrixTree < cd > & holes, Tensor < cd > Phi, const Node & hole_node)
template void TreeFunctions::represent(SparseMatrixTree < d > & hmat, const MLO < d > & M, const TensorTree < d > & Bra, const TensorTree < d > & Ket, const Tree & tree, WorkMemory < d > * mem)
template void TreeFunctions::represent(SparseMatrixTree < d > & hmat, const MLO < d > & M, const TensorTree < d > & Psi, const Tree & tree)
template SparseMatrixTree<d> TreeFunctions::represent(const MLO < d > & M, const TensorTree < d > & Bra, const TensorTree < d > & Ket, const Tree & tree)
template SparseMatrixTree<d> TreeFunctions::represent(const MLO < d > & M, const TensorTree < d > & Psi, const Tree & tree)
template void TreeFunctions::represent< d >(SparseMatrixTrees< d > & Mats, const SOP < d > & sop, const TensorTree < d > & Bra, const TensorTree < d > & Ket, const Tree & tree)
template void TreeFunctions::represent(SOPMatrixTrees < d > & mats, const SOP < d > & sop, const TensorTree < d > & Bra, const TensorTree < d > & Ket, const Tree & tree)
template void TreeFunctions::representLayer(SparseMatrixTree < d > & mats, const Tensor < d > & Bra, const Tensor < d > & Ket, const MLO < d > & M, const Node & node, WorkMemory < d > *)
template SparseMatrixTrees<d> TreeFunctions::represent(const SOP < d > & sop, const TensorTree < d > & Bra, const TensorTree < d > & Ket, shared_ptr< SparseTree > & stree, const Tree & tree, WorkMemory < d > * mem)
template void TreeFunctions::contraction(SparseMatrixTree < d > & holes, const TensorTree < d > & Bra, const TensorTree < d > & Ket, const SparseMatrixTree < d > & mats, const MatrixTree< d > * rho, const SparseTree & stree, const Tree & tree, WorkMemory < d > * mem)
template void TreeFunctions::contraction(SparseMatrixTree < d > & holes, const TensorTree < d > & Bra, const TensorTree < d > & Ket, const SparseMatrixTree < d > & mats, const Tree & tree)
template void TreeFunctions::contraction(SparseMatrixTree < d > & holes, const TensorTree < d > & Bra, const SparseMatrixTree < d > & mats, const Tree & tree)
template SparseMatrixTree<d> TreeFunctions::contraction(const TensorTree < d > & Bra, const SparseMatrixTree < d > & mats, const Tree & tree)
template void TreeFunctions::contraction(vector< SparseMatrixTree < d >> & holes, const SparseMatrixTrees< d > & Mats, const TensorTree < d > & Bra, const TensorTree < d > & Ket, const Tree & tree)
template vector<SparseMatrixTree<d> > TreeFunctions::contraction(const TensorTree < d > & Bra, const TensorTree < d > & Ket, const vector< SparseMatrixTree < d >> & mats, const MatrixTree< d > & rho, shared_ptr< SparseTree > & stree, const Tree & tree)
template void TreeFunctions::contraction< d >(MatrixTree< d > & Rho, const TensorTree < d > & Psi, const SparseTree & stree, bool orthogonal)
template Tensor<d> TreeFunctions::apply(const SparseMatrixTree < d > & mat, const Tensor < d > & Phi, const MLO < d > & M, const Node & node)
template void TreeFunctions::apply(Tensor < d > & hPhi, const SparseMatrixTree < d > & mat, const SparseMatrixTree < d > * holes, const MatrixTree< d > * rho, Tensor < d > Phi, const SparseTree & stree, const Node & node, int skip, Tensor < d > * work)
template Tensor<d> TreeFunctions::apply(const SparseMatrixTree < d > & mat, const SparseMatrixTree < d > & holes, const MatrixTree< d > * rho, Tensor < d > Phi, const SparseTree & stree, const Node & node, int skip)
template Tensor<d> TreeFunctions::applyUpper(const SparseMatrixTree < d > & mat, Tensor < d > Phi, const Node & node)
template Tensor<d> TreeFunctions::applyHole(const SparseMatrixTree < d > & holes, Tensor < d > Phi, const Node & hole_node)
void contractionUpLocal(MatrixTreecd &S, const Tensorcd &Bra, Tensorcd Ket, const Node &node)

Tree Contractions.

void contractionDownLocal(MatrixTreecd &Sdown, const Tensorcd &Bra, Tensorcd Ket, const MatrixTreecd &S, const Node &child)
Tensorcd symApply(Tensorcd Ket, const MatrixTreecd &Sup, const MatrixTreecd &Sdown, const Node &node)
double error(const vector<double> &vec)
void iterate(SymTensorTree &HPsi, SymMatrixTrees &mats, const SymTensorTree &Psi, const SOPcd &H, const Tree &tree)

apply Operators

Idea:

  • always perform normalize up right before building up-/down-matrices

  • only perform once per operator to avoid multiple evaluations

  • weighted Tensors store the important information

  • allows to perform different ‘normalization’ for CDVR

    • this can incorporate finding optimized x-basis sets

Parameters
  • HPsi:

  • Psi:

  • hmats:

  • H:

  • node:

Tensorcd symApplyDownNew(const Tensorcd &Phi, const SparseMatrixTreecd &hHole, const Node &node)

apply Operators

template void TreeFunctions::transform(TensorTree < cd > & Chi, const TensorTree < cd > & Psi, const MatrixTree< cd > & M, const MatrixTree< cd > & M_inv, const Tree & tree)
template void TreeFunctions::transform(TensorTree < d > & Chi, const TensorTree < d > & Psi, const MatrixTree< d > & M, const MatrixTree< d > & M_inv, const Tree & tree)
template TensorTree<cd> TreeFunctions::contractionNormalization(TensorTree < cd > Psi, const Tree & tree, bool orthogonal)
template TensorTree<d> TreeFunctions::contractionNormalization(TensorTree < d > Psi, const Tree & tree, bool orthogonal)
template TensorTree<cd> TreeFunctions::DotProductNormalization(TensorTree < cd > Psi, const Tree & tree)
template TensorTree<d> TreeFunctions::DotProductNormalization(TensorTree < d > Psi, const Tree & tree)
namespace TreeIO

Functions

void status(size_t it, size_t max, size_t freq, size_t length)
void statusTime(size_t it, size_t max, size_t freq, size_t length, chrono::high_resolution_clock::time_point &t1, chrono::high_resolution_clock::time_point &t2, chrono::microseconds &time)
void output(const TensorTreecd &Psi, const Tree &tree, ostream &os = cout)
template<typename T>
void output2(const TensorTree<T> &Psi, const Tree &tree, ostream &os = cout)
template<typename T>
void occupancy(const TensorTree<T> &Psi, const Tree &tree, ostream &os = cout)
template<typename T>
void leafs(const TensorTree<T> &Psi, const MatrixTree<T> &Rho, const Tree &tree, ostream &os = cout)
template<typename T>
Matrix<T> leafDensity(const TensorTree<T> &Psi, const MatrixTree<T> &Rho, const Leaf &leaf, const Tree &tree)
template<typename T>
Matrix<T> leafDensity(const TensorTree<T> &Psi, const SparseMatrixTree<T> &Rho, const Leaf &leaf, const Tree &tree)
template<typename T>
void entropyMap(const TensorTree<T> &Psi, const Tree &tree)
template<class A>
void print(const vector<A> &vec)
void expectationValues(const TensorTreecd &Psi, const MatrixTreecd &rho, const Tree &tree, ostream &os)
namespace WeightedSimultaneousDiagonalization

Perform matrix-weighted Joint Diagonalization.

Functions

void calculate(vector<Matrixcd> &Xs, vector<Matrixcd> XXs, Matrixcd &W, Matrixcd &trafo, double eps)
double measureWeightedDiagonality(const vector<Matrixcd> &A, const Matrixcd &W)
void weightedJacobiRotations(vector<Matrixcd> &Xs, vector<Matrixcd> &XXs, Matrixcd &W, Matrixcd &trafo)
int calculateWeightedAngles(complex<double> &c, complex<double> &s, size_t i, size_t j, const vector<Matrixcd> &Xs, const vector<Matrixcd> &XXs, const Matrixcd &W)
double weightedJacobiLoc(const vector<Matrixcd> &Xs, const vector<Matrixcd> &XXs, const Matrixcd &W, size_t p, size_t q, complex<double> c, complex<double> s)
void weightedJacobiDerivatives(Vectord &grad, Matrixd &preHessian, complex<double> s_in, const vector<Matrixcd> &Xs, const vector<Matrixcd> &XXs, const Matrixcd &W, size_t p, size_t q, double delta)
double measureWeightedOffDiagonality(const vector<Matrixcd> &Xws, const vector<Matrixcd> &Xs, const Matrixcd &W, const Matrixcd &trafo)
vector<Vectord> GetDiagonals(const vector<Matrixcd> &Xws, const Matrixcd &W)
pair<Matrixcd, vector<Vectord>> calculate(vector<Matrixcd> &Xs, Matrixcd &W, double eps)
file ApplyFirstOrder.h
#include “TreeClasses/MatrixTreeFunctions.h”#include “TreeClasses/SparseMatrixTreeFunctions.h”#include “TreeOperators/SumOfProductsOperator.h”#include “TreeOperators/SOPVector.h”

Typedefs

typedef TensorTreecd Wavefunction
file CMFIntegrator.h
#include “TreeClasses/HamiltonianRepresentation.h”#include “TreeClasses/LayerInterface.h”#include “TreeClasses/IntegratorVariables.h”#include “Util/BS_integrator.h”

Typedefs

typedef BS_integrator<LayerInterface&, Tensorcd, complex<double>> bs_integrator
file Eigenstates.h
#include “TreeClasses/HamiltonianRepresentation.h”#include “TreeClasses/IntegratorInterface.h”#include “TreeClasses/TreeIO.h”#include “Applications/CMFIntegrator.h”

Functions

Vectord propagatorEnergies(const Wavefunction &Psi, const Tree &tree, double out)
Vectord Eigenstate(Wavefunction &Psi, const Hamiltonian &H, const Tree &tree)
void Status(const Vectord &eigenvalues, const Vectord &propergatorev, const Matrixcd &S, ostream &os)
void Eigenstates(IntegratorVariables &ivar)
file SCF.h
#include “TreeShape/Tree.h”#include “TreeOperators/Hamiltonian.h”

Functions

vector<const Node *> scf_sweep(const Tree &tree)
void scf(SCF_parameters &par)
file TreeApplyOperator.h
#include “TreeClasses/MatrixTreeFunctions.h”#include “TreeClasses/SparseMatrixTreeFunctions.h”#include “TreeOperators/SumOfProductsOperator.h”#include “TreeOperators/SOPVector.h”

Typedefs

typedef TensorTreecd Wavefunction
file TreeApplyOperatorDynamic.h
#include “TreeClasses/MatrixTreeFunctions.h”#include “TreeClasses/SparseMatrixTreeFunctions.h”#include “TreeOperators/SumOfProductsOperator.h”#include “TreeOperators/SOPVector.h”#include “Applications/TreeApplyOperator.h”
file Matrix.h
#include “stdafx.h”#include <Eigen/Dense>#include “Vector.h”

Typedefs

typedef Matrix<complex<double>> Matrixcd

General typedef for complex matrices.

typedef Matrix<double> Matrixd

General typedef for real matrices.

using SpectralDecomposition = pair<Matrix<T>, Vectord>

General typedef for Matrix<T>, Vectord pairs.

typedef SpectralDecomposition<complex<double>> SpectralDecompositioncd

Specialization of SpectralDecomposition of Matrixcd.

typedef SpectralDecomposition<double> SpectralDecompositiond

Specialization of SpectralDecomposition of Matrixd.

typedef tuple<Matrixcd, Matrixcd, Vectord> SVDcd
typedef tuple<Matrixd, Matrixd, Vectord> SVDd

Functions

template<typename T, typename U>
Vector<T> multAB(const Matrix<U> &A, const Vector<T> &B)
template<typename T, typename U>
Vector<T> multATB(const Matrix<U> &A, const Vector<T> &B)
template<typename T>
Matrix<T> multAB(const Matrix<T> &A, const Matrix<T> &B)
template<typename T>
Matrix<T> multATB(const Matrix<double> &A, const Matrix<T> &B)
template<typename T>
Matrix<T> merge(const Matrix<T> &A, const Matrix<T> &B, const Matrix<T> &AB)
template<typename T>
Matrix<complex<double>> multATB(const Matrix<complex<double>> &A, const Matrix<T> &B)
template<typename T>
Matrix<T> addAB(const Matrix<T> &A, const Matrix<T> &B)
template<typename T>
Matrix<T> substAB(const Matrix<T> &A, const Matrix<T> &B)
template<typename T, typename U>
Matrix<T> multscalar(const U sca, const Matrix<T> &B)
template<typename T>
Matrix<T> re(const Matrix<T> &A)
template<typename T>
Vector<T> operator*(const Matrix<T> &A, const Vector<T> &v)

operator overloadings

SpectralDecompositioncd diagonalize(const Matrix<complex<double>> &A)

Diagonalization framework.

Diagonalize a complex double matrix

Return

Decomposed matrix

Parameters
  • A: Matrix to be diagonalized

void diagonalize(SpectralDecompositioncd &S, const Matrix<complex<double>> &A)

Diagonalize a complex double martrix.

Parameters
  • S: Decomposed matrix (call-by-reference)

  • A: Matrix to be diagonalized

SpectralDecompositiond diagonalize(const Matrix<double> &A)

Diagonalize a double matrix.

Return

Decomposed matrix

Parameters
  • A: Matrix to be diagonalized

void diagonalize(SpectralDecompositiond &S, const Matrix<double> &A)

Diagonalize a double martrix.

Parameters
  • S: Decomposed matrix (call-by-reference)

  • A: Matrix to be diagonalized

template<typename T>
pair<Matrix<T>, Vectord> diagonalize(const Matrix<T> &A)

Diagonalization routine for remaining types (Eigenvector always double; not generally applicable)

Return

Template Parameters
  • T:

Parameters
  • A:

template<typename T>
Matrix<T> toMatrix(const SpectralDecomposition<T> &X)

Construct matrix from its decomposition.

Return

re-constructed matrix

Parameters
  • X: Decomposed matrix

template<typename T>
SpectralDecomposition<T> inverse(SpectralDecomposition<T> X, double eps = 1e-7)
template<typename T>
SpectralDecomposition<T> sqrt(SpectralDecomposition<T> X)

Calculate squareroot of matrix (decomposed)

Return

squareroot of matrix (decomposed)

Parameters
  • X: Decomposed matrix

template<typename T>template Matrix< doub > identityMatrix(size_t dim)

Create an identity matrix.

Return

identity-matrix

Template Parameters
  • T: Type of identity matrix

Parameters
  • dim: dimension

Matrixcd identityMatrixcd(size_t dim)
Matrixd identityMatrixd(size_t dim)
template<typename T>
Matrix<T> unitarySimilarityTrafo(const Matrix<T> &A, const Matrix<T> &B)
template<typename T>
Matrix<T> euclideanDistance(const Matrix<T> &A)
template<typename T>
double residual(const Matrix<T> &A, const Matrix<T> &B)
template<typename T>
Matrix<T> regularize(const Matrix<T> &A, double eps)
template<typename T>
ostream &operator<<(ostream &os, const Matrix<T> &A)
template<typename T>
istream &operator>>(istream &is, Matrix<T> &A)
Matrixcd qr(const Matrixcd &A)

: Return Q & R matrix and adjust name convention

Matrixd qr(const Matrixd &A)
SVDcd svd(const Matrixcd &A)
SVDd svd(const Matrixd &A)
Matrixcd toMatrix(const SVDcd &svd)
Matrixd toMatrix(const SVDd &svd)
Eigen::MatrixXd toEigen(Matrixd A)
Eigen::MatrixXcd toEigen(Matrixcd A)
Matrixd toQutree(const Eigen::MatrixXd &A)
Matrixcd toQutree(const Eigen::MatrixXcd &A)
template<typename T>
Matrix<T> subMatrix(const Matrix<T> A, size_t dim1, size_t dim2)
file Matrix_Extension.h
#include “Matrix.h”

Functions

template<typename T>
SpectralDecomposition<T> reduceRank(const SpectralDecomposition<T> &x, size_t rank)
template<typename T>
Matrix<T> merge(const Matrix<T> &A, const Matrix<T> &B, const Matrix<T> &AB)
file Matrix_Extension_Implementation.h
#include “Matrix_Extension.h”

Functions

template<typename T>
SpectralDecomposition<T> reduceRank(const SpectralDecomposition<T> &x, size_t rank)
template<typename T>
Matrix<T> merge(const Matrix<T> &A, const Matrix<T> &B, const Matrix<T> &AB)
file Matrix_Implementation.h
#include “Matrix.h”

Functions

template<typename T, typename U>
Vector<T> multAB(const Matrix<U> &A, const Vector<T> &B)
template<typename T, typename U>
Vector<T> multATB(const Matrix<U> &A, const Vector<T> &B)
void tmatvec_(double *C, double *B, double *mat, int *a, int *b, int *c, int *add)
void trmatvec_(double *C, double *B, double *mat, int *a, int *b, int *c, int *add)
template<typename T>
Matrix<T> multAB(const Matrix<T> &A, const Matrix<T> &B)
template<typename T>
Matrix<T> multATB(const Matrix<double> &A, const Matrix<T> &B)
template<typename T>
Matrix<complex<double>> multATB(const Matrix<complex<double>> &A, const Matrix<T> &B)
template<typename T>
Matrix<T> addAB(const Matrix<T> &A, const Matrix<T> &B)
template<typename T, typename U>
Matrix<T> multscalar(const U sca, const Matrix<T> &B)
template<typename T>
Matrix<T> substAB(const Matrix<T> &A, const Matrix<T> &B)
template<typename T>
Matrix<T> re(const Matrix<T> &A)
template<typename T, typename U>
Vector<U> operator*(const Matrix<T> &A, const Vector<U> &v)

operator overloadings

template<typename T>
void diagonalize(Matrix<T> &trafo, Vector<double> &ev, const Matrix<T> &B)

Diagonalization framework.

SpectralDecompositioncd diagonalize(const Matrix<complex<double>> &A)

Diagonalization framework.

Diagonalize a complex double matrix

Return

Decomposed matrix

Parameters
  • A: Matrix to be diagonalized

void diagonalize(SpectralDecompositioncd &S, const Matrix<complex<double>> &A)

Diagonalize a complex double martrix.

Parameters
  • S: Decomposed matrix (call-by-reference)

  • A: Matrix to be diagonalized

SpectralDecompositiond diagonalize(const Matrix<double> &A)

Diagonalize a double matrix.

Return

Decomposed matrix

Parameters
  • A: Matrix to be diagonalized

void diagonalize(SpectralDecompositiond &S, const Matrix<double> &A)

Diagonalize a double martrix.

Parameters
  • S: Decomposed matrix (call-by-reference)

  • A: Matrix to be diagonalized

template<typename T>
Matrix<T> toMatrix(const SpectralDecomposition<T> &X)

Construct matrix from its decomposition.

Return

re-constructed matrix

Parameters
  • X: Decomposed matrix

template<typename T>
SpectralDecomposition<T> sqrt(SpectralDecomposition<T> X)

Calculate squareroot of matrix (decomposed)

Return

squareroot of matrix (decomposed)

Parameters
  • X: Decomposed matrix

template<typename T>
SpectralDecomposition<T> inverse(SpectralDecomposition<T> X, double eps)
template<typename T>
Matrix<T> identityMatrix(size_t dim)

Create an identity matrix.

Convenience & Management.

Return

identity-matrix

Template Parameters
  • T: Type of identity matrix

Parameters
  • dim: dimension

Matrixcd identityMatrixcd(size_t dim)
Matrixd identityMatrixd(size_t dim)
template<typename T>
Matrix<T> unitarySimilarityTrafo(const Matrix<T> &A, const Matrix<T> &B)
template<typename T>
Matrix<T> regularize(const Matrix<T> &A, double eps)
template<typename T>
Matrix<T> euclideanDistance(const Matrix<T> &A)
template<typename T>
double residual(const Matrix<T> &A, const Matrix<T> &B)
template<typename T>
ostream &operator<<(ostream &os, const Matrix<T> &A)
template<typename T>
istream &operator>>(istream &is, Matrix<T> &A)
Eigen::MatrixXd toEigen(Matrixd A)
Eigen::MatrixXcd toEigen(Matrixcd A)
Matrixd toQutree(const Eigen::MatrixXd &A)
Matrixcd toQutree(const Eigen::MatrixXcd &A)
Matrixcd qr(const Matrixcd &A)

: Return Q & R matrix and adjust name convention

Matrixd qr(const Matrixd &A)
SVDcd svd(const Matrixcd &A)
SVDd svd(const Matrixd &A)
Matrixcd toMatrix(const SVDcd &svd)
Matrixd toMatrix(const SVDd &svd)
template<typename T>
Matrix<T> subMatrix(const Matrix<T> A, size_t dim1, size_t dim2)
file MatrixBLAS.h
#include “Matrix.h”

Functions

void qrBLAS(Matrixcd &Q, const Matrixcd &A)
file stdafx.h
#include <stdio.h>#include <vector>#include <list>#include <assert.h>#include <iostream>#include <fstream>#include <complex>#include <memory>

Functions

double conj(double x)
int conj(const int d)
file Tensor.h
#include “TensorShape.h”#include “Core/Matrix.h”

Typedefs

using value_type = T
typedef Tensor<double> Tensord
typedef Tensor<complex<double>> Tensorcd

Functions

template<typename T>
T singleDotProd(const Tensor<T> &A, const Tensor<T> &B, size_t n, size_t m)

Non-member functions.

template<typename T>
Tensor<T> productElementwise(const Tensor<T> &A, const Tensor<T> &B)
template<typename T, typename U>
void contraction1(Matrix<U> &h, const Tensor<T> &bra, const Tensor<T> &ket, size_t A, size_t B, size_t B2, size_t C, bool zero)
template<typename T>
void contraction(Matrix<T> &S, const Tensor<T> &A, const Tensor<T> &B, size_t before, size_t active1, size_t active2, size_t behind)
template<typename T>
void contraction(Matrix<T> &S, const Tensor<T> &A, const Tensor<T> &B, size_t k, bool zero = true)
template<typename T>
Matrix<T> contraction(const Tensor<T> &A, const Tensor<T> &B, size_t k)
template<typename T, typename U>
void matrixTensor(Tensor<T> &C, const Matrix<U> &A, const Tensor<T> &B, size_t before, size_t activeC, size_t activeB, size_t after, bool zero = true)
template<typename T, typename U>
void tMatrixTensor(Tensor<T> &C, const Matrix<U> &A, const Tensor<T> &B, size_t before, size_t activeC, size_t activeB, size_t after, bool zero = true)
template<typename T, typename U>
void matrixTensor(Tensor<T> &C, const Matrix<U> &A, const Tensor<T> &B, size_t mode, bool zero = true)
template<typename T, typename U>
Tensor<T> matrixTensor(const Matrix<U> &A, const Tensor<T> &B, size_t mode)
template<typename T, typename U>
void tensorMatrix(Tensor<T> &C, const Tensor<T> &B, const Matrix<U> &A, size_t mode, bool zero = true)
template<typename T, typename U>
Tensor<T> tensorMatrix(const Tensor<T> &B, const Matrix<U> &A, size_t mode)
template<typename T, typename U>
Tensor<T> tMatrixTensor(const Matrix<U> &A, const Tensor<T> &B, size_t mode)
template<typename T, typename U>
void multStateAB(Tensor<T> &C, const Matrix<U> &A, const Tensor<T> &B, bool zero = true)
template<typename T, typename U>
Tensor<T> multStateAB(const Matrix<U> &A, const Tensor<T> &B)
template<typename T, typename U>
void multStateArTB(Tensor<T> &C, const Matrix<U> &A, const Tensor<T> &B)
template<typename T, typename U>
Tensor<T> multStateArTB(const Matrix<U> &A, const Tensor<T> &B)
template<typename T, typename U>
void multAdd(Tensor<T> &A, const Tensor<T> &B, U coeff)
template<typename T>
void gramSchmidt(Tensor<T> &A)
template<typename T>
Tensor<T> qr(const Tensor<T> &A)
template<typename T>
Tensor<T> qr(const Tensor<T> &A, size_t mode)
template<typename T>
Tensor<T> project(const Tensor<T> &A, const Tensor<T> &B)
template<typename T>
Tensor<T> projectOut(const Tensor<T> &A, const Tensor<T> &B)

Project B out of A, i.e. Anew = (1-P_B)*A.

This routine takes a Tensor A and makes it orthogonal to B. It can be written as A_new = (1 - P_B) A, where P_B is the projector onto B.

template<typename T>
Tensor<complex<double>> projectOrthogonal(const Tensor<complex<double>> &A, const Tensor<T> &B)
template<typename T>
Tensor<T> conj(Tensor<T> A)
template<typename T>
double residual(Tensor<T> A, const Tensor<T> &B)
template<typename T>
Matrix<T> toMatrix(const Tensor<T> &A)
template<typename T>
Matrix<T> toMatrix(const Tensor<T> &A, size_t mode)
template<typename T>
Matrix<T> moveToMatrix(Tensor<T> &A)
template<typename T>
Tensor<T> toTensor(const Matrix<T> &B, const TensorShape &shape, size_t mode)
template<typename T>
Tensor<T> toTensor(const Matrix<T> &B)
template<typename T>
Tensor<T> moveToTensor(Matrix<T> &B)
template<typename T>
ostream &operator<<(ostream &os, const Tensor<T> &A)
template<typename T>
istream &operator>>(istream &is, Tensor<T> &A)
template<typename T>
bool operator==(const Tensor<T> &A, const Tensor<T> &B)
template<typename T>
Tensor<T> elementwise(const Tensor<T> &A, const function<T(T)> &f)
template<typename T>
void elementwise(Tensor<T> &res, const Tensor<T> &A, const function<T(T)> &f)
template<typename T>
Tensor<T> ones(const TensorShape &shape)

Variables

TensorShape shape_
T *coeffs_
bool ownership_
file Tensor_Extension.h
#include “Tensor.h”#include <random>
file Tensor_Extension_Implementation.h
#include “Tensor_Extension.h”
file Tensor_Implementation.h
#include “Tensor.h”#include “TensorShape.h”#include “stdafx.h”#include “Util/qutree_rng.h”

Functions

template<typename T>
Tensor<T> productElementwise(const Tensor<T> &A, const Tensor<T> &B)
template<typename T>
T singleDotProd(const Tensor<T> &A, const Tensor<T> &B, size_t n, size_t m)

Non-member functions.

void matvec_(double *C, double *B, double *mat, int *a, int *b, int *c, int *add)
void ctmatvec_(double *C, double *B, double *mat, int *a, int *b, int *c, int *add)
void rmatvec_(double *C, double *B, double *mat, int *a, int *b, int *c, int *add)
void rhomat_(double *Bra, double *Ket, double *M, int *a, int *b, int *c)
template<typename T, typename U>
void contraction1(Matrix<U> &h, const Tensor<T> &bra, const Tensor<T> &ket, size_t A, size_t B, size_t B2, size_t C, bool zero)
template<typename T>
void contraction(Matrix<T> &S, const Tensor<T> &A, const Tensor<T> &B, size_t before, size_t active1, size_t active2, size_t behind)
template<typename T>
Matrix<T> contraction(const Tensor<T> &A, const Tensor<T> &B, size_t k)
template<typename T>
void contraction(Matrix<T> &S, const Tensor<T> &A, const Tensor<T> &B, size_t k, bool zero)
template<typename T, typename U>
void matrixTensor1(Tensor<T> &C, const Matrix<U> &h, const Tensor<T> &B, size_t before, size_t active, size_t activeC, size_t after, bool zero)
template<typename T, typename U>
void matrixTensor(Tensor<T> &C, const Matrix<U> &A, const Tensor<T> &B, size_t before, size_t activeC, size_t activeB, size_t after, bool zero)
template<typename T, typename U>
void tMatrixTensor(Tensor<T> &C, const Matrix<U> &A, const Tensor<T> &B, size_t before, size_t activeC, size_t activeB, size_t after, bool zero)
template<typename T, typename U>
void matrixTensor(Tensor<T> &C, const Matrix<U> &A, const Tensor<T> &B, size_t mode, bool zero)
template<typename T, typename U>
Tensor<T> matrixTensor(const Matrix<U> &A, const Tensor<T> &B, size_t mode)
template<typename T, typename U>
void tensorMatrix(Tensor<T> &C, const Tensor<T> &B, const Matrix<U> &A, size_t mode, bool zero)
template<typename T, typename U>
Tensor<T> tensorMatrix(const Tensor<T> &B, const Matrix<U> &A, size_t mode)
template<typename T, typename U>
Tensor<T> tMatrixTensor(const Matrix<U> &A, const Tensor<T> &B, size_t mode)
template<typename T, typename U>
void multStateAB(Tensor<T> &C, const Matrix<U> &A, const Tensor<T> &B, bool zero)
template<typename T, typename U>
Tensor<T> multStateAB(const Matrix<U> &A, const Tensor<T> &B)
template<typename T, typename U>
void multStateArTB(Tensor<T> &C, const Matrix<U> &A, const Tensor<T> &B)
template<typename T, typename U>
Tensor<T> multStateArTB(const Matrix<U> &A, const Tensor<T> &B)
template<typename T, typename U>
void multAdd(Tensor<T> &A, const Tensor<T> &B, U coeff)
template<typename T>
void gramSchmidt(Tensor<T> &A)
template<typename T>
Tensor<T> qr(const Tensor<T> &A)
template<typename T>
Tensor<T> qr(const Tensor<T> &A, size_t mode)
template<typename T>
Tensor<T> project(const Tensor<T> &A, const Tensor<T> &B)
template<typename T>
Tensor<T> projectOut(const Tensor<T> &A, const Tensor<T> &B)

Project B out of A, i.e. Anew = (1-P_B)*A.

This routine takes a Tensor A and makes it orthogonal to B. It can be written as A_new = (1 - P_B) A, where P_B is the projector onto B.

template<typename T>
Tensor<complex<double>> projectOrthogonal(const Tensor<complex<double>> &A, const Tensor<T> &B)
template<typename T>
Tensor<T> conj(Tensor<T> A)
template<typename T>
double residual(Tensor<T> A, const Tensor<T> &B)
template<typename T>
Matrix<T> toMatrix(const Tensor<T> &A)
template<typename T>
Matrix<T> moveToMatrix(Tensor<T> &A)
template<typename T>
Matrix<T> toMatrix(const Tensor<T> &A, size_t mode)
template<typename T>
Tensor<T> toTensor(const Matrix<T> &B, const TensorShape &shape, size_t mode)
template<typename T>
Tensor<T> toTensor(const Matrix<T> &B)
template<typename T>
Tensor<T> moveToTensor(Matrix<T> &B)
template<typename T>
ostream &operator<<(ostream &os, const Tensor<T> &A)
template<typename T>
istream &operator>>(istream &is, Tensor<T> &A)
template<typename T>
bool operator==(const Tensor<T> &A, const Tensor<T> &B)
template<typename T>
void elementwise(Tensor<T> &res, const Tensor<T> &A, const function<T(T)> &f)
template<typename T>
Tensor<T> elementwise(const Tensor<T> &A, const function<T(T)> &f)
template<typename T>
Tensor<T> ones(const TensorShape &shape)
template<typename T>
Tensor<T> rand(const TensorShape &shape)
file TensorBLAS.h
#include “Tensor.h”

Functions

void dgeem(Matrixd &h, const Matrixd &bra, const Matrixd &ket)
template<typename T>
void transpose(T *dest, const T *src, size_t dim1, size_t dim2, T beta = 0.)
template<typename T, int blocksize>
void transpose2(T *dest, const T *src, size_t lda, size_t ldb)
template<typename T>
void transposeAB(T *dest, const T *src, size_t A, size_t B, size_t C)
template<typename T, typename U>
void matrixTensor1(Tensor<T> &C, const Matrix<U> &h, const Tensor<T> &B, size_t before, size_t active, size_t activeC, size_t after, bool zero)
template<typename T, typename U>
void matrixTensor2(Tensor<T> &C, const Matrix<U> &h, const Tensor<T> &B, Tensor<T> &D, size_t before, size_t active, size_t activeC, size_t after, bool zero)
template<typename T, typename U>
void matrixTensor3(Tensor<T> &C, const Matrix<U> &h, const Tensor<T> &B, Tensor<T> &Ket_work, Tensor<T> &hKet_work, size_t before, size_t active, size_t activeC, size_t after, bool zero)
template<typename T, typename U>
void contraction1(Matrix<U> &h, const Tensor<T> &bra, const Tensor<T> &ket, size_t A, size_t B, size_t B2, size_t C, bool zero)
template<typename T>
void contraction2(Matrix<T> &h, const Tensor<T> &bra, const Tensor<T> &ket, Tensor<T> &bra_work, Tensor<T> &ket_work, size_t A, size_t B, size_t B2, size_t C, bool zero)
template<typename T>
void general_contraction(const Tensor<T> &A, const Tensor<T> &B, Tensor<T> &result, const vector<size_t> &A_indices, const vector<size_t> &B_indices)
template<typename T, typename Q>
void general_contraction(const Tensor<T> &A, const Tensor<T> &B, Tensor<T> &result, const std::vector<std::pair<Q, Q>> &contraction_pairs)
template<typename T>
void general_transpose_bd(T *dst, const T *src, size_t a, size_t b, size_t c, size_t d, size_t e)
template<typename T>
bool is_contraction_legal(const Tensor<T> &TensorA, const Tensor<T> &TensorB, vector<size_t> Acontraction, vector<size_t> Bcontraction)
template<typename T>
void general_transpose(Tensor<T> &dst, const Tensor<T> &src, size_t index_one, size_t index_two)
template<typename T>
void general_transpose_to_order(Tensor<T> &dst, const Tensor<T> &src, const vector<size_t> &form)
template<typename T, typename U>
void matrixTensorBLAS(Tensor<T> &C, Tensor<T> &workC, const Matrix<U> &A, const Tensor<T> &B, size_t mode, bool zero = true)

==== Wrappers ====

==== Wrappers ====

======================================================================== Wrappers for matrixTensor product and contraction

template<typename T, typename U>
void matrixTensorBLAS(Tensor<T> &C, const Matrix<U> &A, const Tensor<T> &B, size_t mode, bool zero = true)
template<typename T, typename U>
Tensor<T> matrixTensorBLAS(const Matrix<U> &A, const Tensor<T> &B, size_t mode, bool zero = true)
template<typename T>
void contractionBLAS(Matrix<T> &h, Tensor<T> &workA, Tensor<T> &workB, const Tensor<T> &A, const Tensor<T> &B, size_t mode, bool zero = true)
template<typename T>
void contractionBLAS(Matrix<T> &h, const Tensor<T> &A, const Tensor<T> &B, size_t mode, bool zero = true)

Wrapper for matrix-Tensor product.

template<typename T>
Matrix<T> contractionBLAS(const Tensor<T> &A, const Tensor<T> &B, size_t mode, bool zero = true)
file TensorShape.h
#include “stdafx.h”

Functions

TensorShape()
TensorShape(const initializer_list<size_t> &dims)
TensorShape(const vector<size_t> &dim)
TensorShape(istream &is)
TensorShape(const string &file)
~TensorShape()
void initialize(const vector<size_t> &dim)
void write(ostream &os) const
void write(const string &filename) const
void readDim(istream &is)
size_t order() const
size_t lastIdx() const
size_t totalDimension() const
size_t lastBefore() const
size_t lastDimension() const
void setDimension(size_t act, size_t k)
vector<size_t> dimensions() const
void print(ostream &os = cout) const
size_t before(size_t k) const
size_t after(size_t k) const
vector<size_t> indexMapping(size_t I, const TensorShape &shape)
size_t indexMapping(const vector<size_t> &idxs, const TensorShape &shape)
void indexMapping(vector<size_t> &idxs, size_t I, const TensorShape &shape)
TensorShape replaceDimension(TensorShape shape, size_t target, size_t new_dimension)
ostream &operator<<(ostream &os, const TensorShape &tdim)
istream &operator>>(istream &is, TensorShape &tdim)
bool operator==(const TensorShape &tdima, const TensorShape &tdimb)
bool operator!=(const TensorShape &tdima, const TensorShape &tdimb)

Variables

size_t totalDimension_
vector<size_t> before_
vector<size_t> after_
file Vector.h
#include “stdafx.h”#include “Eigen/Dense”

Typedefs

typedef Vector<double> Vectord
typedef Vector<complex<double>> Vectorcd

Functions

template<typename T>
void normalize(Vector<T> &a)
template<typename T>
double euclidean_distance(const Vector<T> &a, const Vector<T> &b)
template<typename T>
double residual(const Vector<T> &A, const Vector<T> &B)
template<typename T>
Vector<T> reverse(const Vector<T> &A)
template<typename T>
T sum(const Vector<T> &A)
template<typename T>
Vector<T> regularize(Vector<T> A, double eps)
template<typename T>
Vector<T> inverse(Vector<T> A, double eps = 1e-7)
Vectord toQutree(const Eigen::VectorXd &v)
Vectorcd toQutree(const Eigen::VectorXcd &v)
template<typename T>
void elementwise(Vector<T> &res, const Vector<T> &A, const function<T(T)> &f)
template<typename T>
Vector<T> elementwise(const Vector<T> &A, const function<T(T)> &f)
file Vector_Implementation.h
#include “Vector.h”

Functions

template<typename T>
T Sum(Vector<T> &a)
template<typename T>
void normalize(Vector<T> &a)
template<typename T>
double euclidean_distance(const Vector<T> &a, const Vector<T> &b)
template<typename T>
double residual(const Vector<T> &A, const Vector<T> &B)
template<typename T>
Vector<T> reverse(const Vector<T> &A)
template<typename T>
T sum(const Vector<T> &A)
template<typename T>
Vector<T> regularize(Vector<T> A, double eps)
template<typename T>
Vector<T> inverse(Vector<T> A, double eps)
Vectord toQutree(const Eigen::VectorXd &v)
Vectorcd toQutree(const Eigen::VectorXcd &v)
template<typename T>
void elementwise(Vector<T> &res, const Vector<T> &A, const function<T(T)> &f)
template<typename T>
Vector<T> elementwise(const Vector<T> &A, const function<T(T)> &f)
file CDVR.h
#include “DVR/TDDVR.h”#include “TreeOperators/Potential.h”#include “DVR/DeltaVTree.h”#include “DVR/cdvr_functions.h”#include “TreeClasses/TensorTreeFunctions.h”#include “TreeClasses/SymTensorTree.h”
file cdvr_functions.h
#include “TreeClasses/MatrixTree.h”#include “DVR/DeltaVTree.h”#include “DVR/MatrixTensorTree.h”#include “DVR/TreeGrids.h”
file DeltaVTree.h
#include “TreeClasses/NodeAttribute.h”#include “TreeShape/Tree.h”
file GridRepresentation.h
#include “TreeClasses/SparseMatrixTreeFunctions.h”#include “TreeClasses/SOPMatrixTrees.h”#include “TreeClasses/MatrixTreeFunctions.h”#include “TreeClasses/SpectralDecompositionTree.h”#include “Core/Tensor_Extension.h”
file MatrixTensorTree.h
#include “TreeClasses/MatrixTreeFunctions.h”

Typedefs

typedef TensorTreecd Wavefunction

Functions

bool IsWorking_bottomup(const MatrixTensorTree &Psi, const Tree &tree, double eps)
bool IsWorking_topdown(const MatrixTensorTree &Psi, const Tree &tree, double eps)
bool IsWorking(const MatrixTensorTree &Psi, const Tree &tree, double eps = 1e-7)
file MatrixTensorTree.h
#include “TreeClasses/TensorTree.h”#include “TreeClasses/MatrixTreeFunctions.h”

Functions

void QROrthogonalDown(TensorTreecd &Psi, const Tree &tree)
bool IsWorking_bottomup(const MatrixTensorTree &Psi, const Tree &tree, double eps)
bool IsWorking_topdown(const MatrixTensorTree &Psi, const Tree &tree, double eps)
bool IsWorking(const MatrixTensorTree &Psi, const Tree &tree, double eps = 1e-7)
file MatrixTensorTreeFunctions.h
#include “MatrixTensorTree.h”#include “TreeClasses/SparseMatrixTreeFunctions.h”

Typedefs

typedef pair<SparseMatrixTreecd, SparseMatrixTreecd> SparseMatrixTreePaircd
typedef vector<SparseMatrixTreePaircd> SparseMatrixTreePairscd
file MatrixTensorTreeFunctions.h
#include “MatrixTensorTree.h”#include “TreeClasses/SparseMatrixTreeFunctions.h”

Typedefs

typedef pair<SparseMatrixTreecd, SparseMatrixTreecd> SparseMatrixTreePaircd
typedef vector<SparseMatrixTreePaircd> SparseMatrixTreePairscd
file SymXMatrixTrees.h
#include “DVR/MatrixTensorTree.h”#include “TreeClasses/SparseMatrixTreeFunctions.h”#include “DVR/MatrixTensorTreeFunctions.h”#include “XMatrixTrees.h”#include “TreeClasses/SymTensorTree.h”#include “TreeClasses/SymMatrixTreeFunctions.h”

Functions

SOPcd symXsop(const Tree &tree)
file TDDVR.h
#include “DVR/TreeGrids.h”#include “DVR/XMatrixTrees.h”#include “TreeClasses/MatrixTree.h”#include “DVR/MatrixTensorTree.h”#include “TreeClasses/WorkMemory.h”#include “SymXMatrixTrees.h”
file TreeGrids.h
#include “TreeClasses/SparseMatrixTreeFunctions.h”#include “TreeClasses/SymMatrixTree.h”
file XMatrixTrees.h
#include “TreeClasses/SparseMatrixTreeFunctions.h”#include “TreeClasses/SOPMatrixTrees.h”#include “TreeClasses/MatrixTreeFunctions.h”#include “TreeClasses/SpectralDecompositionTree.h”#include “Core/Tensor_Extension.h”

Typedefs

typedef TensorTreecd Wavefunction
typedef pair<Matrixcd, size_t> MatrixIdx

Functions

SOPcd Xsop(const Tree &tree)
Wavefunction Regularize(Wavefunction Psi, const Tree &tree, double eps)
Matrixcd UnProject(size_t n_occupied, const Matrixcd &X, const Tensorcd &Phi)
Tensorcd Occupy(const Tensorcd &Phi, const Matrixcd &trafo, size_t n_occupied, const Node &node)
Matrixcd BuildX(const Tensorcd &Phi, const Matrixcd &rho, const SparseMatrixTreescd &xmats, const Node &node, double eps)
file QuTree.h
#include “Core/Matrix.h”#include “Core/Matrix_Extension.h”#include “Core/Matrix_Extension_Implementation.h”#include “Core/Matrix_Implementation.h”#include “Core/stdafx.h”#include “Core/Tensor.h”#include “Core/Tensor_Extension.h”#include “Core/Tensor_Extension_Implementation.h”#include “Core/Tensor_Implementation.h”#include “Core/TensorShape.h”#include “Core/Vector.h”#include “Core/Vector_Implementation.h”#include “TreeClasses/EdgeAttribute.h”#include “TreeClasses/MatrixTensorTree.h”#include “TreeClasses/MatrixTensorTreeFunctions.h”#include “TreeClasses/MatrixTree.h”#include “TreeClasses/MatrixTreeFunctions.h”#include “TreeClasses/MatrixTreeFunctions_Implementation.h”#include “TreeClasses/NodeAttribute.h”#include “TreeClasses/SOPMatrixTrees.h”#include “TreeClasses/SparseMatrixTree.h”#include “TreeClasses/SparseMatrixTreeFunctions.h”#include “TreeClasses/SparseMatrixTreeFunctions_Implementation.h”#include “TreeClasses/SparseNodeAttribute.h”#include “TreeClasses/SparseTree.h”#include “TreeClasses/SpectralDecompositionTree.h”#include “TreeClasses/SymTensorTree.h”#include “TreeClasses/TensorTree.h”#include “TreeClasses/TensorTreeFunctions_Implementation.h”#include “TreeClasses/TreeIO.h”#include “TreeClasses/TreeTransformation.h”#include “TreeClasses/TreeTransformation_Implementation.h”#include “TreeOperators/CoordinateTransformation.h”#include “TreeOperators/LeafFunction.h”#include “TreeOperators/LeafMatrix.h”#include “TreeOperators/LeafOperator.h”#include “TreeOperators/MultiLeafOperator.h”#include “TreeOperators/Potential.h”#include “TreeOperators/PotentialOperator.h”#include “TreeOperators/SOPVector.h”#include “TreeOperators/SumOfProductsOperator.h”#include “TreeOperators/SumOfProductsOperator_Implementation.h”#include “TreeShape/AbstractNode.h”#include “TreeShape/Edge.h”#include “TreeShape/Leaf.h”#include “TreeShape/LinearizedLeaves.h”#include “TreeShape/Node.h”#include “TreeShape/NodePosition.h”#include “TreeShape/Tree.h”#include “TreeShape/TreeFactory.h”#include “Util/BS_integrator.h”#include “Util/FFT.h”#include “Util/FFTCooleyTukey.h”#include “Util/JacobiRotationFramework.h”#include “Util/Lanzcos.h”#include “Util/QMConstants.h”#include “Util/SimultaneousDiagonalization.h”#include “../../QuTreeVM/src/Util/long_integer.h”
file BlockTree.h
#include “TreeClasses/Discrete/LabelTree.h”#include “TreeClasses/Discrete/U1Symmetry.h”

Typedefs

using BlockTensorShape = vector<TensorShape>
using BlockTreeShape = NodeAttribute<BlockTensorShape>
using Partition = vector<size_t>
using Partitions = vector<Partition>

Functions

vector<const ConfigurationTensor<> *> mask(const vector<const BlockTensor *> &As, const Partition &partition)
file LabelTree.h
#include “TreeShape/Tree.h”#include “TreeClasses/NodeAttribute.h”#include “TreeClasses/Discrete/SymmetricSCF.h”#include “TreeClasses/Discrete/U1Symmetry.h”

Typedefs

using BlockTensor = map<Label, ConfigurationTensor<>>
using LabelDimension = map<Label, size_t>

label -> tensor

Functions

ostream &operator<<(ostream &os, const LabelDimension &dim)
size_t labelDimension(const Label &label, size_t dimension, size_t n_hole)
TensorShape LabelShape(const TensorShape &shape, const Label &label)
file SymmetricSCF.h
#include “TreeClasses/NodeAttribute.h”#include <iostream>#include <random>

Functions

template<typename T>
ostream &operator<<(ostream &os, const Configuration<T> &c)
template<typename T>
ostream &operator<<(ostream &os, const ConfigurationTensor<T> &c)
template<typename T = size_t>
ostream &operator<<(ostream &os, const ConfigurationTree<T> &a)
ConfigurationTensor randomConfigurationTensor(const TensorShape &shape, mt19937 &gen)
ConfigurationTree randomConfigurationTree(const Tree &tree, mt19937 &gen)
ConfigurationTensor bottomTensor(const TensorShape &shape)
Configuration optimize(ConfigurationTree<> &Psi, function<double(const Configuration<> &c)> f, const Tree &tree, size_t n_sweep = 3, size_t verboseness = 1, )
size_t to_integer(const Configuration<> &c)
vector<size_t> split_integers(const Configuration<> &c, size_t n)
double to_double(size_t i, size_t max_val)
void split_doubles(vector<double> &xs, vector<size_t> &x_int, vector<size_t> &tmp, const Configuration<> &c, size_t n)
vector<double> split_doubles(const Configuration<> &c, size_t n)
file U1Symmetry.h
#include “stdio.h”#include <random>#include “TreeClasses/Discrete/SymmetricSCF.h”

Typedefs

using Label = size_t

Symmetry label, e.g. particle number.

using Labels = Configuration<Label>
using ilist = list<size_t>
using ivec = vector<size_t>

Functions

size_t factorial(size_t n)

Rationale: Reading https://math.stackexchange.com/questions/474741/formula-for-combinations-with-replacement helps understanding the thoughts behind partitions & combinatorics in this file.

size_t binomial(size_t k, size_t n)
std::vector<size_t> nChooseKrandom(size_t k, size_t n, std::mt19937 &gen)
Labels label_combinations(const NodeAttribute<Labels> &up, const NodeAttribute<Labels> &down, const Range &range, const Node &node, const Node &hole)
Labels combine(const Labels &L, const Labels &R, const Range &range)
list<ilist> partitions(ilist numbers, size_t size, size_t sum)
vector<Labels> partitions(const vector<Labels> numbers, size_t sum)
vector<Labels> partitions(const vector<const Labels *> numbers, size_t sum)
void combinatoricalMap(ivec &idx, size_t I, size_t k, size_t N)
void combinatoricalMap(size_t &I, const ivec &idx, size_t k, size_t N)
void combinatoricalMapBackconvention(ivec &idx, size_t I, size_t k, size_t N)
void randomCombination(ivec &idx, size_t k, size_t N, mt19937 &gen)
ostream &operator<<(ostream &os, const ivec &X)
size_t nPartitions(size_t sum, size_t nSummands)
void partitionMap(ivec &p, size_t &I, size_t sum, size_t nSummands)

returns the Ith partitions for ‘nSummands’ summands that sum up to ‘sum’.

void combinationToPartition(ivec &p)

Helper-function that does: 0111011 -> 032 (interfaced for unit test)

file EdgeAttribute.h
file EntropyTree.h
#include “TreeClasses/NodeAttribute.h”#include “TreeShape/Tree.h”#include “TreeClasses/TensorTree.h”
file HamiltonianRepresentation.h
#include “TreeOperators/Hamiltonian.h”#include “TreeClasses/SparseMatrixTreeFunctions.h”#include “TreeClasses/MatrixTreeFunctions.h”#include “TreeClasses/SpectralDecompositionTree.h”#include “Util/QMConstants.h”#include “DVR/CDVR.h”#include “DVR/MatrixTensorTreeFunctions.h”#include “TreeOperators/ActiveCounter.h”

Functions

Tensorcd Apply(const Hamiltonian &H, const Tensorcd &Phi, const HamiltonianRepresentation &hRep, const Node &node)
Matrixcd Expectation(const HamiltonianRepresentation &hRep, const Wavefunction &Psi, const Hamiltonian &H, const Tree &tree)
void LayerDerivative(Tensorcd &dPhi, double time, const Tensorcd &Phi, const Hamiltonian &H, const HamiltonianRepresentation &hRep, const Node &node, complex<double> propagation_phase = 1.)
void Derivative(Wavefunction &dPsi, HamiltonianRepresentation &hRep, double time, const Wavefunction &Psi, const Hamiltonian &H, const Tree &tree, complex<double> propagation_phase = 1.)
void symDerivative(MatrixTensorTree &dPsi, HamiltonianRepresentation &hRep, double time, const MatrixTensorTree &Psi, const Hamiltonian &H, const Tree &tree, complex<double> propagation_phase = 1.)
void output(const HamiltonianRepresentation &hrep, const Wavefunction &Psi, const Hamiltonian &H, const Tree &tree)
file IntegratorInterface.h
#include “TreeClasses/HamiltonianRepresentation.h”
file IntegratorVariables.h
#include “TreeOperators/Hamiltonian.h”
file LayerInterface.h
#include “TreeClasses/HamiltonianRepresentation.h”
file MatrixTree.h
#include “NodeAttribute.h”#include “TreeShape/Tree.h”

Typedefs

typedef MatrixTree<complex<double>> MatrixTreecd
typedef MatrixTree<double> MatrixTreed

Functions

template<typename T>
ostream &operator<<(ostream &os, const MatrixTree<T> &S)
template<typename T>
istream &operator>>(istream &is, MatrixTree<T> &S)
file MatrixTreeFunctions.h
#include “TreeClasses/TensorTree.h”#include “TreeClasses/MatrixTree.h”
file MatrixTreeFunctions_Implementation.h
#include “MatrixTreeFunctions.h”#include “Core/TensorBLAS.h”
file NodeAttribute.h
#include “TreeShape/Node.h”#include “TreeShape/Edge.h”#include “TreeShape/Tree.h”

Functions

template<class A>
void print(const NodeAttribute<A> &ATree, const Tree &tree)

Variables

vector<A> attributes_
file SOPMatrixTrees.h
#include “TreeClasses/SparseMatrixTree.h”#include “TreeOperators/SumOfProductsOperator.h”

Typedefs

typedef SOPMatrixTrees<complex<double>> MatrixTreescd
typedef SOPMatrixTrees<double> MatrixTreesd
file SparseMatrixTree.h
#include “TreeClasses/SparseNodeAttribute.h”#include “TreeClasses/TensorTree.h”

Typedefs

typedef SparseMatrixTree<complex<double>> SparseMatrixTreecd
typedef SparseMatrixTree<double> SparseMatrixTreed
using SparseMatrixTrees = vector<SparseMatrixTree<T>>
typedef SparseMatrixTrees<complex<double>> SparseMatrixTreescd
typedef SparseMatrixTrees<double> SparseMatrixTreesd

Functions

template<typename T>
ostream &operator>>(ostream &os, const SparseMatrixTree<T> &hmat)
template<typename T>
istream &operator<<(istream &is, SparseMatrixTree<T> &hmat)
file SparseMatrixTreeFunctions.h
#include “TreeClasses/SparseMatrixTree.h”#include “TreeClasses/SOPMatrixTrees.h”#include “TreeClasses/MatrixTree.h”#include “TreeClasses/WorkMemory.h”
file SparseMatrixTreeFunctions_Implementation.h
#include “TreeClasses/SparseMatrixTreeFunctions.h”#include “TreeClasses/MatrixTreeFunctions.h”#include “TreeClasses/SparseTensorTree.h”#include “Core/TensorBLAS.h”
file SparseNodeAttribute.h
#include “SparseTree.h”#include “NodeAttribute.h”

Variables

shared_ptr<SparseTree> active_

TreeMarker which marks whether a node is active_ or not.

vector<A> attributes_

Attributes only at every active_ node.

file SparseTensorTree.h
#include “TreeClasses/SparseNodeAttribute.h”#include “TreeClasses/TensorTree.h”

Typedefs

typedef SparseTensorTree<complex<double>> SparseTensorTreecd
typedef SparseTensorTree<double> SparseTensorTreed
file SparseTree.h
#include “NodeAttribute.h”#include “TreeShape/Tree.h”#include “TreeOperators/MultiLeafOperator.h”#include “TreeOperators/SumOfProductsOperator.h”#include <map>#include <chrono>

Variables

vector<const Node *> nodes_
map<size_t, size_t> co_address_
file SpectralDecompositionTree.h
#include “NodeAttribute.h”#include “Core/Matrix.h”#include “TreeClasses/MatrixTreeFunctions.h”#include “Core/Vector.h”

Typedefs

typedef SpectralDecompositionTree<complex<double>> SpectralDecompositionTreecd
typedef SpectralDecompositionTree<double> SpectralDecompositionTreed

Functions

template<typename T>
void canonicalTransformation(TensorTree<T> &Psi, const Tree &tree, bool orthogonal = false)
template<typename T>
SpectralDecompositionTree<T> sqrt(SpectralDecompositionTree<T> X)
template<typename T>
MatrixTree<T> sqrt(MatrixTree<T> X, const Tree &tree)
template<typename T>
SpectralDecompositionTree<T> inverse(SpectralDecompositionTree<T> X, double eps = 1e-7)
template<typename T>
MatrixTree<T> inverse(MatrixTree<T> X, const Tree &tree, double eps = 1e-7)
template<typename T>
MatrixTree<T> toMatrixtree(const SpectralDecompositionTree<T> &X, const Tree &tree)
file SymMatrixTree.h

Typedefs

using SymMatrixTrees = vector<SymMatrixTree>
file SymMatrixTreeFunctions.h
file SymTensorTree.h
#include “MatrixTensorTreeFunctions.h”#include “SymMatrixTree.h”

Functions

Tensorcd canonicalTensor(Tensorcd w, bool up, bool down)
Matrixcd calculateB(const Tensorcd &weighted, size_t k)
bool isWorking(const SymTensorTree &Psi, const Tree &tree)
void symDotProduct(const SymTensorTree &Bra, const SymTensorTree &Ket, const Tree &tree)
template<typename T>
void createWeighted(TensorTree<T> &weighted, TensorTree<T> &down, const TensorTreecd &up, const Tree &tree)
file TensorTree.h
#include “NodeAttribute.h”#include “TreeShape/Tree.h”#include “Core/Tensor.h”#include <random>

Typedefs

typedef TensorTree<complex<double>> TensorTreecd
typedef TensorTree<double> TensorTreed

Functions

TensorTree()

Default constructor without memory allocation.

TensorTree(const Tree &tree)

Constructor with allocation of memory.

TensorTree(istream &is)

Construct TensorTree from stream.

TensorTree(const string &filename)

Construct TensorTree from file.

TensorTree(mt19937 &gen, const Tree &tree, bool delta_lowest = true)

Create tensor tree and occupy the coefficients.

~TensorTree()

Default destructor.

void initialize(const Tree &tree)

Create Tensors for all nodes.

Allocate memory. Call only after initializing TreeMarker. Requires default constructor.

void fillRandom(mt19937 &gen, const Tree &tree, bool delta_lowest = true)

generate TTs

void read(istream &is)

(File) I/O read TensorTree from stream (binary format)

void write(ostream &os) const

Write TensorTree to stream (binary format)

void write(const string &filename, bool append = true) const

Write TensorTree to file (binary format)

void print(const Tree &tree, ostream &os = cout) const

Print info in human readable format.

TensorTree &operator+=(const TensorTree<T> &R)

Arithmetic operators.

TensorTree &operator-=(const TensorTree<T> &R)
TensorTree operator+(const TensorTree<T> &R)
TensorTree operator-(const TensorTree<T> &R)
Tensor &operator*=(T c)
Tensor &operator/=(T c)
TensorTree operator*(T c)
TensorTree operator/(T c)
void fillBottom(Tensor<T> &Phi, const Node &node)
void fillUpper(Tensor<T> &Phi, std::mt19937 &gen, const Node &node, bool delta_lowest = true)
template<typename T>
void orthogonal(TensorTree<T> &Psi, const Tree &tree)
template<typename T>
void qrOrthogonal(TensorTree<T> &Psi, const Tree &tree)
template<typename T>
void orthonormal(TensorTree<T> &Psi, const Tree &tree)
template<typename T>
ostream &operator<<(ostream &os, const TensorTree<T> &t)
template<typename T>
istream &operator>>(istream &is, TensorTree<T> &t)
template<typename T>
TensorTree<T> operator*(T c, TensorTree<T> R)
template<typename T>
TensorTree<T> operator/(T c, TensorTree<T> R)
file TensorTree_Implementation.h
#include “TensorTree.h”#include “Core/Tensor_Extension.h”

Functions

template<typename T>
void orthogonal(TensorTree<T> &Psi, const Tree &tree)
template<typename T>
void qrOrthogonal(TensorTree<T> &Psi, const Tree &tree)
template<typename T>
void orthonormal(TensorTree<T> &Psi, const Tree &tree)
template<typename T>
ostream &operator<<(ostream &os, const TensorTree<T> &t)
template<typename T>
istream &operator>>(istream &is, TensorTree<T> &t)
file TensorTreeFunctions.h
#include “TreeClasses/SpectralDecompositionTree.h”
file TensorTreeFunctions_Implementation.h
#include “TensorTreeFunctions.h”
file TreeIO.h
#include “TreeClasses/MatrixTreeFunctions.h”#include “TreeClasses/TensorTree.h”#include “TreeClasses/SparseMatrixTree.h”
file TreeTransformation.h
#include “TreeClasses/MatrixTreeFunctions.h”
file TreeTransformation_Implementation.h
#include “TreeClasses/TreeTransformation.h”#include “TreeClasses/SpectralDecompositionTree.h”
file WorkMemory.h
#include “TensorTree.h”

Typedefs

typedef WorkMemory<complex<double>> WorkMemorycd
typedef WorkMemory<double> WorkMemoryd
file ActiveCounter.h
#include “TreeClasses/NodeAttribute.h”#include “TreeOperators/SumOfProductsOperator.h”#include “TreeClasses/SparseMatrixTree.h”

Functions

size_t nActives(const SparseMatrixTreecd &hmat, const MLOcd &M, const SparseMatrixTreecd &hcon, const Node &node)
file CoordinateTransformation.h
#include “Core/Vector.h”
file DeltaOperator.h
#include “Core/Matrix.h”#include “Core/Tensor.h”#include “TreeClasses/SparseMatrixTreeFunctions.h”#include “Core/TensorBLAS.h”

Functions

Matrixcd product(const DeltaOperator &w, const Matrixcd &r, DeltaMemory *mem_ptr)
file FortranOperator.h
#include “TreeOperators/LeafOperator.h”

Typedefs

typedef function<void(int *, int *, double *, double *, int *, double *, double *, double *)> FortranSystemH
file FortranSOP.h
#include “TreeOperators/Hamiltonian.h”#include “Core/Vector.h”#include “TreeOperators/FortranOperator.h”#include “Core/Matrix.h”

Typedefs

typedef TensorTreecd Wavefunction

Functions

void ApplyFortranDDX(complex<double> hPsi[], complex<double> Psi[], const LeafInterface &phys, int dim)
void ApplyFortranKIN(complex<double> hPsi[], complex<double> Psi[], const LeafInterface &phys, int dim)
file Hamiltonian.h
#include “TreeOperators/SumOfProductsOperator.h”
file LeafFunction.h
#include “LeafOperator.h”

Typedefs

using LeafFun = function<void(const LeafInterface&, Tensor<T>&, const Tensor<T>&)>
using LeafFunPair = pair<LeafFun<T>, LeafFun<T>>
typedef LeafFunPair<complex<double>> LeafFunPaircd
typedef LeafFunPair<double> LeafFunPaird
typedef LeafFun<complex<double>> LeafFuncd
typedef LeafFunction<complex<double>> LeafFunctioncd

Functions

LeafFunction()
LeafFunction(const LeafFun<T> h)
~LeafFunction()
void apply(const LeafInterface &grid, Tensor<T> &hAcoeff, const Tensor<T> &Acoeff) const

Variables

LeafFun<T> h_
file LeafMatrix.h
#include “LeafOperator.h”#include “Core/Matrix.h”#include “TreeShape/Leaf.h”

Typedefs

typedef LeafMatrix<complex<double>> LeafMatrixcd
typedef LeafMatrix<double> LeafMatrixd

Functions

Matrixcd toMatrix(const LeafOperatorcd &h, const Leaf &leaf)
Matrixd toMatrix(const LeafOperatord &h, const Leaf &leaf)
LeafMatrix()
LeafMatrix(Matrix<T> h, bool adjoint = false)
~LeafMatrix()
virtual void apply(const LeafInterface &grid, Tensor<T> &hAcoeff, const Tensor<T> &Acoeff) const
const Matrix<T> &matrix() const

Variables

Matrix<T> h_
file LeafOperator.h
#include “Core/Tensor.h”#include “TreeShape/LeafTypes/LeafInterface.h”

Typedefs

typedef LeafOperator<complex<double>> LeafOperatorcd
typedef LeafOperator<double> LeafOperatord
file MultiLeafOperator.h
#include “Core/Tensor.h”#include “TreeShape/Tree.h”#include “TreeClasses/TensorTree.h”#include “LeafOperator.h”#include “LeafFunction.h”#include “LeafMatrix.h”#include “PotentialOperator.h”

Typedefs

using MLO = MultiLeafOperator<T>
typedef MLO<complex<double>> MLOcd
typedef MLO<double> MLOd

Variables

vector<shared_ptr<LeafOperator<T>>> leafOperators_

These are the SPOs.

vector<size_t> targetLeaves_

These are the modes the SPOs act on.

PotentialOperator v_

The potential operator.

bool hasV_

Is there a PotentialOperator?

file Potential.h
#include “Core/Vector.h”#include “TreeShape/Tree.h”
file PotentialOperator.h
#include “Core/stdafx.h”#include “TreeOperators/Potential.h”#include “TreeOperators/CoordinateTransformation.h”

Variables

shared_ptr<CoordinateTransformation> Q_
size_t f_
size_t state_
shared_ptr<Potential> V_
file SOPVector.h
#include “SumOfProductsOperator.h”

Typedefs

typedef SOPVector<complex<double>> SOPVectorcd

Functions

SOPVector()
SOPVector(const SOP<T> &A)
SOPVector(const MLO<T> &M)
void append(const SOP<T> &A)
void append(const MLO<T> &M)
void append(const SOPVector<T> &A)
friend SOPVector<T> operator*(const MLO<T> &M, const SOPVector<T> &A)

Operators /////////////////////////////////////////////////////////////////// multiply with coefficient.

file SumOfProductsOperator.h
#include “MultiLeafOperator.h”

Typedefs

using SOP = SumOfProductsOperator<T>
typedef SOP<complex<double>> SOPcd
typedef SOP<double> SOPd

Functions

template<typename T>
SOP<T> multAB(const SOP<T> &A, const SOP<T> &B)

Variables

vector<MLO<T>> mpos_
vector<T> coeff_
file SumOfProductsOperator_Implementation.h
#include “TreeOperators/SumOfProductsOperator.h”

Functions

template<typename T>
SumOfProductsOperator<T> multAB(const SOP<T> &A, const SOP<T> &B)
template<typename T>
SumOfProductsOperator<T> operator*(T c, const SOP<T> &A)
template<typename T>
SumOfProductsOperator<T> operator*(const SOP<T> &A, T c)
template<typename T>
SumOfProductsOperator<T> operator*(const MLO<T> &M, const SOP<T> &A)
template<typename T>
SumOfProductsOperator<T> operator*(const SOP<T> &A, const MLO<T> &M)
template<typename T>
SumOfProductsOperator<T> operator*(const SOP<T> &A, const SOP<T> &B)
template<typename T>
SumOfProductsOperator<T> operator+(const SumOfProductsOperator<T> &A, const SumOfProductsOperator<T> &B)
file contractCircuit.h
#include “TreeOperators/TensorOperators/contractSOP.h”#include “TreeOperators/SOPVector.h”

Functions

template<typename T>
TensorTreeOperator<T> contractCircuit(const SOP<T> &S, const TensorTreeOperator<T> &U, size_t maxIter, const Tree &optree, ostream *os)

Calculate product of SOP operator with TTNO, i.e. A = S * U.

Return

contracted TTNO A

Template Parameters
  • T: base-type

Parameters
  • S: Sum-of-product operator that is applied

  • U: contrcted Operator

  • maxIter: code will leave after max-Iterations if not converged

  • optree: operator tree

  • os: out-stream for output during optimization (optional)

template<typename T>
TensorTreeOperator<T> contractCircuit(const SOPVector<T> &circuit, size_t maxIter, const Tree &optree, ostream *os)
file contractSOP.h
#include “TreeOperators/TensorOperators/TensorTreeOperator.h”#include “TreeOperators/TensorOperators/TTOMatrixTree.h”#include “TreeOperators/TensorOperators/TTOHoleTree.h”

Functions

template<typename T>
void contractSOP(TensorTreeOperator<T> &A, const SOP<T> &S, size_t maxIter, const Tree &optree, ostream *os)
template<typename T>
void iterate(TensorTreeOperator<T> &A, const SOP<T> &S, const Tree &optree)
template<typename T>
double error(const TensorTreeOperator<T> &A, const SOP<T> &S, const Tree &optree, ostream *os = nullptr)
file TensorOperatorRepresentation.h

Typedefs

typedef TensorOperatorRepresentation<double> TensorOperatorRepresentationd
typedef TensorOperatorRepresentation<complex<double>> TensorOperatorRepresentationcd
file TensorTreeOperator.h
#include “TreeClasses/NodeAttribute.h”#include “TreeClasses/TensorTree.h”#include “TreeOperators/LeafMatrix.h”#include “TreeOperators/MultiLeafOperator.h”#include “TreeOperators/SumOfProductsOperator.h”

Typedefs

typedef TensorTreeOperator<double> TensorTreeOperatord
typedef TensorTreeOperator<complex<double>> TensorTreeOperatorcd

Functions

template<typename T>
void toTensor(Tensor<T> &A, const MLO<T> &M, size_t part, const Leaf &leaf)
template<typename T>
void toTensor(Tensor<T> &A, const Matrix<T> &M, size_t part, const Leaf &leaf)
template<typename T>
Matrix<T> toMatrix(const MLO<T> &M, const Leaf &leaf)
template<typename T>
Matrix<T> toMatrix(const Tensor<T> &B, size_t l, const Leaf &leaf)
template<typename T>
TensorTreeOperator<T> product(const MLO<T> &M, TensorTreeOperator<T> A, const Tree &tree)
file TTOcontraction.h
#include “TreeClasses/TensorTree.h”#include “TreeOperators/TensorOperators/TensorTreeOperator.h”#include “TreeOperators/TensorOperators/TTOrepresentation.h”

Typedefs

typedef TTOcontraction<double> TTOcontractiond
typedef TTOcontraction<complex<double>> TTOcontractioncd

Functions

template<typename T>
Tensor<T> apply(const Tensor<T> &Phi, const TensorTreeOperator<T> &H, const TTOrepresentation<T> &rep, const TTOcontraction<T> &con, const Node &node)
file TTOcontraction_Implementation.h
#include “TreeOperators/TensorOperators/TTOcontraction.h”

Functions

template<typename T>
Tensor<T> apply(const Tensor<T> &Phi, const TensorTreeOperator<T> &H, const TTOrepresentation<T> &rep, const TTOcontraction<T> &con, const Node &node)
file TTOHoleTree.h
#include “TTOMatrixTree.h”

Typedefs

typedef TTOHoleTree<double> TTOHoleTreed
typedef TTOHoleTree<complex<double>> TTOHoleTreecd
file TTOMatrixTree.h
#include “TensorTreeOperator.h”#include “TreeClasses/MatrixTree.h”#include “TreeOperators/SumOfProductsOperator.h”

Typedefs

typedef TTOMatrixTree<double> TTOMatrixTreed
typedef TTOMatrixTree<complex<double>> TTOMatrixTreecd

Functions

template<typename T>
void toTensor(Tensor<T> &A, const MLO<T> &M, size_t part, const Leaf &leaf)
template<typename T>
Tensor<T> toTensor(const SOP<T> &S, const Leaf &leaf)
template<typename T>
T prodMk(const vector<size_t> &idx, const vector<Matrix<T>> &Mk, size_t l, int skip = -1)
file TTOrepresentation.h
#include “TreeClasses/TensorTree.h”#include “TreeOperators/TensorOperators/TensorTreeOperator.h”

Typedefs

typedef TTOrepresentation<complex<double>> TTOrepresentationcd
typedef TTOrepresentation<double> TTOrepresentationd
file TreeSOP.h
#include “TreeClasses/NodeAttribute.h”#include “TreeOperators/LeafOperator.h”

Typedefs

typedef vector<shared_ptr<LeafOperatorcd>> LeafOperatorLib
typedef vector<NodeOperator> NodeProductOperator
typedef vector<NodeSOP> NodeSOPlist

Functions

bool IsActive(const NodeOperator &h, const NodeProductOperator &M)
void print(const NodeSOPlist &sopl, const vector<string> &names, size_t indent)
void print(const NodeSOP &sop, const vector<string> &names, size_t indent)
file AbstractNode.h
#include “Core/stdafx.h”#include “NodePosition.h”
file Edge.h
#include “TreeShape/Node.h”
file Leaf.h
#include “Core/stdafx.h”#include “AbstractNode.h”#include “NodePosition.h”#include “LeafTypes/LeafInterface.h”

Functions

Leaf(istream &file, AbstractNode *up, NodePosition position)
Leaf(size_t dim, size_t mode, size_t type, size_t subtype, PhysPar par)
Leaf()
Leaf(const Leaf&)
Leaf(Leaf&&)
Leaf &operator=(const Leaf&)
Leaf &operator=(Leaf&&)
~Leaf()
void CreatePrimitiveBasis(size_t type, size_t subtype, size_t dim)
void info(ostream &os = cout) const
void write(ostream &os = cout) const
size_t nTotalNodes() const
size_t nNodes() const
size_t nLeaves() const
AbstractNode *nextNode()
AbstractNode *nextSCFNode(AbstractNode *in)
AbstractNode *nextNodeManthe()
int &mode() const
size_t Type() const
size_t dim() const
int type() const
const LeafInterface &interface()
const Node &parent() const
void setPar(PhysPar par)
PhysPar par() const
double omega() const
double r0() const
double wfr0() const
double wfOmega() const
void update(const NodePosition &p)
void updatePosition(const NodePosition &p)
void setParent(AbstractNode *node)

Variables

double par0
double par1
double par2
double par3
int dim_
int type_
int mode_
int subType_
int nodeType_
AbstractNode *parent_
PhysPar par_
NodePosition position_
unique_ptr<LeafInterface> interface_
file DVRBasis.h
#include “Core/Tensor.h”#include “LeafInterface.h”#include “Core/Matrix.h”#include “Core/Vector.h”
file FFTGrid.h
#include “LeafInterface.h”#include “Core/Matrix.h”#include “Core/Vector.h”#include “Core/Tensor.h”
file HO_Basis.h
#include “Util/SimultaneousDiagonalization.h”#include “DVRBasis.h”
file LeafInterface.h
#include “Core/Tensor.h”
file LegendrePolynomials.h
#include <iostream>#include “DVRBasis.h”
file SpinGroup.h
#include “LeafInterface.h”#include “Core/Matrix.h”#include “Core/Vector.h”#include “Core/Tensor.h”#include <random>#include “Util/QMConstants.h”
file LinearizedLeaves.h
#include “Leaf.h”

Variables

vector<reference_wrapper<Leaf>> coordinates_
vector<int> address_
file Node.h
#include “Core/stdafx.h”#include “AbstractNode.h”#include “Leaf.h”#include “NodePosition.h”

Functions

Node()
Node(istream &file, Node *up, const NodePosition &position)
Node(const Node &node)
Node(Node &&node)
Node &operator=(const Node &old)
Node &operator=(Node &&old)
Node(const Leaf &leaf, size_t ntensor)
~Node()
void initialize(istream &file, Node *up, const NodePosition &position)
void info(ostream &os = cout) const
void write(ostream &os) const
size_t nTotalNodes() const
size_t nNodes() const
size_t nLeaves() const
int type() const
bool isBottomlayer() const
bool isToplayer() const
const Leaf &getLeaf()
const Node &parent() const
Node &child(size_t i) const
size_t childIdx() const
size_t parentIdx() const
int nChildren() const
const TensorShape &shape()
void expandChild(size_t i)
NodePosition position() const
void push_back(const Node &node)
auto begin() const

Swipe bottom-up over attributes_ at every active_ node.

auto end() const

Swipe bottom-up over attributes_ at every active_ node.

void setAddress(int newaddress)
int address() const
AbstractNode *nextNode()
AbstractNode *nextSCFNode(AbstractNode *in)
AbstractNode *nextNodeManthe()
unique_ptr<AbstractNode> downUnique(size_t i)
void setParent(AbstractNode *up)
void replace(Node &new_child, size_t idx)
void update(const NodePosition &p)
void updatePosition(const NodePosition &p)
void updatennodes()
void updateTDim()
void resetCounters()
Node &topNode()

Variables

size_t nTotalNodes_
size_t nNodes_
size_t nLeaves_
TensorShape tensorDim_
AbstractNode *parent_
vector<unique_ptr<AbstractNode>> child_
int nextNodeNum_ = {0}
size_t nextNodeNumFortran_ = {0}
NodePosition position_
int address_
int nodeType_
bool bottomLayer_
file NodePosition.h
#include “Core/stdafx.h”

Functions

NodePosition()
~NodePosition()
friend NodePosition operator*(NodePosition p, size_t k)
friend NodePosition operator*(NodePosition p, NodePosition q)
void info(ostream &os = cout, bool print_layer = false) const
size_t childIdx() const
size_t layer() const
file Tree.h
#include “Node.h”#include “Edge.h”#include “LinearizedLeaves.h”#include <map>#include <numeric>

Typedefs

typedef vector<reference_wrapper<Node>> LinearizedNodes

Functions

ostream &operator<<(ostream &os, const Tree &tree)
istream &operator>>(istream &is, Tree &tree)
file Tree.h
#include “TreeNode.h”#include <map>

Functions

TreeNode Group(const TreeNode &node, const NodeContent &c)
file TreeFactory.h
#include “TreeShape/Tree.h”
file BS_integrator.h
#include “Core/stdafx.h”#include <functional>#include “Core/Tensor.h”

Variables

vector<int> sequence_
vector<T> yvec_
vector<double> xtab_
vector<T> ytab_
int dim_
int max_
int maxuse_
double shrink_
double grow_
file FFT.h
#include “Core/Tensor.h”
file FFTCooleyTukey.h
#include “Core/Vector.h”#include “Core/stdafx.h”#include “Core/Tensor.h”#include <bitset>

Functions

template<typename T>
T reverse(T n, size_t b = sizeof(T) * CHAR_BIT)
file GateOperators.h
#include “Core/Matrix.h”#include “TreeOperators/SumOfProductsOperator.h”#include “TreeOperators/SOPVector.h”

Functions

Matrixcd sigma_x()

Rationale:

  • Small library for Quantum Circuits

  • Only contains functions that are needed for unit testing

Matrixcd sigma_y()
Matrixcd sigma_z()
SOPcd controlled(const SOPcd &in, size_t control)

Turn an operation into a controlled operation.

SOPcd controlled(const MLOcd &M, size_t c, size_t t)
SOPcd controlled(const Matrixcd &L, size_t c, size_t t)
SOPcd CNot(size_t c, size_t t)
SOPcd CZ(size_t c, size_t t)

CNot Chain.

SOPVectorcd QFT(size_t mode_start, size_t n_bit, bool adjungate = false, size_t approx = 0)
file GradientDescent.h
#include “Core/stdafx.h”

Functions

template<class Interface, class Func>
void gradientDescent(Interface &func, double learning_rate, size_t num_iter)
file GradientDescent_Implementation.h
#include “Util/GradientDescent.h”

Functions

double lr_schedule(double learning_rate, double time, double max_time)
template<class Model, class Parameters>
void gradientDescent(Model &func, double learning_rate, size_t num_iter)
file JacobiRotationFramework.h
#include “Core/Matrix.h”
file Lanzcos.h
#include <glob.h>#include “Core/TensorShape.h”#include “Core/Tensor.h”#include “Core/Matrix.h”#include “Core/Vector.h”
file MultiIndex.h
#include “Core/stdafx.h”
file normal_modes.h
#include “TreeOperators/Potential.h”#include “TreeOperators/CoordinateTransformation.h”#include “TreeOperators/Hamiltonian.h”

Functions

Vectord getx0(const Tree &tree, const CoordinateTransformation &U)
void find_minimum(const Hamiltonian &H, const Tree &tree)
file Overlaps.h
#include “TreeClasses/TensorTree.h”

Enums

enum OverlapType

Values:

full
diagonal

Functions

void wavefunctionOverlap(const string &file1, const string &file2, const Tree &tree, OverlapType = diagonal)
void wavefunctionOverlap(const vector<TensorTreecd> &Psi, const vector<TensorTreecd> &Chi, const Tree &tree, OverlapType = full)
file QMConstants.h
#include “Core/stdafx.h”
file qutree_rng.h
#include <random>
file RandomMatrices.h
#include “Core/Matrix.h”#include <random>
file RandomProjector.h
#include <random>#include “Core/Matrix.h”#include “Core/Tensor.h”
file RandomProjector_Implementation.h
#include “Util/RandomProjector.h”#include “Core/MatrixBLAS.h”
file RungeKutta4.h
#include <iostream>#include <fstream>#include <functional>
file SimultaneousDiagonalization.h
#include “Core/Matrix.h”#include “Core/Vector.h”#include “Core/stdafx.h”#include <random>#include “JacobiRotationFramework.h”
file string_ext.h
#include <string>
file TreeNode.h
#include <utility>#include <vector>#include <iostream>#include “Core/TensorShape.h”

Typedefs

typedef vector<size_t> Path

Functions

void print(const Path &p, ostream &os = cout)
file WeightedSimultaneousDiagonalization.h
#include “Core/Matrix.h”#include “Core/Vector.h”#include “JacobiRotationFramework.h”

Variables

[anonymous] WSD = WeightedSimultaneousDiagonalization
file ApplyFirstOrder.cpp
#include “Applications/ApplyFirstOrder.h”#include “Util/RandomProjector.h”#include “TreeClasses/EntropyTree.h”#include “TreeClasses/SparseTree.h”#include “Applications/TreeApplyOperator.h”#include “TreeClasses/TreeIO.h”
file CMFIntegrator.cpp
#include “Applications/CMFIntegrator.h”#include <chrono>#include “TreeClasses/TreeIO.h”

Variables

constexpr bool eom_spf = true
file Eigenstates.cpp
#include “Applications/Eigenstates.h”#include “TreeClasses/SpectralDecompositionTree.h”#include <iomanip>

Functions

Vectord propagatorEnergies(const Wavefunction &Psi, const Tree &tree, double out)
Vectord Eigenstate(Wavefunction &Psi, const Hamiltonian &H, const Tree &tree, const Tree &cdvrtree)
void Status(const Vectord &eigenvalues, const Vectord &propergatorev, const Matrixcd &S, ostream &os)
void Eigenstates(IntegratorVariables &ivar)
file SCF.cpp
#include “Applications/SCF.h”#include “TreeClasses/SparseMatrixTreeFunctions.h”#include “TreeClasses/HamiltonianRepresentation.h”#include “TreeClasses/TreeIO.h”#include “Core/TensorBLAS.h”#include <iomanip>#include <chrono>

Functions

void addNodes(vector<const Node *> &sweep, const Node *p)
vector<const Node *> scf_sweep(const Tree &tree)
void apply(Tensorcd &HA, const Tensorcd &A, const SparseMatrixTreescd &hMats, const SparseMatrixTreescd &hCons, const SparseMatrixTreecd &hCorr, const SparseMatrixTreecd &hConCorr, const MatrixTreecd *rho, const Hamiltonian &H, const Node &node, const vector<size_t> &n_actives, Tensorcd *work)
void apply(Tensorcd &HA, const Tensorcd &A, const HamiltonianRepresentation &hrep, const Hamiltonian &H, const Node &node)
Tensorcd apply(const Tensorcd &A, const HamiltonianRepresentation &hrep, const Hamiltonian &H, const Node &node)
complex<double> fullContraction(const Tensorcd &A, const Tensorcd &B)
double normalize(Tensorcd &A)
void testKrylovSpace(const KrylovSpace &space, const HamiltonianRepresentation &hrep, const Hamiltonian &H, const Node &node)
void solveKrylovSpace(KrylovSpace &krylov, Tensorcd Psi, const HamiltonianRepresentation &hrep, const Hamiltonian &H, const Node &node, size_t krylov_size, double conversion)
void imaginaryTimePropagation(Tensorcd &Psi, const KrylovSpace &kry, double beta)
void diagonalizeKrylov(Tensorcd &Psi, const KrylovSpace &kry)
size_t adjacentIndex(const Node &from, const Node *to)
void outputSCF(Tensorcd Psi, const HamiltonianRepresentation &hrep, const Hamiltonian &H, const Node &node)
void scf(SCF_parameters &par)
file TreeApplyOperator.cpp
#include “Applications/TreeApplyOperator.h”#include “Core/Tensor_Extension.h”#include “Util/RandomProjector_Implementation.h”#include “TreeOperators/DeltaOperator.h”#include “TreeClasses/TreeIO.h”
file TreeApplyOperatorDynamic.cpp
#include “Applications/TreeApplyOperatorDynamic.h”#include “TreeClasses/TreeIO.h”#include “Util/RandomProjector.h”#include “TreeClasses/EntropyTree.h”
file JacobiRotationFramework.cpp
#include “Util/JacobiRotationFramework.h”
file Matrix_Instantiations.cpp
#include “Core/Matrix_Implementation.h”#include “Core/Matrix_Extension_Implementation.h”#include “Util/RandomProjector_Implementation.h”

Typedefs

typedef complex<double> cd
typedef double doub
typedef double d

Functions

template Vector<complex<double> > multAB< cd >(const Matrix < complex< double >> & A, const Vector < complex< double >> & B)

Arithmetic.

template Vector<double> multAB< doub >(const Matrix < double > & A, const Vector < double > & B)
template Vector<cd> multATB< cd >(const Matrix < cd > & A, const Vector < cd > & B)
template Vector<d> multATB< d >(const Matrix < d > & A, const Vector < d > & B)
template Matrix<double> multAB(const Matrix < double > & A, const Matrix < double > & B)
template Matrix<cd> multAB(const Matrix < cd > & A, const Matrix < cd > & B)
template Matrix<double> multATB(const Matrix < double > & A, const Matrix < double > & B)
template Matrix<cd> multATB(const Matrix < cd > & A, const Matrix < cd > & B)
template Matrix<cd> addAB(const Matrix < cd > & A, const Matrix < cd > & B)
template Matrix<doub> addAB(const Matrix < doub > & A, const Matrix < doub > & B)
template Matrix<doub> substAB(const Matrix < doub > & A, const Matrix < doub > & B)
template Matrix<cd> substAB< cd >(const Matrix < cd > & A, const Matrix < cd > & B)
template Matrix<cd> multscalar< cd, cd >(const cd sca, const Matrix < cd > & B)
template Matrix<cd> multscalar< cd, doub >(const double sca, const Matrix < cd > & B)
template Matrix<doub> multscalar< doub, doub >(const double sca, const Matrix < doub > & B)
template Matrix<cd> unitarySimilarityTrafo< cd >(const Matrix < cd > & A, const Matrix < cd > & B)
template Matrix<double> unitarySimilarityTrafo< doub >(const Matrix < double > & A, const Matrix < double > & B)
template Matrix<cd> re(const Matrix < cd > & A)
template Matrix<d> re(const Matrix < d > & A)
template Matrix<cd> identityMatrix(size_t dim)

Convenience & Management.

Convenience & Management.

Return

identity-matrix

Template Parameters
  • T: Type of identity matrix

Parameters
  • dim: dimension

template double residual(const Matrixcd & A, const Matrixcd & B)
template double residual(const Matrixd & A, const Matrixd & B)
template Matrix<cd> regularize(const Matrix < cd > & A, double eps)
template Matrix<d> regularize(const Matrix < d > & A, double eps)
template Matrix<cd> merge(const Matrix < cd > & A, const Matrix < cd > & B, const Matrix < cd > & AB)
template Matrix<d> merge(const Matrix < d > & A, const Matrix < d > & B, const Matrix < d > & AB)
template Matrix<cd> subMatrix(const Matrix < cd > A, size_t dim1, size_t dim2)
template Matrix<d> subMatrix(const Matrix < d > A, size_t dim1, size_t dim2)
template ostream& operator<<< cd >(ostream & os, const Matrixcd & A)
template istream& operator>>< cd >(istream & is, Matrixcd & A)
template ostream& operator<<< doub >(ostream & os, const Matrix < doub > & A)
template istream& operator>>< doub >(istream & is, Matrix < doub > & A)
template Matrix<double> euclideanDistance(const Matrix < double > & A)
template SpectralDecompositioncd sqrt(SpectralDecompositioncd X)

Matrix Extension.

template SpectralDecompositiond sqrt(SpectralDecompositiond X)
template SpectralDecompositioncd inverse(SpectralDecompositioncd X, double eps)
template SpectralDecompositiond inverse(SpectralDecompositiond X, double eps)
template Matrixcd toMatrix(const SpectralDecompositioncd & X)
template Matrixd toMatrix(const SpectralDecompositiond & X)
template SpectralDecomposition<double> reduceRank(const SpectralDecomposition < double > & x, size_t rank)
template SpectralDecomposition<cd> reduceRank(const SpectralDecomposition < cd > & x, size_t rank)
file MatrixBLAS.cpp
#include “Core/MatrixBLAS.h”#include <cblas.h>#include <lapacke.h>

Functions

void qrBLAS(Matrixcd &Q, const Matrixcd &A)
file stdafx.cpp
#include “Core/stdafx.h”

Functions

double conj(double x)
int conj(const int d)
file Tensor_Extension_Instantiations.cpp
#include “Core/Tensor_Extension_Implementation.h”

Typedefs

typedef complex<double> cd
typedef double d
file Tensor_Instantiations.cpp
#include “Core/Tensor_Implementation.h”

Typedefs

typedef complex<double> cd
typedef double doub
typedef double d

Functions

template Tensor<cd> productElementwise(const Tensor < cd > & A, const Tensor < cd > & B)
template Tensor<d> productElementwise(const Tensor < d > & A, const Tensor < d > & B)
template Tensor<cd> matrixTensor< cd, cd >(const Matrix < cd > & A, const Tensor < cd > & B, size_t mode)
template void matrixTensor< cd, cd >(Tensor < cd > & C, const Matrix < cd > & A, const Tensor < cd > & B, size_t mode, bool zero)
template Tensor<cd> tMatrixTensor< cd, cd >(const Matrix < cd > & A, const Tensor < cd > & B, size_t mode)
template Tensor<cd> multStateAB(const Matrix < cd > & A, const Tensor < cd > & B)
template Tensor<cd> multStateArTB< cd, cd >(const Matrix < cd > & A, const Tensor < cd > & B)
template void multStateArTB< cd, cd >(Tensor < cd > & C, const Matrix < cd > & A, const Tensor < cd > & B)
template void gramSchmidt< cd >(Tensor < cd > & A)
template void multStateAB< cd, cd >(Tensor < cd > & C, const Matrix < cd > & A, const Tensor < cd > & B, bool zero)
template Tensor<cd> project< cd >(const Tensor < cd > & A, const Tensor < cd > & B)
template Tensor<cd> projectOut< cd >(const Tensor < cd > & A, const Tensor < cd > & B)
template Tensor<cd> projectOrthogonal< cd >(const Tensor < cd > & A, const Tensor < cd > & B)
template void multAdd< cd, cd >(Tensor < cd > & A, const Tensor < cd > & B, cd coeff)
template Tensor<cd> conj< cd >(Tensor < cd > A)
template double residual(Tensorcd A, const Tensorcd & B)
template Matrix<cd> toMatrix(const Tensor < cd > & A)
template Matrix<cd> moveToMatrix(Tensor < cd > & A)
template Tensor<cd> toTensor(const Matrix < cd > & B)
template Matrix<cd> toMatrix(const Tensor < cd > & A, size_t mode)
template Tensor<cd> toTensor(const Matrix < cd > & B, const TensorShape & shape, size_t mode)
template Tensor<cd> moveToTensor(Matrix < cd > & B)
template void contraction< cd >(Matrix < cd > & S, const Tensor < cd > & A, const Tensor < cd > & B, size_t before, size_t active1, size_t active2, size_t behind)
template void matrixTensor< cd >(Tensor < cd > & C, const Matrix < cd > & A, const Tensor < cd > & B, size_t before, size_t activeC, size_t activeB, size_t after, bool zero)
template Matrix<cd> contraction(const Tensor < cd > & A, const Tensor < cd > & B, size_t k)
template void contraction(Matrix < cd > & S, const Tensor < cd > & A, const Tensor < cd > & B, size_t k, bool zero)
template Tensor<cd> qr(const Tensor < cd > & A)
template Tensor<cd> qr(const Tensor < cd > & A, size_t mode)
template void tensorMatrix(Tensor < cd > & C, const Tensor < cd > & B, const Matrix < cd > & A, size_t mode, bool zero)
template Tensor<cd> tensorMatrix(const Tensor < cd > & B, const Matrix < cd > & A, size_t mode)
template ostream& operator<<< cd >(ostream &, const Tensor < cd > &)
template istream& operator>>< cd >(istream &, Tensor < cd > &)
template bool operator==< cd >(const Tensor < cd > & A, const Tensor < cd > & B)
template Tensor<double> matrixTensor< doub, doub >(const Matrix < double > & A, const Tensor < double > & B, size_t mode)
template void matrixTensor< doub, doub >(Tensor < double > & C, const Matrix < double > & A, const Tensor < double > & B, size_t mode, bool zero)
template void tensorMatrix(Tensor < double > & C, const Tensor < double > & B, const Matrix < double > & A, size_t mode, bool zero)
template Tensor<double> tensorMatrix(const Tensor < double > & B, const Matrix < double > & A, size_t mode)
template Tensor<double> tMatrixTensor< doub, doub >(const Matrix < double > & A, const Tensor < double > & B, size_t mode)
template Tensor<double> multStateAB(const Matrix < double > & A, const Tensor < double > & B)
template Tensor<d> projectOut< d >(const Tensor < d > & A, const Tensor < d > & B)
template Tensor<double> multStateArTB< doub, doub >(const Matrix < double > & A, const Tensor < double > & B)
template void multStateArTB< doub, doub >(Tensor < doub > & C, const Matrix < doub > & A, const Tensor < doub > & B)
template void gramSchmidt< double >(Tensor < double > & A)
template void multStateAB< doub, doub >(Tensor < double > & C, const Matrix < double > & A, const Tensor < double > & B, bool zero)
template void multAdd< doub, doub >(Tensor < double > & A, const Tensor < double > & B, doub coeff)
template Tensor<double> conj< double >(Tensor < double > A)
template double residual(Tensord A, const Tensord & B)
template Matrix<double> toMatrix(const Tensor < double > & A)
template Matrix<d> moveToMatrix(Tensor < d > & A)
template Tensor<double> toTensor(const Matrix < double > & B)
template void contraction< doub >(Matrix < doub > & S, const Tensor < doub > & A, const Tensor < doub > & B, size_t before, size_t active1, size_t active2, size_t behind)
template void matrixTensor< doub >(Tensor < doub > & C, const Matrix < doub > & A, const Tensor < doub > & B, size_t before, size_t activeC, size_t activeB, size_t after, bool zero)
template Matrix<doub> contraction(const Tensor < doub > & A, const Tensor < doub > & B, size_t k)
template void contraction(Matrix < doub > & S, const Tensor < doub > & A, const Tensor < doub > & B, size_t k, bool zero)
template Tensor<doub> qr(const Tensor < doub > & A)
template Tensor<doub> qr(const Tensor < doub > & A, size_t mode)
template ostream& operator<<< doub >(ostream &, const Tensor < doub > &)
template istream& operator>>< doub >(istream &, Tensor < doub > &)
template bool operator==< doub >(const Tensor < doub > & A, const Tensor < doub > & B)
template void multAdd< cd, double >(Tensor < cd > & A, const Tensor < cd > & B, double coeff)

Mixed double/complex<double>

template Tensor<cd> matrixTensor< cd, doub >(const Matrix < doub > & A, const Tensor < cd > & B, size_t mode)
template Tensor<cd> tMatrixTensor< cd, doub >(const Matrix < doub > & A, const Tensor < cd > & B, size_t mode)
template Tensord ones< double >(const TensorShape & shape)
template Tensorcd ones< complex< double > >(const TensorShape & shape)
template Tensord rand< double >(const TensorShape & shape)
template Tensorcd rand< complex< double > >(const TensorShape & shape)
file TensorBLAS.cpp
#include “Core/TensorBLAS.h”#include <cblas.h>#include <numeric>#include “Core/MatrixBLAS.h”

Defines

swap(type, x, y)

Typedefs

typedef complex<double> cd

======================================================================== Template Instantiations

typedef double d

Functions

template<typename T>
void transpose(T *dest, const T *src, size_t dim1, size_t dim2, T beta)
template<typename T, int blocksize>
void transpose2(T *dest, const T *src, size_t lda, size_t ldb)
template<typename T>
void transposeAB(T *dest, const T *src, size_t A, size_t B, size_t C)
template<typename T>
void transposeBC(T *dest, const T *src, size_t A, size_t B, size_t C)
template<typename T, typename U>
void matrixTensor1(Tensor<T> &C, const Matrix<U> &h, const Tensor<T> &B, size_t before, size_t active, size_t activeC, size_t after, bool zero)
template<typename T, typename U>
void matrixTensor2(Tensor<T> &C, const Matrix<U> &h, const Tensor<T> &B, Tensor<T> &D, size_t before, size_t active, size_t activeC, size_t after, bool zero)
template<typename T, typename U>
void matrixTensor3(Tensor<T> &hKet, const Matrix<U> &h, const Tensor<T> &Ket, Tensor<T> &Ket_work, Tensor<T> &hKet_work, size_t A, size_t B, size_t B2, size_t C, bool zero)
template<typename T>
void contraction2(Matrix<T> &h, const Tensor<T> &bra, const Tensor<T> &ket, Tensor<T> &bra_work, Tensor<T> &ket_work, size_t A, size_t B, size_t B2, size_t C, bool zero)
template<typename T, typename U>
void matrixTensorBLAS(Tensor<T> &C, Tensor<T> &workC, const Matrix<U> &A, const Tensor<T> &B, size_t mode, bool zero)

Wrapper for matrix-Tensor product.

==== Wrappers ====

======================================================================== Wrappers for matrixTensor product and contraction

template<typename T, typename U>
void matrixTensorBLAS(Tensor<T> &C, const Matrix<U> &A, const Tensor<T> &B, size_t mode, bool zero)
template<typename T>
void contractionBLAS(Matrix<T> &h, Tensor<T> &workA, Tensor<T> &workB, const Tensor<T> &A, const Tensor<T> &B, size_t mode, bool zero)
template<typename T>
void contractionBLAS(Matrix<T> &h, const Tensor<T> &A, const Tensor<T> &B, size_t mode, bool zero)

Wrapper for matrix-Tensor product.

template<typename T>
Matrix<T> contractionBLAS(const Tensor<T> &A, const Tensor<T> &B, size_t mode, bool zero)
template<typename T, typename U>
Tensor<T> matrixTensorBLAS(const Matrix<U> &A, const Tensor<T> &B, size_t mode, bool zero)
void dgeem(Matrixd &h, const Matrixd &bra, const Matrixd &ket)
template<typename T>
void general_contraction(const Tensor<T> &A, const Tensor<T> &B, Tensor<T> &result, const vector<size_t> &A_indices, const vector<size_t> &B_indices)
template<typename T>
bool is_contraction_legal(const Tensor<T> &TensorA, const Tensor<T> &TensorB, vector<size_t> Acontraction, vector<size_t> Bcontraction)
template<typename T>
void general_transpose_to_order(Tensor<T> &dst, const Tensor<T> &src, const vector<size_t> &form)
template<typename T>
void general_transpose(Tensor<T> &dst, const Tensor<T> &src, size_t index_one, size_t index_two)
template<typename T>
void general_transpose_bd(T *dst, const T *src, size_t a, size_t b, size_t c, size_t d, size_t e)
template<typename T, typename Q>
void general_contraction(const Tensor<T> &A, const Tensor<T> &B, Tensor<T> &result, const std::vector<std::pair<Q, Q>> &contraction_pairs)
template void matrixTensor1(Tensor < cd > & C, const Matrix < cd > & h, const Tensor < cd > & B, size_t before, size_t active, size_t activeC, size_t after, bool zero)
template void matrixTensor2(Tensor < cd > & C, const Matrix < cd > & h, const Tensor < cd > & B, Tensorcd & D, size_t before, size_t active, size_t activeC, size_t after, bool zero)
template void matrixTensor3(Tensor < cd > & hKet, const Matrix < cd > & h, const Tensor < cd > & Ket, Tensor < cd > & Ket_work, Tensor < cd > & hKet_work, size_t A, size_t B, size_t B2, size_t C, bool zero)
template void contraction2(Matrix < cd > & h, const Tensor < cd > & bra, const Tensor < cd > & ket, Tensor < cd > & bra_work, Tensor < cd > & ket_work, size_t A, size_t B, size_t B2, size_t C, bool zero)
template void transpose(double * dest, const double * src, size_t dim1, size_t dim2, double beta)
template void transpose(cd * dest, const cd * src, size_t dim1, size_t dim2, cd beta)
template void transpose2< complex< double >, 4 >(cd * dest, const cd * src, size_t lda, size_t ldb)
template void transposeAB(cd * dest, const cd * src, size_t A, size_t B, size_t C)
template void contraction2(Matrix < d > & h, const Tensor < d > & bra, const Tensor < d > & ket, Tensor < d > & bra_work, Tensor < d > & ket_work, size_t A, size_t B, size_t B2, size_t C, bool zero)
template void general_contraction(const Tensor < cd > & A, const Tensor < cd > & B, Tensor < cd > & result, const vector< size_t > & A_indices, const vector< size_t > & B_indices)
template void general_contraction(const Tensor < d > & A, const Tensor < d > & B, Tensor < d > & result, const vector< size_t > & A_indices, const vector< size_t > & B_indices)
template void general_transpose_bd(cd * dst, const cd * src, size_t a, size_t b, size_t c, size_t d, size_t e)
template void general_transpose_bd(d * dst, const d * src, size_t a, size_t b, size_t c, size_t d, size_t e)
template bool is_contraction_legal(const Tensor < cd > & TensorA, const Tensor < cd > & TensorB, vector< size_t > Acontraction, vector< size_t > Bcontraction)
template bool is_contraction_legal(const Tensor < d > & TensorA, const Tensor < d > & TensorB, vector< size_t > Acontraction, vector< size_t > Bcontraction)
template void general_transpose(Tensor < cd > & dst, const Tensor < cd > & src, size_t index_one, size_t index_two)
template void general_transpose(Tensor < d > & dst, const Tensor < d > & src, size_t index_one, size_t index_two)
template void general_transpose_to_order(Tensor < d > & dst, const Tensor < d > & src, const vector< size_t > & form)
template void general_transpose_to_order(Tensor < cd > & dst, const Tensor < cd > & src, const vector< size_t > & form)
template void general_contraction(const Tensor < cd > & A, const Tensor < cd > & B, Tensor < cd > & result, const std::vector< std::pair< int, int >> & contraction_pairs)
template void general_contraction(const Tensor < cd > & A, const Tensor < cd > & B, Tensor < cd > & result, const std::vector< std::pair< size_t, size_t >> & contraction_pairs)
template void general_contraction(const Tensor < d > & A, const Tensor < d > & B, Tensor < d > & result, const std::vector< std::pair< int, int >> & contraction_pairs)
template void general_contraction(const Tensor < d > & A, const Tensor < d > & B, Tensor < d > & result, const std::vector< std::pair< size_t, size_t >> & contraction_pairs)
template void matrixTensorBLAS(Tensor < cd > & C, Tensor < cd > & workC, const Matrix < cd > & A, const Tensor < cd > & B, size_t mode, bool zero)

==== Wrappers ====

template void matrixTensorBLAS(Tensor < cd > & C, const Matrix < cd > & A, const Tensor < cd > & B, size_t mode, bool zero)
template void contractionBLAS(Matrix < cd > & h, Tensor < cd > & workA, Tensor < cd > & workB, const Tensor < cd > & A, const Tensor < cd > & B, size_t mode, bool zero)
template void contractionBLAS(Matrix < cd > & h, const Tensor < cd > & A, const Tensor < cd > & B, size_t mode, bool zero)
template Tensor<cd> matrixTensorBLAS(const Matrix < cd > & A, const Tensor < cd > & B, size_t mode, bool zero)
template Matrix<cd> contractionBLAS(const Tensor < cd > & A, const Tensor < cd > & B, size_t mode, bool zero)
template void matrixTensorBLAS(Tensor < d > & C, Tensor < d > & workC, const Matrix < d > & A, const Tensor < d > & B, size_t mode, bool zero)
template void matrixTensorBLAS(Tensor < d > & C, const Matrix < d > & A, const Tensor < d > & B, size_t mode, bool zero)
template void contractionBLAS(Matrix < d > & h, Tensor < d > & workA, Tensor < d > & workB, const Tensor < d > & A, const Tensor < d > & B, size_t mode, bool zero)
template void contractionBLAS(Matrix < d > & h, const Tensor < d > & A, const Tensor < d > & B, size_t mode, bool zero)
template Tensor<d> matrixTensorBLAS(const Matrix < d > & A, const Tensor < d > & B, size_t mode, bool zero)
template Matrix<d> contractionBLAS(const Tensor < d > & A, const Tensor < d > & B, size_t mode, bool zero)
file TensorShape.cpp
#include “Core/TensorShape.h”

Functions

size_t ContractDimensionsBefore(const vector<size_t> &dim, size_t k)
vector<size_t> ContractDimensionsBefore(const vector<size_t> &dim)
size_t ContractDimensionsAfter(const vector<size_t> &dim, size_t k)
vector<size_t> ContractDimensionsAfter(const vector<size_t> &dim)
ostream &operator<<(ostream &os, const TensorShape &tdim)
istream &operator>>(istream &is, TensorShape &tdim)
bool operator==(const TensorShape &tdima, const TensorShape &tdimb)
bool operator!=(const TensorShape &tdima, const TensorShape &tdimb)
TensorShape replaceDimension(TensorShape shape, size_t target, size_t new_dimension)
vector<size_t> indexMapping(size_t I, const TensorShape &shape)
size_t indexMapping(const vector<size_t> &idx, const TensorShape &shape)
void indexMapping(vector<size_t> &idxs, size_t I, const TensorShape &shape)
file Vector_Instantiations.cpp
#include “Core/Vector_Implementation.h”

Typedefs

typedef complex<double> cd
typedef double d

Functions

template void normalize(Vectord & a)
template void normalize(Vectorcd & a)
template double residual(const Vectord & A, const Vectord & B)
template double residual(const Vectorcd & A, const Vectorcd & B)
template Vector<cd> reverse(const Vector < cd > & A)
template Vector<d> reverse(const Vector < d > & A)
template cd sum(const Vector < cd > & A)
template d sum(const Vector < d > & A)
template Vector<d> regularize(Vector < d > A, double eps)
template Vector<cd> regularize(Vector < cd > A, double eps)
template Vector<d> inverse(Vector < d > A, d eps)
template Vector<cd> inverse(Vector < cd > A, d eps)
file CDVR.cpp
#include “DVR/CDVR.h”

Functions

void UpdateNodeDVRLocal(Tensorcd &dvr, const TreeGrids &grids, const TreeGrids &holegrids, const PotentialOperator &V, const Node &node, size_t part, bool out = false, ostream &os = cout)
void UpdateNodeDVR(TensorTreecd &dvr, const TreeGrids &grids, const TreeGrids &holegrids, const PotentialOperator &V, const Tree &tree, size_t part, bool out, ostream &os)
void UpdateEdgeDVRLocal(Matrixd &edgedvr, const TreeGrids &grids, const TreeGrids &holegrids, const PotentialOperator &V, const Node &node, size_t part, bool out = false, ostream &os = cout)
void UpdateEdgeDVR(MatrixTreed &cdvr, const TreeGrids &grids, const TreeGrids &holegrids, const PotentialOperator &V, const Tree &tree, size_t part, bool out, ostream &os = cout)
file cdvr_functions.cpp
#include “DVR/cdvr_functions.h”#include “Core/Tensor_Extension.h”#include “Core/TensorBLAS.h”
file DeltaVTree.cpp
#include “DVR/DeltaVTree.h”
file GridRepresentation.cpp
#include “GridRepresentation.h”#include “DVR/MatrixTensorTree.h”
file MatrixTensorTree.cpp
#include “DVR/MatrixTensorTree.h”#include “TreeClasses/SpectralDecompositionTree.h”#include “Core/TensorBLAS.h”

Functions

bool IsWorking_bottomup(const MatrixTensorTree &Psi, const Tree &tree, double eps)
bool IsWorking_topdown(const MatrixTensorTree &Psi, const Tree &tree, double eps)
bool IsWorking(const MatrixTensorTree &Psi, const Tree &tree, double eps)
file MatrixTensorTree.cpp
#include “TreeClasses/MatrixTensorTree.h”#include “TreeClasses/SpectralDecompositionTree.h”

Functions

bool IsWorking_bottomup(const MatrixTensorTree &Psi, const Tree &tree, double eps)
bool IsWorking_topdown(const MatrixTensorTree &Psi, const Tree &tree, double eps)
bool IsWorking(const MatrixTensorTree &Psi, const Tree &tree, double eps)
file MatrixTensorTreeFunctions.cpp
#include “DVR/MatrixTensorTreeFunctions.h”
file MatrixTensorTreeFunctions.cpp
#include “TreeClasses/MatrixTensorTreeFunctions.h”
file SymXMatrixTrees.cpp
#include “DVR/SymXMatrixTrees.h”

Functions

SOPcd symXsop(const Tree &tree)
file TDDVR.cpp
#include <Core/TensorBLAS.h>#include “DVR/TDDVR.h”#include “TreeClasses/MatrixTreeFunctions.h”#include “TreeClasses/SparseMatrixTreeFunctions.h”#include “Util/WeightedSimultaneousDiagonalization.h”#include “TreeClasses/SymMatrixTreeFunctions.h”

Functions

vector<Matrixcd> getXs(const vector<SparseMatrixTreecd> &Xs, const Node &node)
void setGrids(TreeGrids &gridtrees, vector<Vectord> grids, const Node &node)
vector<double> calculateShift(const vector<Matrixcd> &xs, const Matrixcd &w)
void shift(vector<Matrixcd> &xs, const vector<double> &shift)
void shiftBack(vector<Vectord> &xs, const vector<double> &shift)
void LayerGrid(TreeGrids &grids, Matrixcd &trafo, const vector<SparseMatrixTreecd> &Xs, Matrixcd w, const Node &node)
void updateGrids(TreeGrids &grids, MatrixTreecd &trafo, const vector<SparseMatrixTreecd> &Xs, const MatrixTreecd &rho, const Tree &tree)
void layerGrid(TreeGrids &grids, Matrixcd &trafo, vector<Matrixcd> xs, Matrixcd w, const Node &node)
vector<Matrixcd> getX(const SymXMatrixTrees &Xs, const Node &node, bool up)
void updateGrids(SymTreeGrid &sgrids, SymMatrixTree &u, const SymXMatrixTrees &xsym, const SymMatrixTree &rho, const Tree &tree)
file XMatrixTrees.cpp
#include “DVR/XMatrixTrees.h”#include <random>

Functions

Wavefunction Regularize(Wavefunction Psi, const Tree &tree, double eps)
SOPcd Xsop(const Tree &tree)
Matrixcd BuildX(const Tensorcd &Phi, const Matrixcd &rho, const SparseMatrixTreescd &xmats, const Node &node, double eps)
Matrixcd UnProject(size_t n_occupied, const Matrixcd &X, const Tensorcd &Phi)
Tensorcd Occupy(const Tensorcd &Phi, const Matrixcd &trafo, size_t n_occupied, const Node &node)
file BlockTree.cpp
#include “TreeClasses/Discrete/BlockTree.h”#include <numeric>

Functions

size_t min(size_t a, size_t b)
bool hasLabel(const Labels &L, const Label &lab)
ostream &operator<<(ostream &os, const LabelDimension &dim)
Labels combine(const Labels &L, const Labels &R, const Range &range)
Labels label_combinations(const NodeAttribute<Labels> &up, const NodeAttribute<Labels> &down, const Range &range, const Node &node, const Node &hole)
size_t labelDimension(const Label &label, size_t dimension, size_t n_hole)
file SymmetricSCF.cpp
#include “TreeClasses/Discrete/SymmetricSCF.h”

Functions

template<typename T>
ostream &operator<<(ostream &os, const Configuration<T> &c)
template ostream& operator<<(ostream & os, const Configuration < size_t > &)
template<typename T>
ostream &operator<<(ostream &os, const ConfigurationTensor<T> &c)
template ostream& operator<<(ostream & os, const ConfigurationTensor < size_t > & c)
template<typename T>
ostream &operator<<(ostream &os, const ConfigurationTree<T> &a)
template ostream& operator<<(ostream & os, const ConfigurationTree < size_t > & c)
ConfigurationTensor randomConfigurationTensor(const TensorShape &shape, mt19937 &gen)
ConfigurationTree randomConfigurationTree(const Tree &tree, mt19937 &gen)
ConfigurationTensor bottomTensor(const TensorShape &shape)
ConfigurationTensor cartesianProduct(Configuration<> &idx, const ConfigurationTree<> &Psi, const Node &node)
Configuration resort(const Configuration<> &c, const Configuration<> &idx)
vector<size_t> findIndices(const vector<size_t> &idx, const vector<size_t> &all)
ConfigurationTensor sliceDown(const ConfigurationTensor<> &B, const vector<size_t> &idx)
ConfigurationTensor slice(const ConfigurationTensor<> &B, size_t start, size_t n)
ConfigurationTensor select_unique(const ConfigurationTensor<> &A, size_t n)
ConfigurationTensor sortForEnergy(const ConfigurationTensor<> &A, const vector<double> &E)
vector<double> integrateEnergy(const ConfigurationTensor<> &A, const vector<double> &E)
vector<double> evaluateGrid(const ConfigurationTensor<> &A, const Configuration<> &idx, function<double(const Configuration<> &c)> f, pair<Configuration<>, double> &optimal, map<Configuration<>, double> &results, size_t verboseness, )
Configuration optimize(ConfigurationTree<> &Psi, function<double(const Configuration<> &c)> f, const Tree &tree, size_t n_sweep, size_t verboseness, )
size_t to_integer(const Configuration<> &c)
void split_integers(vector<size_t> &vec, vector<size_t> &tmp, const Configuration<> &c, size_t n)
vector<size_t> split_integers(const Configuration<> &c, size_t n)
double to_double(size_t i, size_t max_val)
void split_doubles(vector<double> &xs, vector<size_t> &x_int, vector<size_t> &tmp, const Configuration<> &c, size_t n)
vector<double> split_doubles(const Configuration<> &c, size_t n)
file U1Symmetry.cpp
#include “TreeClasses/Discrete/U1Symmetry.h”#include <list>

Functions

size_t factorial(size_t n)

Rationale: Reading https://math.stackexchange.com/questions/474741/formula-for-combinations-with-replacement helps understanding the thoughts behind partitions & combinatorics in this file.

size_t binomial(size_t k, size_t n)
size_t sumList(const ilist &l)
size_t sumVec(const Labels &l)
void helper(list<ilist> &res, ilist numbers, ilist slate, size_t size, size_t sum)
list<ilist> partitions(ilist numbers, size_t size, size_t sum)
void helper(vector<Labels> &res, const vector<Labels> &numbers, size_t depth, Labels slate, size_t size, size_t sum)
vector<Labels> partitions(const vector<Labels> numbers, size_t sum)
vector<Labels> partitions(const vector<const Labels *> numbers, size_t sum)
ostream &operator<<(ostream &os, const ivec &X)
void combinatoricalMap(ivec &idx, size_t I, size_t &now, size_t k, size_t N)
void combinatoricalMap(ivec &idx, size_t I, size_t k, size_t N)
void combinatoricalMap(size_t &I, const ivec &idx, size_t &now, size_t k, size_t N)
void combinatoricalMap(size_t &I, const ivec &idx, size_t k, size_t N)
ivec nChooseKrandom(size_t k, size_t n, mt19937 &gen)
void combinationToPartition(ivec &p)

Helper-function that does: 0111011 -> 032 (interfaced for unit test)

void partitionMap(ivec &idx, size_t &I, size_t sum, size_t nSummands)

returns the Ith partitions for ‘nSummands’ summands that sum up to ‘sum’.

size_t nPartitions(size_t sum, size_t nSummands)
file EntropyTree.cpp
#include “TreeClasses/EntropyTree.h”#include “TreeClasses/TensorTreeFunctions.h”#include “TreeClasses/SpectralDecompositionTree.h”
file HamiltonianRepresentation.cpp
#include “TreeClasses/HamiltonianRepresentation.h”

Functions

Tensorcd Apply(const Hamiltonian &H, const Tensorcd &Phi, const HamiltonianRepresentation &hRep, const Node &node)
Matrixcd Expectation(const HamiltonianRepresentation &hRep, const Wavefunction &Psi, const Hamiltonian &H, const Tree &tree)
void LayerDerivative(Tensorcd &dPhi, double time, const Tensorcd &Phi, const Hamiltonian &H, const HamiltonianRepresentation &hRep, const Node &node, complex<double> propagation_phase)
void Derivative(Wavefunction &dPsi, HamiltonianRepresentation &hRep, double time, const Wavefunction &Psi, const Hamiltonian &H, const Tree &tree, complex<double> propagation_phase)
void symLayerDerivative(Tensorcd &dPhi, double time, const Tensorcd &Phi, const Hamiltonian &H, const HamiltonianRepresentation &hRep, const Node &node, complex<double> propagation_phase)
void symDerivative(MatrixTensorTree &dPsi, HamiltonianRepresentation &hRep, double time, const MatrixTensorTree &Psi, const Hamiltonian &H, const Tree &tree, complex<double> propagation_phase)
void output(const HamiltonianRepresentation &hrep, const Wavefunction &Psi, const Hamiltonian &H, const Tree &tree)
size_t nActives(const SparseMatrixTreecd &hmat, const MLOcd &M, const SparseMatrixTreecd &hcon, const Node &node)
file LayerInterface.cpp
#include “TreeClasses/LayerInterface.h”
file MatrixTree.cpp
#include “TreeClasses/MatrixTree.h”

Functions

template<typename T>
ostream &operator<<(ostream &os, const MatrixTree<T> &S)
template<typename T>
istream &operator>>(istream &is, MatrixTree<T> &S)
file MatrixTreeFunctions.cpp
#include “TreeClasses/MatrixTreeFunctions_Implementation.h”#include “TreeClasses/TreeTransformation_Implementation.h”
file SparseMatrixTree.cpp
#include “TreeClasses/SparseMatrixTree.h”

Functions

template<typename T>
ostream &operator>>(ostream &os, const SparseMatrixTree<T> &hmat)
template<typename T>
istream &operator<<(istream &is, SparseMatrixTree<T> &hmat)
file SparseMatrixTreeFunctions.cpp
#include “TreeClasses/SparseMatrixTreeFunctions_Implementation.h”
file SparseTensorTree.cpp
#include “TreeClasses/SparseTensorTree.h”
file SparseTree.cpp
#include “TreeClasses/SparseTree.h”
file SpectralDecompositionTree.cpp
#include “TreeClasses/SpectralDecompositionTree.h”

Functions

template<typename T>
MatrixTree<T> toMatrixtree(const SpectralDecompositionTree<T> &X, const Tree &tree)
template<typename T>
void canonicalTransformation(TensorTree<T> &Psi, const Tree &tree, bool orthogonal)
template<typename T>
SpectralDecompositionTree<T> sqrt(SpectralDecompositionTree<T> X)
template<typename T>
MatrixTree<T> sqrt(MatrixTree<T> X, const Tree &tree)
template<typename T>
SpectralDecompositionTree<T> inverse(SpectralDecompositionTree<T> X, double eps)
template<typename T>
MatrixTree<T> inverse(MatrixTree<T> X, const Tree &tree, double eps)
template SpectralDecompositionTreecd sqrt(SpectralDecompositionTreecd X)
template SpectralDecompositionTreed sqrt(SpectralDecompositionTreed X)
template MatrixTreecd sqrt(MatrixTreecd X, const Tree & tree)
template MatrixTreed sqrt(MatrixTreed X, const Tree & tree)
template SpectralDecompositionTreecd inverse(SpectralDecompositionTreecd X, double eps)
template SpectralDecompositionTreed inverse(SpectralDecompositionTreed X, double eps)
template MatrixTreecd inverse(MatrixTreecd X, const Tree & tree, double eps)
template MatrixTreed inverse(MatrixTreed X, const Tree & tree, double eps)
template MatrixTreecd toMatrixtree(const SpectralDecompositionTreecd & X, const Tree & tree)
template MatrixTreed toMatrixtree(const SpectralDecompositionTreed & X, const Tree & tree)
template void canonicalTransformation(TensorTreecd & Psi, const Tree & tree, bool orthogonal)
template void canonicalTransformation(TensorTreed & Psi, const Tree & tree, bool orthogonal)
file SymTensorTree.cpp
#include “TreeClasses/SymTensorTree.h”#include “TreeClasses/SpectralDecompositionTree.h”#include “Core/Tensor_Extension.h”

Functions

void occupy(Tensorcd &A, mt19937 &gen, const Tree &tree, bool delta_lowest)
double epsUpNormalization(const SymTensorTree &Psi, const Tree &tree)
double epsDownNormalization(const SymTensorTree &Psi, const Tree &tree)
bool isWorking(const SymTensorTree &Psi, const Tree &tree)
file TensorTree_Instantiation.cpp
#include “TreeClasses/TensorTree.h”#include “TreeClasses/TensorTree_Implementation.h”#include “TreeClasses/TensorTreeFunctions_Implementation.h”

Typedefs

typedef complex<double> cd
typedef double d

Functions

template ostream& operator<<< cd >(ostream &, const TensorTree < cd > &)
template istream& operator>>< cd >(istream &, TensorTree < cd > &)
template TensorTree<cd> operator*(cd c, TensorTree < cd > R)
template TensorTree<cd> operator/(cd c, TensorTree < cd > R)
template ostream& operator<<< d >(ostream &, const TensorTree < d > &)
template istream& operator>>< d >(istream &, TensorTree < d > &)
template TensorTree<d> operator*(d c, TensorTree < d > R)
template TensorTree<d> operator/(d c, TensorTree < d > R)
template void orthogonal< cd >(TensorTree < cd > & Psi, const Tree & tree)
template void orthogonal< d >(TensorTree < d > & Psi, const Tree & tree)
template void qrOrthogonal< cd >(TensorTree < cd > & Psi, const Tree & tree)
template void orthonormal< cd >(TensorTree < cd > & Psi, const Tree & tree)
template void orthonormal< d >(TensorTree < d > & Psi, const Tree & tree)
file TreeIO.cpp
#include “TreeClasses/TreeIO.h”#include “TreeClasses/SpectralDecompositionTree.h”

Typedefs

typedef complex<double> cd
typedef double d
file TreeTransformations.cpp
#include “TreeClasses/TreeTransformation_Implementation.h”

Typedefs

typedef complex<double> cd
typedef double d
file FortranOperator.cpp
#include “TreeOperators/FortranOperator.h”
file FortranSOP.cpp
#include “TreeOperators/FortranSOP.h”#include “Core/Matrix.h”

Functions

void DDXCPP(int *mode, double hPsi[], double Psi[], int *dim, double matrix[], double trafo[])
void KINCPP(int *mode, double hPsi[], double Psi[], int *dim, double matrix[], double trafo[])
void fillpara_(int *f, double *para)
void ApplyFortranDDX(complex<double> hPsi[], complex<double> Psi[], const LeafInterface &grid, int dim)
void ApplyFortranKIN(complex<double> hPsi[], complex<double> Psi[], const LeafInterface &grid, int dim)
file LeafFunction.cpp
#include “TreeOperators/LeafFunction.h”
file LeafMatrix.cpp
#include “TreeOperators/LeafMatrix.h”

Functions

Matrixcd toMatrix(const LeafOperatorcd &h, const Leaf &leaf)
Matrixd toMatrix(const LeafOperator<double> &h, const Leaf &leaf)
file MultiLeafOperator.cpp
#include “TreeOperators/MultiLeafOperator.h”

Typedefs

typedef complex<double> cd

Functions

template<typename T>
MultiLeafOperator<T> operator*(const MultiLeafOperator<T> &A, const MultiLeafOperator<T> &B)
template MultiLeafOperator<cd> operator*(const MultiLeafOperator < cd > & A, const MultiLeafOperator < cd > & B)
file SumOfProductsOperator.cpp
#include “TreeOperators/SumOfProductsOperator_Implementation.h”#include “TreeOperators/SOPVector.h”

Typedefs

typedef complex<double> cd
typedef double d

double

Functions

template SumOfProductsOperator<cd> operator*<cd >(cd c, const SOP < cd > & A)
template SumOfProductsOperator<cd> operator*(const SOP < cd > & A, complex< double > c)
template SumOfProductsOperator<cd> operator*(const MLO < cd > & M, const SOP < cd > & A)
template SumOfProductsOperator<cd> operator*(const SOP < cd > & A, const MLO < cd > & M)
template SumOfProductsOperator<cd> operator*(const SOP < cd > & A, const SOP < cd > & B)
template SumOfProductsOperator<cd> operator+(const SOP < cd > & A, const SOP < cd > & B)
template SumOfProductsOperator<d> operator*<d >(d c, const SOP < d > & A)
template SumOfProductsOperator<d> operator*(const SOP < d > & A, double c)
template SumOfProductsOperator<d> operator*(const MLO < d > & M, const SOP < d > & A)
template SumOfProductsOperator<d> operator*(const SOP < d > & A, const MLO < d > & M)
template SumOfProductsOperator<d> operator*(const SOP < d > & A, const SOP < d > & B)
template SumOfProductsOperator<d> operator+(const SOP < d > & A, const SOP < d > & B)
file contractCircuit.cpp
#include “TreeOperators/TensorOperators/contractCircuit.h”#include “TreeClasses/MatrixTensorTreeFunctions.h”

Typedefs

typedef complex<double> cd
typedef double d

Functions

template<typename T>
Tensor<T> apply(Tensor<T> A, const MatrixTree<T> &rep, const MatrixTree<T> &hole, const Node &node)
template<typename T>
double iterateCircuit(TensorTreeOperator<T> &A, const TensorTreeOperator<T> &U, const SOP<T> &S, const Tree &optree)
template<typename T>
double error_circuit(const TensorTreeOperator<T> &A, const SOP<T> &S, const TensorTreeOperator<T> &U, const Tree &optree)
template<typename T>
TensorTreeOperator<T> contractCircuit(const SOP<T> &S, const TensorTreeOperator<T> &U, size_t maxIter, const Tree &optree, ostream *os)

Calculate product of SOP operator with TTNO, i.e. A = S * U.

Return

contracted TTNO A

Template Parameters
  • T: base-type

Parameters
  • S: Sum-of-product operator that is applied

  • U: contrcted Operator

  • maxIter: code will leave after max-Iterations if not converged

  • optree: operator tree

  • os: out-stream for output during optimization (optional)

template<typename T>
TensorTreeOperator<T> contractCircuit(const SOPVector<T> &S, size_t maxIter, const Tree &optree, ostream *os)
template double error_circuit(const TensorTreeOperator < d > & A, const SOP < d > & S, const TensorTreeOperator < d > & U, const Tree & optree)
template double error_circuit(const TensorTreeOperator < cd > & A, const SOP < cd > & S, const TensorTreeOperator < cd > & U, const Tree & optree)
template double iterateCircuit(TensorTreeOperator < d > & A, const TensorTreeOperator < d > & U, const SOP < d > & S, const Tree & optree)
template double iterateCircuit(TensorTreeOperator < cd > & A, const TensorTreeOperator < cd > & U, const SOP < cd > & S, const Tree & optree)
template TensorTreeOperator<d> contractCircuit(const SOP < d > & S, const TensorTreeOperator < d > & U, size_t maxIter, const Tree & optree, ostream * os)
template TensorTreeOperator<cd> contractCircuit(const SOP < cd > & S, const TensorTreeOperator < cd > & U, size_t maxIter, const Tree & optree, ostream * os)
template TensorTreeOperator<d> contractCircuit(const SOPVector < d > & S, size_t maxIter, const Tree & optree, ostream * os)
template TensorTreeOperator<cd> contractCircuit(const SOPVector < cd > & S, size_t maxIter, const Tree & optree, ostream * os)
file contractSOP.cpp
#include “TreeOperators/TensorOperators/contractSOP.h”#include “TreeClasses/TensorTreeFunctions.h”

Typedefs

typedef double d
typedef complex<double> cd

Functions

template<typename T>
void contractSOP(TensorTreeOperator<T> &A, const SOP<T> &S, size_t maxIter, const Tree &optree, ostream *os)
template<typename T>
Tensor<T> applyLayer(const TTOMatrixTree<T> &rep, const TTOHoleTree<T> &hole, const SOP<T> &S, const Node &node)
template<typename T>
void iterate(TensorTreeOperator<T> &A, TTOMatrixTree<T> &rep, TTOHoleTree<T> &hole, const SOP<T> &S, const Tree &optree)
template<typename T>
Tensor<T> buildOperator(const MLO<T> &M, const Leaf &leaf, bool adjoint)
template<typename T>
T prodnorm(const MLO<T> &Ml, const MLO<T> &Mm, const Tree &tree)
template<typename T>
double norm(const SOP<T> &S, const Tree &tree)
template<typename T>
double error(const TensorTreeOperator<T> &A, const SOP<T> &S, const Tree &optree, ostream *os)
template void contractSOP(TensorTreeOperator < d > & A, const SOP < d > & S, size_t maxIter, const Tree & optree, ostream * os)
template void contractSOP< cd >(TensorTreeOperator < cd > & A, const SOP < cd > & S, size_t maxIter, const Tree & optree, ostream * os)
template double error(const TensorTreeOperator < d > & A, const SOP < d > & S, const Tree & optree, ostream * os)
template double error(const TensorTreeOperator < cd > & A, const SOP < cd > & S, const Tree & optree, ostream * os)
file TensorTreeOperator.cpp
#include “TreeOperators/TensorOperators/TensorTreeOperator.h”

Typedefs

typedef double d
typedef complex<double> cd

Functions

template<typename T>
Matrix<T> toMatrix(const MLO<T> &M, const Leaf &leaf)
template<typename T>
void toTensor(Tensor<T> &A, const Matrix<T> &M, size_t part, const Leaf &leaf)
template<typename T>
void toTensor(Tensor<T> &A, const MLO<T> &M, size_t part, const Leaf &leaf)
template<typename T>
Matrix<T> toMatrix(const Tensor<T> &B, size_t l, const Leaf &leaf)
template<typename T>
TensorTreeOperator<T> product(const MLO<T> &M, TensorTreeOperator<T> A, const Tree &tree)
template void toTensor(Tensor < d > & A, const MLO < d > & M, size_t part, const Leaf & leaf)
template void toTensor(Tensord & A, const Matrixd & M, size_t part, const Leaf & leaf)
template Matrixd toMatrix(const MLOd & M, const Leaf & leaf)
template Matrixd toMatrix(const Tensord & B, size_t l, const Leaf & leaf)
template TensorTreeOperator<d> product(const MLO < d > & M, TensorTreeOperator < d > A, const Tree & tree)
template void toTensor(Tensorcd & A, const MLOcd & M, size_t part, const Leaf & leaf)
template void toTensor(Tensorcd & A, const Matrixcd & M, size_t part, const Leaf & leaf)
template Matrixcd toMatrix(const MLOcd & M, const Leaf & leaf)
template Matrixcd toMatrix(const Tensorcd & B, size_t l, const Leaf & leaf)
template TensorTreeOperator<cd> product(const MLO < cd > & M, TensorTreeOperator < cd > A, const Tree & tree)
file TTNO_instantiations.cpp
#include “TreeOperators/TensorOperators/TensorTreeOperator.h”#include “TreeOperators/TensorOperators/TTOHoleTree.h”#include “TreeOperators/TensorOperators/TTOMatrixTree.h”#include “TreeOperators/TensorOperators/TTOcontraction_Implementation.h”#include “TreeOperators/TensorOperators/TTOrepresentation.h”#include “TreeOperators/TensorOperators/contractSOP.h”

Typedefs

typedef double d
typedef complex<double> cd

Functions

template Tensor<d> apply(const Tensor < d > & Phi, const TensorTreeOperator < d > & H, const TTOrepresentation < d > & rep, const TTOcontraction < d > & con, const Node & node)
template Tensor<cd> apply(const Tensor < cd > & Phi, const TensorTreeOperator < cd > & H, const TTOrepresentation < cd > & rep, const TTOcontraction < cd > & con, const Node & node)
file TTOMatrixTree.cpp
#include “TreeOperators/TensorOperators/TTOMatrixTree.h”

Typedefs

typedef double d
typedef complex<double> cd

Functions

template<typename T>
Tensor<T> toTensor(const SOP<T> &S, const Leaf &leaf)
template<typename T>
T prodMk(const vector<size_t> &idx, const vector<Matrix<T>> &Mk, size_t l, int skip)
template Tensor<cd> toTensor(const SOP < cd > & S, const Leaf & leaf)
template Tensor<d> toTensor(const SOP < d > & S, const Leaf & leaf)
template d prodMk(const vector< size_t > & idx, const vector< Matrix < d >> & Mk, size_t l, int skip = -1)
template cd prodMk(const vector< size_t > & idx, const vector< Matrix < cd >> & Mk, size_t l, int skip = -1)
file TTOrepresentation.cpp
#include “TreeOperators/TensorOperators/TTOrepresentation.h”
file MatrixListTree.cpp
#include “TreeOperators/TreeStructured/MatrixListTree.h”
file TreeSOP.cpp
#include “TreeOperators/TreeStructured/TreeSOP.h”

Functions

void print(const NodeProductOperator &mpo, complex<double> coeff, const vector<string> &names, size_t indent)
void print(const NodeSOP &sop, const vector<string> &names, size_t indent)
void print(const NodeSOPlist &sopl, const vector<string> &names, size_t indent)
bool IsActive(const NodeOperator &h, const NodeProductOperator &M)
file Leaf.cpp
#include “TreeShape/Leaf.h”#include “TreeShape/LeafTypes/DVRBasis.h”#include “TreeShape/LeafTypes/HO_Basis.h”#include “TreeShape/LeafTypes/FFTGrid.h”#include “TreeShape/LeafTypes/LegendrePolynomials.h”#include “TreeShape/LeafTypes/SpinGroup.h”
file DVRBasis.cpp
#include “TreeShape/LeafTypes/DVRBasis.h”
file FFTGrid.cpp
#include “TreeShape/LeafTypes/FFTGrid.h”#include “Util/FFT.h”#include “Util/QMConstants.h”
file HO_Basis.cpp
#include “TreeShape/LeafTypes/HO_Basis.h”
file LegendrePolynomials.cpp
#include “TreeShape/LeafTypes/LegendrePolynomials.h”
file SpinGroup.cpp
#include “TreeShape/LeafTypes/SpinGroup.h”#include <chrono>
file LinearizedLeaves.cpp
#include “TreeShape/LinearizedLeaves.h”
file Node.cpp
#include “TreeShape/Node.h”
file NodePosition.cpp
#include “TreeShape/NodePosition.h”

Functions

NodePosition operator*(NodePosition p, size_t k)
NodePosition operator*(NodePosition p, NodePosition q)
file Tree.cpp
#include “TreeShape/Tree.h”

Functions

ostream &operator<<(ostream &os, Tree &basis)
istream &operator<<(istream &is, Tree &basis)
ostream &operator<<(ostream &os, const Tree &basis)
istream &operator>>(istream &is, Tree &basis)
file TreeFactory.cpp
#include “TreeShape/TreeFactory.h”
file FFT.cpp
#include “Util/FFT.h”
file GateOperators.cpp
#include “Util/GateOperators.h”#include “Util/QMConstants.h”

Functions

Matrixcd sigma_x()

Rationale:

  • Small library for Quantum Circuits

  • Only contains functions that are needed for unit testing

Matrixcd sigma_y()
Matrixcd sigma_z()
Matrixcd hadamard()
Matrixcd element(size_t i, size_t j, size_t dim)
Matrixcd project(size_t i, size_t dim)
SOPcd controlled(const SOPcd &in, size_t control)

Turn an operation into a controlled operation.

SOPcd controlled(const MLOcd &M, size_t c)
SOPcd controlled(const Matrixcd &L, size_t c, size_t t)
SOPcd CNot(size_t c, size_t t)
SOPcd CZ(size_t c, size_t t)

CNot Chain.

Matrixcd rk(size_t k, bool adj)

Define complex rotation operator, denoted by Rk, where k indicates angle=1/(2^k)

SOPcd Uk(size_t c, size_t t, size_t k, bool adj)
SOPVectorcd QFT(size_t mode_start, size_t n_bit, bool adjungate, size_t approx)
file normal_modes.cpp
#include “Util/normal_modes.h”#include “TreeOperators/CoordinateTransformation.h”

Functions

double Vmassweighted(Vectord q, const Potential &V, const Matrixd &U)
Vectord grad(const Vectord &x, const Potential &V, const Vectord &h, const Matrixd &U)

in cartesian coordinates

Vectord grad(const Vectord &x, const PotentialOperator &V, double delta)

in internal coordinates

Vectord getq0(const Tree &tree)
Matrixd hessian(const Vectord &X, const Potential &V, const Vectord &h, const Matrixd &U)
void normalModeOutput(const Matrixd &Hessian, const Vectord &m, const Vectord &X0)
void find_minimum(const Hamiltonian &H, const Tree &tree)
file Overlaps.cpp
#include “Util/Overlaps.h”#include “TreeClasses/MatrixTreeFunctions.h”#include <iomanip>

Functions

vector<TensorTreecd> readTensorTrees(const string &file1)
void adjustNOCl(vector<TensorTreecd> &Psi, const Tree &tree)
void wavefunctionOverlap(const string &file1, const string &file2, const Tree &tree, OverlapType type)
void wavefunctionOverlap(const vector<TensorTreecd> &Psi, const vector<TensorTreecd> &Chi, const Tree &tree, OverlapType type)
file RandomMatrices.cpp
#include “Util/RandomMatrices.h”
file SimultaneousDiagonalization.cpp
#include “Util/SimultaneousDiagonalization.h”
file string_ext.cpp
#include “Util/string_ext.h”#include <algorithm>
file WeightedSimultaneousDiagonalization.cpp
#include “Util/WeightedSimultaneousDiagonalization.h”
group Integrator

This module holds all classes related to mctdh-Integrators.

group Core

This group includes the basic datastructures in QuTree.

These datastructures include the Vector, Matrix, and Tensor classes.

Typedefs

typedef Matrix<complex<double>> Matrixcd

General typedef for complex matrices.

typedef Matrix<double> Matrixd

General typedef for real matrices.

using SpectralDecomposition = pair<Matrix<T>, Vectord>

General typedef for Matrix<T>, Vectord pairs.

typedef SpectralDecomposition<complex<double>> SpectralDecompositioncd

Specialization of SpectralDecomposition of Matrixcd.

typedef SpectralDecomposition<double> SpectralDecompositiond

Specialization of SpectralDecomposition of Matrixd.

group QuTree

QuTree is a C++ Tensor and Tensor Tree library.

This library has classes that are similar to libraries like Lapack, Eigen, Armadillo, etc., but its focus is concentrated on handling high-order Tensors and Tensor Trees.

group Tree

Group for classes related to tree handling.

This group contains all functionality pertaining to Trees.

Classes in this group use a TTBasis to generate new classes that use and work with the tree structure provided by TTBasis. The classes in this group should either inherit from TreeStructureObject (for classes that have some object at EVERY node in a tree) or SparseTreeStructuredObject (for classes that have some object at a SUBSET of all nodes in the tree).

group Operators

This group is a bundle of classes that handle operators. System specific operators are NOT included here.

This group contains general operator classes that are required to evaluate working equations for tensor tree approaches.

group TTNO

This class is a tree tensor network operator (TTNO)

group TTBasis

This group contains classes to construct and handle a tensor tree basis.

group Util

This group includes common utilites in QuTree.

dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/include/Applications
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/src/Applications
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/include/Core
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/src/Core
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/src/TreeClasses/Discrete
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/include/TreeClasses/Discrete
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/include/DVR
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/src/DVR
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/include
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/include/TreeShape/LeafTypes
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/src/TreeShape/LeafTypes
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/src
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/include/TreeOperators/TensorOperators
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/src/TreeOperators/TensorOperators
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/src/TreeClasses
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/include/TreeClasses
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/src/TreeOperators
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/include/TreeOperators
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/src/TreeShape
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/include/TreeShape
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/src/TreeOperators/TreeStructured
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/include/TreeOperators/TreeStructured
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/src/Util
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/latest/include/Util