Tensor Network Theory Library
Beta release 1.2.1
A library of routines for performing TNTbased operations

This section describes MPS functions which are useful for performing time evolution using the TEBD algorithm, although they are not limited to this.
Functions  
void  tntMpoPropST2scConnect (tntNetwork mpo, tntNetwork PropB, tntNetwork PropT) 
double  tntMpoPropSTscContract (tntNetwork mpoProp, int chi) 
tntNodeArray  tntMpsCreatePropArray (unsigned L, tntComplex h, tntNodeArray *nnl, tntNodeArray *nnr, tntComplexArray *nnparam, tntNodeArray *os, tntComplexArray *osparam) 
tntNetwork  tntMpsPropArrayToST2sc (tntNodeArray Proparr) 
void  tntMpsPropST2scConnect (tntNetwork mps, tntNetwork Prop) 
double  tntMpsPropSTscContract (tntNetwork mpsProp, int chi) 
tntNode  tntMpsPropTwoSite (tntNode *Alp, tntNode *Arp, int chi, double *err) 
void tntMpoPropST2scConnect  (  tntNetwork  mpo, 
tntNetwork  PropB,  
tntNetwork  PropT  
) 
Connects networks created using tntMpsCreatePropST2sc() to an MPO network. It removes the singleton legs from the propagator network and connects the bottom propogator to the downward set of physical legs, and a conjugate copy to the upward set of physical legs. Note in the convention used in the library, the bottom facing legs are those that belong to the 'ket' and the top propagator are those that belong to the 'bra'.
The MPO passed as an argument is used, so the connections on the physical legs are modified by the function, and they must initially be unconnected. A copy of the propagator network is connected, so the propagator network passed in the arguments is unchanged by the function.
mpo  The network representing the MPO 
PropB  The network representing the propagator to contract to the bottom (ket) legs 
PropT  The network representing the propagator to contract to the top (bra) legs 
Definition at line 27 of file tntMpoST2sc.c.
References tntNetworkConjCopy(), tntNetworkCopy(), tntNetworkToNodeGroup(), tntNodeFindConn(), tntNodeFindFirst(), tntNodeJoin(), and tntNodeMapLegs().
Referenced by tntMpoPropST2scProduct().
double tntMpoPropSTscContract  (  tntNetwork  mpoProp, 
int  chi  
) 
Performs a single sweep in one direction of a SuzukiTrotter staircase sweep, contracting the propagators with the MPO nodes. The direction is determined by the connections of the network.
The connections of the network must be as follows for a left to right sweep:
and as follows for a right to left sweep:
Any node connected to the downwards facing legs of the propagator network or upward legs of the conjugate propagator netowrk are unaffected by the function.
mpoProp  Network representing the MPO connected to the staircase. Will be changed by the function, by applying the propagator. 
chi  The maximum internal dimension. All SVD's will be truncated to this value. 
Definition at line 113 of file tntMpoST2sc.c.
References tntMpoPropTwoSite(), tntNodeContract(), tntNodeFindConn(), tntNodeFindFirst(), and tntNodeFindLast().
Referenced by tntMpoPropST2scProduct().
tntNodeArray tntMpsCreatePropArray  (  unsigned  L, 
tntComplex  h,  
tntNodeArray *  nnl,  
tntNodeArray *  nnr,  
tntComplexArray *  nnparam,  
tntNodeArray *  os,  
tntComplexArray *  osparam  
) 
Creates an array of propagators (length \(L1\)) required for evolution under a sitewide operator \(\hat{O}\) formed from a sum of nearestneighbour and onsite terms.
\[ \hat{O} = \sum_{j=0}^{L2}\sum_i^{n_n}\alpha_{i,j}\hat{o}^l_{i}\otimes\hat{o}^r_i + \sum_{j=0}^{L1}\sum_i^{n_o}\beta_{i,j}\hat{o}^s_{i} \]
Nearestneighbour operators \(\hat{o}^l_{i}\) and \(\hat{o}^r_i\) should be provided in arrays nnl
and nnr
respectively both having length \(n_n\). Onsite operators \(\hat{o}^s_{i}\) should be provided in array os
having length \(n_o\). The operators should be singlesite operators or product MPOs, i.e. no internal legs, and two physical legs with the legs labelled as follows:
All the operators should have the same dimension for the physical legs.
The parameters \(\alpha_{i,j}\) and \(\beta_{i,j}\) for the nearest neighbour are onsite terms are supplied in matrices nnparam
and osparam
respectively. The matrix must have a number of rows equal to the length \(n_n, n_o\) of its respective operators array, but there are two options for the number of columns:
i
,1
in the matrix for all sites.L1
columns for nearest neighbour operators and L
columns for onsite operators. The parameter \(\alpha_{i,j}\) or \(\beta_{i,j}\) for operator i
and site j
should be at position i
,j
in the matrix. Any uniform operators should have identical entries for all the sites.The twosite operator for the nearestneighbour terms is simply formed from the supplied arguments as
\[ \hat{T}^n_{j,j+1} = \sum_i^{n_n}\alpha_{i,j}\hat{o}^l_i\otimes\hat{o}^r_i \]
for each pair of sites \(j,j+1\).
The twosite operator for the onsite terms is formed from the supplied arguments as
\[ \hat{T}^s_{j,j+1} = \frac{1}{2}\sum_i^{n_o}\left[(\beta_{i,j}+\delta_{0,j}\beta_{i,0})\hat{o}^s_i\otimes\mathbb{1}+(\beta_{i,j+1}+\delta_{L1,j+1}\beta_{i,L1})\mathbb{1}\otimes\hat{o}^s_i\right] \]
for each pair of sites \(j,j+1\) i.e. the onsite terms are distributed symmetrically amongst the twosite terms.
The propagator \(\hat{P}_{j,j+1}\) in array entry j
is then related to the operators \(\hat{T}_{j,j+1}=\hat{T}^n_{j,j+1}+\hat{T}^s_{j,j+1}\) by:
\[ \hat{P}_{j,j+1} = \mathrm{exp}\left[\mathrm{i}\Re(h)\hat{T}_{j,j+1} \right]\times\mathrm{exp}\left[\Im(h)\hat{T}_{j,j+1} \right]. \]
The parameter \(h\) is a uniform scale factor, which is usually related to the time step in simulations (e.g. half the timestep for second order decompositions). The propagators will then have four physical legs, each physical leg having the same dimension as the original physical legs, which are labelled as follows:
L  Length of system. 
h  Uniform scale factor to apply to all terms. See the main description for information on how real and imaginary parts are applied 
nnl  Array of nearestneighbour operators for left site. Send NULL if there are no nearest neighbour terms. Unchanged by function  copies are used. 
nnr  Array of nearestneighbour operators for right site. Send NULL if there are no nearest neighbour terms. Unchanged by function  copies are used. 
nnparam  Array of parameters for nearestneighbour operators. Send NULL if there are no nearest neighbour terms. 
os  Array of onsite operators. Send NULL if there are no onsite operators. Unchanged by function  copies are used. 
osparam  Parameters for the onsite operators. Send NULL if there are no onsite operators. 
Definition at line 75 of file tntMpsCreatePropagator.c.
References tntComplex::im, tntComplex::re, tntComplexArrayAlloc(), tntComplexArrayFree(), tntMpsCreateTwoSiteOp(), tntNodeArrayAlloc(), tntNodeArrayFree(), tntNodeCopy(), tntNodeCreateEyeOp(), tntNodeExp(), tntNodeFree(), tntSysQNClearWarnOff(), and tntSysQNClearWarnOn().
Referenced by tntMpsCreatePropST2sc().
tntNetwork tntMpsPropArrayToST2sc  (  tntNodeArray  Proparr  ) 
Creates a network of twosite terms representing a sitewide propagator from an array of propagators decomposed using a SuzukiTrotter secondorder staircase expansion. Array entry j
is assumed to contain the twosite propagator for sites \(j,j+1\), and two copies of the propagator are placed in the network i.e. one for a right to left sweep, and one for a lefttoright sweep. Such an array can be created using tntMpsCreatePropArray(), although it does not have to be (e.g. the nodes could be loaded from an initialisation file instead). The final network has the following form:
The orange diamonds represent the start and end of the network i.e. the network starts at the topmost propagator and ends at the bottommost propagator.
Proparr  Array of propagators. Uncahnged by the function  copies of all nodes are used. 
Definition at line 115 of file tntMpsCreateSTstaircase.c.
References tntNetworkCreate(), tntNodeAddLeg(), tntNodeCopy(), tntNodeFindConn(), tntNodeInsert(), tntNodeInsertAtEnd(), tntNodeInsertAtStart(), and tntNodeJoin().
Referenced by tntMpsCreatePropST2sc().
void tntMpsPropST2scConnect  (  tntNetwork  mps, 
tntNetwork  Prop  
) 
Connects a network created using tntMpsCreatePropST2sc() to an MPS network. It removes the singleton legs from the propagator network, and the start and end legs of the complete network are those that originally belonged to the MPS, as shown below.
Note the orange diamonds represent the start and end of the network.
The MPS passed as an argument is used, so the connections on the physical legs are modified by the function, and they must initially be unconnected. A copy of the propagator network is connected, so the propagator network passed in the arguments is unchanged by the function.
mps  The network representing the MPS 
Prop  The network representing the propagator 
Definition at line 31 of file tntMpsST2sc.c.
References tntMpsLength(), tntNetworkCopy(), tntNetworkToNodeGroup(), tntNodeFindConn(), tntNodeFindFirst(), and tntNodeJoin().
Referenced by tntMpsPropST2scProduct().
double tntMpsPropSTscContract  (  tntNetwork  mpsProp, 
int  chi  
) 
Performs a single sweep in one direction of a SuzukiTrotter staircase sweep, contracting the propagators with the MPS nodes. The direction is determined by the connections of the network.
The connections of the network must be as follows for a left to right sweep:
and as follows for a right to left sweep:
Any node connected to the downwards facing legs of the propagator network are unaffected by the function.
The `twist' or orthogonality centre is moved as the twosite gates are swept across. After completion of a left to right sweep the orthogonality centre will be on the last site, and after the completion of a right to left sweep the orthogonality centre will be on the first site.
mpsProp  Network representing the MPS connected to the staircase. Will be changed by the function, by applying the propagator. 
chi  The maximum internal dimension. All SVD's will be truncated to this value. 
Definition at line 97 of file tntMpsST2sc.c.
References tntMpsLength(), tntMpsPropTwoSite(), tntNodeContract(), tntNodeFindConn(), tntNodeFindFirst(), and tntNodeFindLast().
Referenced by tntMpsPropST2scProduct().
tntNode tntMpsPropTwoSite  (  tntNode *  Alp, 
tntNode *  Arp,  
int  chi,  
double *  err  
) 
Performs the local contraction of two MPS nodes with the propagator, then factorises back into two unitary MPS nodes and a central node of singular values.
Alp  Points to the left node of the pair 
Arp  Points to the right node of the pair 
chi  The maximum internal dimension for the SVD 
err  Total truncation error 
Definition at line 157 of file tntMpsST2sc.c.
References tntNodeFindConn(), and tntNodeSVD().
Referenced by tntMpsPropSTscContract().