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 *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
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 CoordinateTransformation

Public Functions

CoordinateTransformation()
~CoordinateTransformation()
virtual Vectord transform(const Vectord &x) const
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 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_
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()
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 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.

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

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> transpose() const

Return

Transposed matrix

Matrix<complex<double>> 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(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 Functions

double conjugate(const double d) const
complex<double> conjugate(const complex<double> c) const

Protected Attributes

T *coeffs_
size_t dim1_
size_t dim2_
class MatrixListTree : public NodeAttribute<MatrixList>, public NodeAttribute<MatrixList>

Public Functions

MatrixListTree()

A tree graph of MatrixLists.

Default constructor

~MatrixListTree()

Default Destructor.

MatrixListTree(const Tree &tree)

Constructor that initializes the mlHMatrices.

void initialize(const Tree &tree)

Initialize the mlHMatrices.

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

Print the ml-H-matrices.

MatrixListTree()

This class manages multilayer H-matrices of multilayer SOP operators.

Default constructor

~MatrixListTree()

Default Destructor.

MatrixListTree(const TreeSOP &op, const Tree &tree)

Constructor that initializes the mlHMatrices.

void initialize(const TreeSOP &op, const Tree &tree)

Initialize the mlHMatrices.

void calculate(const TensorTreecd &Psi, const TreeSOP &op, const Tree &tree)

Calculating mlHMatrices for a given wavefunction and a mNodeSOP operator.

Tensorcd apply(const Tensorcd &Phi, const NodeSOP &S, const TreeSOP &H, const Node &node) const

Apply a NodeSOP operator.

Tensorcd applyHole(const Tensorcd &Phi, const NodeSOP &S, const Node &node, const NodeOperator &hole_S) const

Hole-Apply a NodeSOP operator.

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

Print the ml-H-matrices.

Private Functions

MatrixList calculate(const Tensorcd &Phi, const TreeSOP &H, const Node &node)

Calculating mlHMatrices for a TreeSOP.

Matrixcd calculate(const Tensorcd &Phi, const NodeSOP &S, const TreeSOP &H, const Node &node)

Calculating mlHMatrices for a NodeSOP.

Tensorcd applyNodeProductOperator(const Tensorcd &Phi, const NodeProductOperator &M, const TreeSOP &H, const Node &node) const

Apply a lMPO.

Tensorcd applyNodeProductOperatorUpper(Tensorcd Phi, const NodeProductOperator &M, const Node &node) const

Apply a lMPO at an upper layer.

Tensorcd applyNodeProductOperatorBottom(Tensorcd Phi, const NodeProductOperator &M, const LeafOperatorLib &lib, const Node &node) const

Apply a lMPO at the bottomlayer.

Tensorcd applyHole(Tensorcd MPhi, const NodeProductOperator &M, const Node &node, const NodeOperator &hole_S) const

Hole-Apply a lMPO.

class MatrixTensorTree : public pair<TensorTreecd, MatrixTreecd>

Public Functions

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 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 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<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.

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 SymTensorTree

Public Functions

SymTensorTree()
SymTensorTree(const Tree &tree)
SymTensorTree(mt19937 &gen, const Tree &tree, bool delta_lowest)
SymTensorTree(mt19937 &gen, const TensorTreecd &Psi, const SparseTree &stree, const Tree &tree, bool delta_lowest)
SymTensorTree(const TensorTreecd &Psi, const Tree &tree)
~SymTensorTree()
void initializeFromTT(const TensorTreecd &Psi, const Tree &tree)
TensorTreecd bottomUpNormalized(const Tree &tree) const
void canonicalRepresentation(const Tree &tree)
void normalizeCanonical(const Node &node)
void normalizeCanonical(const Tree &tree)
void print(const Tree &tree)

Public Members

TensorTreecd weighted_
TensorTreecd up_
TensorTreecd down_
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_
class TensorOperatorTree : public TensorTree<complex<double>>

Public Functions

TensorOperatorTree()
TensorOperatorTree(const Tree &tree)
TensorOperatorTree(const MLOcd &M, const Tree &tree)
TensorOperatorTree(const SOPcd &S, const Tree &tree)
~TensorOperatorTree()
void occupy(const Tree &tree)
void print(const Tree &tree) const
void setLeafOperator(const Matrixcd &M, size_t operator_idx, const Node &node)
void setLeafOperator(const LeafMatrixcd &M, size_t operator_idx, const Node &node)
template<typename T>
class TensorTree
#include <TensorTree.h>

This class represents tensor trees.

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

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

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 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 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_
namespace JacobiRotationFramework

This namespace contains functions for Jacobi rotations algorithms.

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 Random

Functions

template<typename T, class LinearOperator>
Matrix<T> randomQ(const LinearOperator &A, size_t k_plus_p, mt19937 &gen)
template<typename T, class LinearOperator>
SpectralDecomposition<T> diagonalizeRandom(const LinearOperator &A, size_t rank, size_t pow, mt19937 &gen)
template<typename T>
Matrix<T> randomGauss(size_t dim1, size_t dim2, mt19937 &gen)
template<typename T>
Matrix<T> gue(size_t dim, mt19937 &gen)
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

Functions

template<class Interface, class Model, typename T>
void step(T &t, Model &y, T h, Interface &I)
template<class Interface, class Model, typename T>
void integrate(double t, double t_end, double h, Model &y, Interface &I)
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 Tensor_Extension

Functions

tuple<Tensorcd, Matrixcd, Vectord> SVD(const Tensorcd &A)
tuple<Matrixcd, Matrixcd, Vectord> SVD(const Matrixcd &A)
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

Tree balancedTree(size_t num_leaves, size_t dim_leaves = 2, size_t dim_nodes = 2)
Tree unbalancedTree(size_t nLeaves, size_t dimLeaves, size_t dimNodes, size_t leafType)
Tree operatorTree(const Tree &tree)
Node InitTrain(const Node &bottom, size_t dimNodes)
Node TrainLayer(const Node &old_train, const Node &bottom, size_t dimNodes)
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)
Tree expandNodes(Tree tree)
namespace TreeFunctions

