Tensor Network Theory Library  Beta release 1.2.1
A library of routines for performing TNT-based operations
 All Data Structures Functions Variables Groups Pages

Detailed Description

This section contains functions that are utility functions, and do not act on nodes or networks, or are concerned with input and output of data.

Functions

tntComplex tntAtoC (const char *str)
 
void tntClearReshapes (int val)
 
double tntComplexToReal (tntComplex var)
 
int tntPrintf (const char *format,...)
 
void tntPrintVersion (void)
 
void tntQuietModeOff (void)
 
void tntQuietModeOn (void)
 
void tntSysQNClearWarnOff (void)
 
void tntSysQNClearWarnOn (void)
 

Function Documentation

tntComplex tntAtoC ( const char *  str)

Converts a string to a complex number.

Returns
The complex number represented by the string

Definition at line 123 of file tntUtil.c.

References tntComplex::im, and tntComplex::re.

Referenced by tntComplexArrayCreate(), tntComplexArrayCreateDiag(), and tntMpsProcessSysOptions().

void tntClearReshapes ( int  val)

Set a value which, when changed, denotes that the reuse data in tensor_reshape() calls should be freed and recalculated.

Returns
No return value.
Parameters
valIndentifier to be assigned to reshape structure

Definition at line 50 of file tntUtil.c.

double tntComplexToReal ( tntComplex  var)

Used to convert complex variables to real variables. If the imaginary part is non-negligible, calculate the absolute value, otherwise return the real part only i.e. if the variable is real it does not take the absolute value.

Returns
Real value if input was real, or absolute value if input was complex.
Parameters
varA complex variable
Examples:
tntEvolve_cl.c, tntEvolve_if.c, tntGS_cl.c, and tntThermal_cl.c.

Definition at line 108 of file tntUtil.c.

References tntComplex::im, and tntComplex::re.

Referenced by tntMpoExpecOutput(), tntMpsNodeNodeMpsProduct(), and tntMpsVarMinMpo1sFullContract().

int tntPrintf ( const char *  format,
  ... 
)

Prints a formatted string to stdout, where the formatted string should have exactly the same form as the one used by the standard C function printf(). However, if the program is running in quiet mode (by using the option –quiet in the command line or calling the function tntQuietModeOn() then this function will have no effect, and no output will be written.

Returns
No return value.
Examples:
tntEvolve_if.c.

Definition at line 77 of file tntPrint.c.

Referenced by tntMpoExpecOutput(), tntMpsExpecOutput(), tntMpsProcessDmrgCLOptions(), tntMpsProcessExpecOptions(), tntMpsProcessSysOptions(), and tntMpsProcessTebdCLOptions().

void tntPrintVersion ( void  )

Prints the current version number.

Returns
No return value.

Definition at line 64 of file tntUtil.c.

Referenced by tntInitialize().

void tntQuietModeOff ( void  )

Turns off quiet mode, so that all output is directed to stdout

Returns
No return value.

Definition at line 93 of file tntUtil.c.

void tntQuietModeOn ( void  )

Turns on quiet mode, so that limited output is directed to stdout

Returns
No return value.

Definition at line 80 of file tntUtil.c.

void tntSysQNClearWarnOff ( void  )

If you know you are going to be performing an operation that clears QN information from a noce and don't want to get warnings, use this function.

If you want to turn warnings back on at a later time, use tntSysQNClearWarnOn();

Returns
No return value

Definition at line 35 of file tntUtil.c.

Referenced by tntMpoExpecOutput(), tntMpsCreateMpo(), tntMpsCreateProductMpo(), tntMpsCreatePropArray(), tntMpsExpecOutput(), and tntMpsNodeNodeMpsProduct().

void tntSysQNClearWarnOn ( void  )

Once a warning has been received about QN number being stripped, it will not be given again. To reset the flag to continue to get warnings, call this function.

Returns
No return value

Definition at line 17 of file tntUtil.c.

Referenced by tntMpoExpecOutput(), tntMpsCreateMpo(), tntMpsCreateProductMpo(), tntMpsCreatePropArray(), and tntMpsExpecOutput().