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

This contains utility type function for nodes, e.g. creating different types of nodes, deleting a single node or group of nodes, or copying nodes.
Functions  
tntNode  tntNodeCopy (tntNode A) 
tntNode  tntNodeCopyConj (tntNode A, int conj) 
tntNode  tntNodeCreate (tntComplexArray *nodeVals, tntLegLabel leglabels, unsigned dimleg1, unsigned dim...) 
tntNode  tntNodeCreateEyeLeg (tntNode A, tntLegLabel legA, tntNode B, tntLegLabel legB) 
tntNode  tntNodeCreateEyeOp (tntNode A) 
void  tntNodeFree (tntNode *A) 
void  tntNodeGroupFree (tntNode *A) 
tntNode tntNodeCopy  (  tntNode  A  ) 
Makes a copy of the original node.
A  The node to take a copy of. 
Definition at line 303 of file tntNodeUtil.c.
tntNode tntNodeCopyConj  (  tntNode  A, 
int  conj  
) 
Makes a copy of the original node. Any parameters that belong to the original node will also be copied to the new node.
The conjugate flag should be set to zero if the copy of the node should have the same form as the original node, and set this to 1 if the tensor values associated with the copy of the node should be the complex conjugate of those for the original node. The legs of the new node will not be connected to anything.
Note that if quantum number information is being used to preserve symmetries, then setting conj = 1
will also act to flip the directions of all the quantum number information for each leg.
A  The node to take a copy of. 
conj  Conjugate flag. 
Definition at line 318 of file tntNodeUtil.c.
tntNode tntNodeCreate  (  tntComplexArray *  nodeVals, 
tntLegLabel  leglabels,  
unsigned  dimleg1,  
unsigned  dim...  
) 
Creates a new node, using the values given in the 1D complex array nodevals.
The label that should be assigned to each leg should be passed as a string, the length of which sets the number of legs (maximum number 12) The dimension of each leg should be passed as the final arguments. If the number of dimensions supplied is less than the length of the string, it will be assumed that all remaining legs have a dimension of 1. The legs should be order such that the one with the fastest running index in the supplied array comes first. e.g. if there are three legs have respective indices \(i,j,k\) with dimensions \(d_i,d_j,d_k\), the then index in the suplied 1D array should be \( i + d_i j + d_i d_j k \). (Note: If there are two dimensions, rows then columns, this is equivalent to columnmajor order which is the default in MATLAB and Fortran).
The size of the array must be \(d_i d_j d_k\).
The values are copied from nodevals
, so if the array is no longer required it should be freed afterwards using tntComplexArrayFree().
nodeVals  The values for the node. If NULL, node will be filled with random values. 
leglabels  The label that will be assigned to each leg. 
dimleg1  The dimension of the first leg (optional). 
dim...  Dimensions of remaining legs in the order of the labels (optional). 
Definition at line 353 of file tntNodeUtil.c.
tntNode tntNodeCreateEyeLeg  (  tntNode  A, 
tntLegLabel  legA,  
tntNode  B,  
tntLegLabel  legB  
) 
Returns a node representing the identity matrix i.e. a node having two legs, where the value of the node is 1 when the leg indices are equal and zero otherwise. The legs do not have to have the same dimensions.
The leg properties, including quantum number information and labels are copied from existing nodes \(A\) and \(B\).
If the labels of the two legs are the same, then the second leg is given the next (cyclic) alphanumeric number of that type (i.e. number, lowercase, or uppercase).
A  Node \(A\) to define leg properties of the first leg of the identity node 
legA  Leg of \(A\) to use for the first leg 
B  Node \(B\) to define leg properties of the second leg of the identity node 
legB  Leg of \(B\) to use for the second leg 
Definition at line 74 of file tntNodeUtil.c.
tntNode tntNodeCreateEyeOp  (  tntNode  A  ) 
Returns the operator which defines the identity node with the same leg properties as the node \(A\) passed as an argument i.e
If NULL is passed as an argument, then the basis operator is used to define the leg properties instead. The basis operator can be set using tntSysBasisOpSet() and inspected using tntSysBasisOpGet(). If it has not been set yet calling this function with NULL as an argument will result in an error.
Definition at line 194 of file tntNodeUtil.c.
void tntNodeFree  (  tntNode *  A  ) 
Frees all memory associated with the node. After calling the function the node \(A\) will be NULL  it will no longer be valid and should not be used again.
A  Pointer to the node to free 
Definition at line 274 of file tntNodeUtil.c.
void tntNodeGroupFree  (  tntNode *  A  ) 
Deletes a group of nodes i.e. frees the node \(A\) and all the nodes connected to it. After calling the function the node pointer wil be NULL.
A  Pointer to one of the nodes in the group of nodes to free. 
Definition at line 287 of file tntNodeUtil.c.