Typedefs

typedef complex<double> cd
typedef double d

Functions

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)
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>
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)

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)
template<typename T>
void represent(SparseMatrixTree<T> &hmat, const MLO<T> &M, const TensorTree<T> &Bra, const TensorTree<T> &Ket, const Tree &tree)
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)
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)
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>
SparseMatrixTree<T> contraction(const TensorTree<T> &Psi, const SparseMatrixTree<T> &mats, const Tree &tree)

Build SparseMatrixTree Top-child (Backward)

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 SparseMatrixTree to tensor tree

apply factor matrices locally

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>
Matrix<T> RepresentBottom(const Tensor<T> &Bra, const Tensor<T> &Ket, const MLO<T> &M, const Node &node, const Leaf &leaf)
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 symContractionLocal(SparseMatrixTreecd &hole, const Tensorcd &Bra, const Tensorcd &Ket, const SparseMatrixTreecd &mat, const Node &hchild)
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)
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)
MatrixTreecd symDotProduct(const SymTensorTree &Bra, const SymTensorTree &Ket, const Tree &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)
void directSum(TensorOperatorTree &H, Tree &tree, const TensorOperatorTree &G)
MatrixListTree represent(const TensorTreecd &Psi, const TensorOperatorTree &H, const Tree &tree)
MatrixListTree contraction(const TensorTreecd &Psi, const TensorOperatorTree &H, MatrixListTree &Hrep, const Tree &tree)
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 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 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)
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)
template SparseMatrixTrees<cd> TreeFunctions::represent(const SOP < cd > & sop, const TensorTree < cd > & Bra, const TensorTree < cd > & Ket, shared_ptr< SparseTree > & stree, const Tree & tree)
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 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)
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)
template SparseMatrixTrees<d> TreeFunctions::represent(const SOP < d > & sop, const TensorTree < d > & Bra, const TensorTree < d > & Ket, shared_ptr< SparseTree > & stree, const Tree & tree)
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 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)
Tensorcd symApplyDownNew(const Tensorcd &Phi, const SparseMatrixTreecd &hHole, const Node &node)

apply Operators

void symApply(Tensorcd &HPhi, const Tensorcd &Phi, const SymMatrixTrees &hmats, const SOPcd &H, const Node &node)
void symContraction(MatrixTreecd &rho, const SymTensorTree &Bra, const SymTensorTree &Ket, const MatrixTreecd &S, const Tree &tree)
Matrixcd DotProduct(const Tensorcd &Bra, Tensorcd Ket, const MatrixTreecd &s_up, const MatrixTreecd &s_down, const Node &node)
MatrixTreecd DotProduct(const TensorTreecd &wBra, const TensorTreecd &wKet, const MatrixTreecd &s_up, const MatrixTreecd &s_down, const Tree &tree)
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)
Matrixcd subMatrix(const Tensorcd &B, size_t idx)
MatrixList RepresentLower(const Tensorcd &Phi, const Tensorcd &B, const MatrixListTree &H, const Node &node)
MatrixList RepresentUpper(const Tensorcd &Phi, const Tensorcd &B, const MatrixListTree &H, const Node &node)
MatrixList Represent(const Tensorcd &Phi, const Tensorcd &B, const MatrixListTree &H, const Node &node)
MatrixList ContractionUpper(const Tensorcd &Phi, const Tensorcd &B, const MatrixListTree &Hrep, const MatrixListTree &Hmean, const Node &child)
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 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 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

SVDcd svd(const Matrixcd &A)
Matrixcd toMatrix(const SVDcd &svd)
SVDd svd(const Matrixd &A)
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

SVDcd svd(const Matrixcd &A)
SVDd svd(const Matrixd &A)
Matrixcd toMatrix(const SVDcd &svd)
template<typename T>
Matrix<T> subMatrix(const Matrix<T> A, size_t dim1, size_t dim2)
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)
file Tensor.h
#include “TensorShape.h”#include “Core/Matrix.h”

