Tensor Network Theory Library  Beta release 1.1.0
A library of routines for performing TNT-based operations
Getting information and finding

Detailed Description

These functions can be used to get the properties of a node or information about connections between nodes in a network. They do not alter the properties of the node.

Functions

tntNode tntNodeFindConn (tntNode A, tntLegLabel legA)
 
tntNode tntNodeFindFirst (tntNetwork nw)
 
tntNode tntNodeFindLast (tntNetwork nw)
 
tntComplexArray tntNodeGetDiag (tntNode A, tntLegLabel rowlegs, tntLegLabel collegs)
 
tntComplex tntNodeGetFirstEl (tntNode A)
 
unsigned tntNodeGetLegDim (tntNode A, tntLegLabel legA)
 
int tntNodeGetLegDir (tntNode A, tntLegLabel legA)
 
double tntNodeGetNorm (tntNode A)
 
tntComplex tntNodeGetTrace (tntNode A, tntLegLabel rowlegs, tntLegLabel collegs)
 
unsigned tntNodeIsCovariant (tntNode A)
 
unsigned tntNodeIsFunctional (tntNode A)
 
void tntNodePrintAll (tntNode A)
 
void tntNodePrintAsMatrix (tntNode A, tntLegLabel rowlegs, tntLegLabel collegs)
 
void tntNodePrintInfo (tntNode A)
 

Function Documentation

tntNode tntNodeFindConn ( tntNode  A,
tntLegLabel  legA 
)

Finds the node that is connected to legA of the node \(A\) that is passed as an argument. It will return NULL if there is nothing connected to this leg.

Returns
The node connected to the node \(A\) by the leg stated.
Parameters
AThe node to find the connection of
legAThe leg of the node \(A\) to find the connection of

Definition at line 29 of file tntNodeInfo.c.

tntNode tntNodeFindFirst ( tntNetwork  nw)

Identifies the first node in the network.

Returns
The first node in the network.

Definition at line 50 of file tntNodeInfo.c.

tntNode tntNodeFindLast ( tntNetwork  nw)

Identifies the last node in the network.

Returns
The last node in the network.

Definition at line 66 of file tntNodeInfo.c.

tntComplexArray tntNodeGetDiag ( tntNode  A,
tntLegLabel  rowlegs,
tntLegLabel  collegs 
)

Gets the diagonal values of a matrix formed by reshaping the tensor corresponding to the node \(A\). The legs that are assigned to each of the dimensions of the matrix are given as arguments, where the first leg corresponds to the fastest moving index. The resulting matrix must be square, and if it is not the function exits with an error. The values returned are in complex format even if the tensor values are purely real. The diagonal values are returned in an array of type ::tntComplexArray which should be freed using tntComplexArrayFree() when no longer required.

Returns
A complex array containing the diagonal elements of the reshaped tensor that represents the node \(A\).
Parameters
ANode to get the trace of
rowlegsList of legs making up the rows of the matrix
collegsList of legs making up the columns of the matrix

Definition at line 135 of file tntNodeInfo.c.

tntComplex tntNodeGetFirstEl ( tntNode  A)

Gets the first element in the tensor corresponding to the node \(A\). The value returned is in complex format even if the tensor values are purely real.

Returns
The first element of the tensor that represents the node \(A\).

Definition at line 82 of file tntNodeInfo.c.

unsigned tntNodeGetLegDim ( tntNode  A,
tntLegLabel  legA 
)

Returns the dimension of the specified leg of the node \(A\). If the leg does not exist an error will result.

Returns
The leg dimension.
Parameters
AThe node to get the dimension of.
legAThe leg of the node to get the dimension of.

Definition at line 197 of file tntNodeInfo.c.

int tntNodeGetLegDir ( tntNode  A,
tntLegLabel  legA 
)

Gets the direction of a given leg, which is used when determining quantum number blocks. The value taken will be TNT_QN_IN if it is an incoming leg, TNT_QN_OUT if it is an outgoing leg, and 0 if there is no quantum number information set on the leg.

Returns
An integer value TNT_QN_IN, TNT_QN_OUT or 0.
Parameters
ANode to get quantum number information from.
legALeg to get quantum number information from.

Definition at line 246 of file tntNodeInfo.c.

double tntNodeGetNorm ( tntNode  A)

Calculates the norm of the node \(A\) defined as the square root as the squared sum of all the tensor values i.e. the Euclidean norm of the vector forming the array of all tensor elements.

Returns
The norm of the node.

Definition at line 488 of file tntNodeInfo.c.

tntComplex tntNodeGetTrace ( tntNode  A,
tntLegLabel  rowlegs,
tntLegLabel  collegs 
)

Gets the trace of a matrix formed by reshaping the tensor corresponding to the node \(A\). The legs that are assigned to each of the dimensions of the matrix are given as arguments, where the first leg corresponds to the fastest moving index. The resulting matrix must be square, and if it is not the function exits with an error. The value returned is in complex format even if the tensor values are purely real.

See Also
tntNodeContractSelf() can take the partial (or full) trace of a tensor by contracting over a subset (or all) legs of the Nodes. Noet that tntNodeContractSelf() alters the original Nodes whereas tntNodeGetTrace() leaves the Nodes unchanged.
Returns
The trace of the reshaped tensor that represents the node \(A\).
Parameters
ANode to get the trace of
rowlegsList of legs making up the rows of the matrix
collegsList of legs making up the columns of the matrix

Definition at line 103 of file tntNodeInfo.c.

unsigned tntNodeIsCovariant ( tntNode  A)

Checks whether the node \(A\) is covariant under the system type set i.e. whether quantum numbers have been assigned to all the indices, and whether the elements are being stored in blocked form.

Returns
1 if the node is a covariant node, 0 if the node there is no or incomplete symmetry information set for the node.

Definition at line 474 of file tntNodeInfo.c.

unsigned tntNodeIsFunctional ( tntNode  A)

Checks whether the node \(A\) is a functional node or a static node.

Returns
The number of parameters if the node is a functional node, 0 if the node is a static node.

Definition at line 460 of file tntNodeInfo.c.

void tntNodePrintAll ( tntNode  A)

Prints information about the node \(A\), as well as the values. To print information only use tntNodePrintAll() or to have the values reshaped to your choosing, use tntNodePrintAsMatrix();

Definition at line 302 of file tntNodeInfo.c.

void tntNodePrintAsMatrix ( tntNode  A,
tntLegLabel  rowlegs,
tntLegLabel  collegs 
)

Prints a node with any number of legs as a matrix. The legs that are assigned to each of the dimensions of the matrix are given as arguments, where the first leg corresponds to the fastest moving index.

Parameters
ANode to print.
rowlegsList of legs making up the rows of the matrix
collegsList of legs making up the columns of the matrix

Definition at line 163 of file tntNodeInfo.c.

void tntNodePrintInfo ( tntNode  A)

Prints information about the node \(A\), but not the values. To print the matrix values too, use tntNodePrintAll() or tntNodePrintAsMatrix();

Parameters
AThe node to print information for.

Definition at line 295 of file tntNodeInfo.c.