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
create_matrices.c

Some simple examples of creating different types of matrices.

/*
Authors: Sarah Al-Assam, Stephen Clark and Dieter Jaksch
Date: $LastChangedDate$
(c) University of Oxford 2016
*/
/* Include the header for the TNT library, including MPS functions */
#include "tntMps.h"
int main(int argc, char **argv)
{
tntIntArray A;
tntDoubleArray B;
tntComplexArray C;
A = tntIntArrayCreate("1, 2, 3, 4;5, 5, 3, 1");
B = tntDoubleArrayCreate("1, 2, 3.2e-1, 4;5, 5, 3, 1; 5 3 2 1");
C = tntComplexArrayCreate("1, 2i, 3.2e-1, 4;5, 5, 3e-3i+4, 1; 5 3 2 1");
A = tntIntArrayCreateDiag("1, 2, 3, 4", 1);
B = tntDoubleArrayCreateDiag("1, 2, 3.2e-1", -2);
C = tntComplexArrayCreateDiag("1; 2i; 3.2e-1; 4; 5", 0);
return 0;
}