Typedefs

typedef Tensor<complex<double>> Tensorcd
typedef Tensor<double> Tensord

Functions

template<typename T>
T singleDotProd(const Tensor<T> &A, const Tensor<T> &B, size_t n, size_t m)
template<typename T>
Tensor<T> productElementwise(const Tensor<T> &A, const Tensor<T> &B)
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> multATB(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)
Tensorcd qr(const Tensorcd &A)
Tensorcd qr(const Tensorcd &A, size_t mode)
template<typename T>
Tensor<complex<double>> project(const Tensor<complex<double>> &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>
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>
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)

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”

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)
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>
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 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> multATB(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)
Tensorcd qr(const Tensorcd &A)
Tensorcd qr(const Tensorcd &A, size_t mode)
template<typename T>
Tensor<complex<double>> project(const Tensor<complex<double>> &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>
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>
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)
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

int conj(int a)
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 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 EdgeAttribute.h
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 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”
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”
file SparseMatrixTreeFunctions_Implementation.h
#include “TreeClasses/SparseMatrixTreeFunctions.h”#include “TreeClasses/MatrixTreeFunctions.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 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 SymTensorTree.h
#include “MatrixTensorTreeFunctions.h”

Typedefs

typedef SparseMatrixTreePaircd SymMatrixTree
typedef SparseMatrixTreePairscd SymMatrixTrees

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) 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 CoordinateTransformation.h
#include “Core/Vector.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)
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
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

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<complex<double>> 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 MatrixListTree.h
#include “TreeOperators/TensorOperators/TensorOperatorTree.h”#include “TreeClasses/TensorTree.h”

Typedefs

typedef vector<Matrixcd> MatrixList
file MatrixListTree.h
#include “TreeOperators/TreeStructured/TreeSOP.h”#include “TreeClasses/TensorTree.h”

Typedefs

typedef vector<Matrixcd> MatrixList
file TensorOperatorTree.h
#include “TreeClasses/NodeAttribute.h”#include “TreeClasses/TensorTree.h”#include “TreeOperators/LeafMatrix.h”#include “TreeOperators/MultiLeafOperator.h”#include “TreeOperators/SumOfProductsOperator.h”
file TensorOperatorTreeFunctions.h
#include “TreeOperators/TensorOperators/MatrixListTree.h”#include “TreeOperators/TensorOperators/TensorOperatorTree.h”
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 *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>
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 *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_
size_t nextNodeNumFortran_
NodePosition position_
int address_
int nodeType_
bool bottomLayer_
file NodePosition.h
#include “Core/stdafx.h”

Variables

vector<size_t> path_
size_t layer_
file Tree.h
#include “Node.h”#include “Edge.h”#include “LinearizedLeaves.h”#include <map>

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 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 QMConstants.h
#include “Core/stdafx.h”
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”
file RungeKutta4.h
#include <iostream>#include <fstream>
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 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 stdafx.cpp

Functions

double conj(double x)
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> multATB< 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 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 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 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> multATB< 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<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 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 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> multATB< cd, doub >(const Matrix < doub > & A, const Tensor < cd > & B, size_t mode)
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 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 “TreeClasses/MatrixTensorTreeFunctions.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 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”

Functions

Tensorcd canonicalTensor(Tensorcd w, bool up, bool down)
Matrixcd calculateB(const Tensorcd &weighted, size_t k)
template<typename T>
void createWeighted(TensorTree<T> &weighted, TensorTree<T> &down, const TensorTreecd &up, const Tree &tree)
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 LeafFunction.cpp
#include “TreeOperators/LeafFunction.h”
file LeafMatrix.cpp
#include “TreeOperators/LeafMatrix.h”

Functions

Matrixcd toMatrix(const LeafOperatorcd &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

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)
file MatrixListTree.cpp
#include “TreeOperators/TensorOperators//MatrixListTree.h”
file MatrixListTree.cpp
#include “TreeOperators/TreeStructured/MatrixListTree.h”
file TensorOperatorTree.cpp
#include “TreeOperators/TensorOperators/TensorOperatorTree.h”
file TensorOperatorTreeFunctions.cpp
#include “TreeOperators/TensorOperators/TensorOperatorTreeFunctions.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”
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 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 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 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/stable/include/Core
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/src/Core
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/include
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/include/TreeShape/LeafTypes
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/src/TreeShape/LeafTypes
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/src
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/include/TreeOperators/TensorOperators
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/src/TreeOperators/TensorOperators
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/src/TreeClasses
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/include/TreeClasses
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/src/TreeOperators
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/include/TreeOperators
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/src/TreeShape
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/include/TreeShape
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/include/TreeOperators/TreeStructured
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/src/TreeOperators/TreeStructured
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/include/Util
dir /home/docs/checkouts/readthedocs.org/user_builds/qutree/checkouts/stable/src/Util