![]() |
Tensor Network Theory Library
Beta release 1.2.1
A library of routines for performing TNT-based operations
|
Functions for loading and setting up the system from the command line or from a MATLAB file. Different input formats will later be added.
Functions | |
void | tntComplexArraysLoad (const char *loadname, tntComplexArray arrA, tntComplexArray arrB, tntComplexArray arrC, tntComplexArray arrD, tntComplexArray arrE) |
void | tntComplexParamsLoad (const char *loadname, tntComplex varA, tntComplex varB, tntComplex varC, tntComplex varD, tntComplex varE) |
void | tntDoubleArraysLoad (const char *loadname, tntDoubleArray arrA, tntDoubleArray arrB, tntDoubleArray arrC, tntDoubleArray arrD, tntDoubleArray arrE) |
void | tntDoubleParamsLoad (const char *loadname, double varA, double varB, double varC, double varD, double varE) |
void | tntExOpsLoad (const char *loadname, tntExOp varA, tntExOp varB, tntExOp varC, tntExOp varD, tntExOp varE) |
void | tntIntArraysLoad (const char *loadname, tntIntArray arrA, tntIntArray arrB, tntIntArray arrC, tntIntArray arrD, tntIntArray arrE) |
void | tntIntParamsLoad (const char *loadname, int varA, int varB, int varC, int varD, int varE) |
void | tntNetworksLoad (const char *loadname, tntNetwork varA, tntNetwork varB, tntNetwork varC, tntNetwork varD, tntNetwork varE) |
void | tntNodeArraysLoad (const char *loadname, tntNodeArray arrA, tntNodeArray arrB, tntNodeArray arrC, tntNodeArray arrD, tntNodeArray arrE) |
void | tntNodesLoad (const char *loadname, tntNode varA, tntNode varB, tntNode varC, tntNode varD, tntNode varE) |
void | tntProcessCLOptions (int argc, char **argv, char *loadname, char *loadname_op, char *saveprefix, int *chi, int *outputState) |
void | tntStringsLoad (const char *loadname, char *varA, char *varB, char *varC, char *varD, char *varE) |
void tntComplexArraysLoad | ( | const char * | loadname, |
tntComplexArray | arrA, | ||
tntComplexArray | arrB, | ||
tntComplexArray | arrC, | ||
tntComplexArray | arrD, | ||
tntComplexArray | arrE | ||
) |
Loads complex arrays from the file at loadname
into the passed arrays. The arrays should have the same variable name in file as the name passed as an argument At least one array must be passed, and a maximum of 5 arrays can be passed with each function call.
loadname | Path of the input file |
arrA | Array to load |
arrB | Array to load (optional argument) |
arrC | Array to load (optional argument) |
arrD | Array to load (optional argument) |
arrE | Array to load (optional argument) |
void tntComplexParamsLoad | ( | const char * | loadname, |
tntComplex | varA, | ||
tntComplex | varB, | ||
tntComplex | varC, | ||
tntComplex | varD, | ||
tntComplex | varE | ||
) |
Loads complex scalar variables from the file at loadname
into the passed variables. The variables should have the same variable name in file as the name passed as an argument At least one variable must be passed, and a maximum of 5 variables can be passed with each function call.
loadname | Path of the input file |
varA | Variable to load |
varB | Variable to load (optional argument) |
varC | Variable to load (optional argument) |
varD | Variable to load (optional argument) |
varE | Variable to load (optional argument) |
void tntDoubleArraysLoad | ( | const char * | loadname, |
tntDoubleArray | arrA, | ||
tntDoubleArray | arrB, | ||
tntDoubleArray | arrC, | ||
tntDoubleArray | arrD, | ||
tntDoubleArray | arrE | ||
) |
Loads double arrays from the file at loadname
into the passed arrays. The arrays should have the same variable name in file as the name passed as an argument At least one array must be passed, and a maximum of 5 arrays can be passed with each function call.
loadname | Path of the input file |
arrA | Array to load |
arrB | Array to load (optional argument) |
arrC | Array to load (optional argument) |
arrD | Array to load (optional argument) |
arrE | Array to load (optional argument) |
void tntDoubleParamsLoad | ( | const char * | loadname, |
double | varA, | ||
double | varB, | ||
double | varC, | ||
double | varD, | ||
double | varE | ||
) |
Loads double scalar variables from the file at loadname
into the passed variables. The variables should have the same variable name in file as the name passed as an argument At least one variable must be passed, and a maximum of 5 variables can be passed with each function call.
loadname | Path of the input file |
varA | Variable to load |
varB | Variable to load (optional argument) |
varC | Variable to load (optional argument) |
varD | Variable to load (optional argument) |
varE | Variable to load (optional argument) |
void tntExOpsLoad | ( | const char * | loadname, |
tntExOp | varA, | ||
tntExOp | varB, | ||
tntExOp | varC, | ||
tntExOp | varD, | ||
tntExOp | varE | ||
) |
Loads networks from the file at loadname
into the passed variables. The variables should have the same variable name in file as the name passed as an argument At least one variable must be passed, and a maximum of 5 variables can be passed with each function call.
loadname | Path of the input file |
varA | Expectation operators to load |
varB | Expectation operators to load (optional argument) |
varC | Expectation operators to load (optional argument) |
varD | Expectation operators to load (optional argument) |
varE | Expectation operators to load (optional argument) |
void tntIntArraysLoad | ( | const char * | loadname, |
tntIntArray | arrA, | ||
tntIntArray | arrB, | ||
tntIntArray | arrC, | ||
tntIntArray | arrD, | ||
tntIntArray | arrE | ||
) |
Loads integer arrays from the file at loadname
into the passed arrays. The arrays should have the same variable name in file as the name passed as an argument At least one array must be passed, and a maximum of 5 arrays can be passed with each function call.
loadname | Path of the input file |
arrA | Array to load |
arrB | Array to load (optional argument) |
arrC | Array to load (optional argument) |
arrD | Array to load (optional argument) |
arrE | Array to load (optional argument) |
void tntIntParamsLoad | ( | const char * | loadname, |
int | varA, | ||
int | varB, | ||
int | varC, | ||
int | varD, | ||
int | varE | ||
) |
Loads integer scalar variables from the file at loadname
into the passed variables. The variables should have the same variable name in file as the name passed as an argument At least one variable must be passed, and a maximum of 5 variables can be passed with each function call.
loadname | Path of the input file |
varA | Variable to load |
varB | Variable to load (optional argument) |
varC | Variable to load (optional argument) |
varD | Variable to load (optional argument) |
varE | Variable to load (optional argument) |
void tntNetworksLoad | ( | const char * | loadname, |
tntNetwork | varA, | ||
tntNetwork | varB, | ||
tntNetwork | varC, | ||
tntNetwork | varD, | ||
tntNetwork | varE | ||
) |
Loads networks from the file at loadname
into the passed variables. The variables should have the same variable name in file as the name passed as an argument At least one variable must be passed, and a maximum of 5 variables can be passed with each function call.
loadname | Path of the input file |
varA | Network to load |
varB | Network to load (optional argument) |
varC | Network to load (optional argument) |
varD | Network to load (optional argument) |
varE | Network to load (optional argument) |
void tntNodeArraysLoad | ( | const char * | loadname, |
tntNodeArray | arrA, | ||
tntNodeArray | arrB, | ||
tntNodeArray | arrC, | ||
tntNodeArray | arrD, | ||
tntNodeArray | arrE | ||
) |
Loads node arrays from the file at loadname
into the passed arrays. The arrays should have the same variable name in file as the name passed as an argument At least one array must be passed, and a maximum of 5 arrays can be passed with each function call.
loadname | Path of the input file |
arrA | Array to load |
arrB | Array to load (optional argument) |
arrC | Array to load (optional argument) |
arrD | Array to load (optional argument) |
arrE | Array to load (optional argument) |
void tntNodesLoad | ( | const char * | loadname, |
tntNode | varA, | ||
tntNode | varB, | ||
tntNode | varC, | ||
tntNode | varD, | ||
tntNode | varE | ||
) |
Loads nodes from the file at loadname
into the passed variables. The variables should have the same variable name in file as the name passed as an argument At least one variable must be passed, and a maximum of 5 variables can be passed with each function call.
loadname | Path of the input file |
varA | Node to load |
varB | Node to load (optional argument) |
varC | Node to load (optional argument) |
varD | Node to load (optional argument) |
varE | Node to load (optional argument) |
void tntProcessCLOptions | ( | int | argc, |
char ** | argv, | ||
char * | loadname, | ||
char * | loadname_op, | ||
char * | saveprefix, | ||
int * | chi, | ||
int * | outputState | ||
) |
Function that loads input command line parameters and uses them to set variables passes as an argument and system parameters.
Command line options:
Long name | Short name | Description |
---|---|---|
--help | -h | print this help. |
--input <file> | -i <file> | Input checkpoint. This file contains the networks and paramaters that change during the algorithm. Required. |
--operators <file> | -o <file> | Input operators. This file contains operators which are not changed during the algorthim. Required. |
--directory <dir> | -d <dir> | Output directory and prefix for the output files (which may later be used as input checkpoints). If not given no output will be saved. |
--chi <n> | -c <n> | The maximum internal dimension \(\chi\) of nodes in the network. If not given it is set to -1 meaning no truncation will be performed. |
--TOL <val> | -T <val> | Tolerance for zeroing matrix values in SVD. See tntSVDTolSet() for more information. If not given default of 1e-14 will be used. |
--abstrunc <val> | -a <val> | Absolute value to truncate all singular values to in SVD. If not given a value of -1 (i.e. no truncation) will be used. |
--reltrunc <val> | -r <val> | Relative value to truncate all singular values to in SVD. If not given a default value of 1e-16 will be used |
--truncerrbound <val> | -E <val> | Value of truncation error per SVD to truncate all singular values to in SVD. If not given a default value of -1 (i.e. no truncation) will be used |
--svdtype <val> | -s (sdd|svd) | The default SVD routine is sdd but can occasionally fail. The other option is svd for the standard and more stable SVD. |
--seed <val> | -e <n> | Random number seed for the calculation. If zero or no argument is given the current time will be used as a seed. |
--quiet | Turns quiet mode on, so that the only library output printed is warning and error messages. | |
--no-output | -q | No output files written. |
Note that, with the exception of --TOL
which calls the function tntSVDTolSet() to set the tolerance, this function just sets the required variables. The way these variables will be used is implementation dependent. If any of the variables are not required or should not be allowed to be set from the command line for your implementation, simply pass the NULL pointer in place of that argument. Passing NULL instead of a pointer to the variable will over-ride the 'Required' status for the command line option.
argc | Input argument count |
argv | Input arguments |
loadname | Name of network file to be loaded |
loadname_op | Name of operator file to be loaded |
saveprefix | Directory and prefix for saving results |
chi | Initial chi value |
outputState | Flag for enabling output |
Definition at line 486 of file tntLoad.c.
References tntFinalize(), tntSVDRelTruncTolSet(), tntSVDRoutineSet(), tntSVDTolSet(), tntSVDTruncErrTolSet(), and tntSVDTruncTolSet().
void tntStringsLoad | ( | const char * | loadname, |
char * | varA, | ||
char * | varB, | ||
char * | varC, | ||
char * | varD, | ||
char * | varE | ||
) |
Loads strings from the file at loadname
into the passed variables. The variables should have the same variable name in file as the name passed as an argument At least one variable must be passed, and a maximum of 5 variables can be passed with each function call.
loadname | Path of the input file |
varA | String to load |
varB | String to load (optional argument) |
varC | String to load (optional argument) |
varD | String to load (optional argument) |
varE | String to load (optional argument) |