 Tensor Network Theory Library  Beta release 1.2.1 A library of routines for performing TNT-based operations
init_heis_s1.m

Creates an initialisation file suitable for running with tntEvolve_if.c.

This creates the same system as the template S=1 Heisenberg Chain on TNTgo.

%% Creating an initialisation file for TNT library functions
clear all;
% matlab filename for input file
savename = 'heis_s1.mat';
% Initialise all variables required
%% Create single species spin operator
ns = 1; % Number of species
s = 1; % Spin
[sx,sy,sz,sp,sm] = tntMatSpinOps(s,ns); % Creating spin operators
d = size(sz{1},1); % Physical dimension;
%% Defining the physical basis, symmetry information and global system parameters
% Now give the quantum number(s) for each index of the operator.
% For a single species system it should be a row vector having the same
% number of elements as the physical dimension.
qnums = transpose(2*diag(sz{1}));
tntSystem.basisOp = tntMatAppendBasisOp(sz{1},qnums); %Set the basis operator for the system
tntSystem.symm_type = 1; % U(1) symmetry type (0 for no symmetries)
tntSystem.symm_num_qn = ns; % The number of quantum number labels
%% Set up the system
chi = 40;
L = 40;
%% Parameters for finding the ground state: Heisenberg model
qn_tot = 0;
precision = 1e-5; % ground state is found when difference between energy iterations is less than this
% Isotropic Heisenberg Hamiltonian
osparamg = [];
nnlg = tntMatCreateOpArray({sp{1},sm{1},sz{1}});
nnrg = tntMatCreateOpArray({sm{1},sp{1},sz{1}});
nnparamg = [0.5; 0.5; 1];
%% Parameters for modifying the start state
modifypmpo = 1; % One product MPO for modifying the ground state
osm_0 = tntMatCreateOpArray({sp{1}}); % Operators for the first MPO
snm_0 = ceil(L/2); % Site number for the operator
%% Parameters for time evolution
dt = 0.01;
numsteps = 500;
tbigstep = 10;
%% Evolution Hamiltonian
% Carry on evolution under the action of the Heisenberg Hamiltonian
osparamt = [];
nnlt = tntMatCreateOpArray({sp{1},sm{1},sz{1}});
nnrt = tntMatCreateOpArray({sm{1},sp{1},sz{1}});
nnparamt = [0.5; 0.5; 1];
%% Expectation values to take
ExOp.os_operators = tntMatCreateOpArray({sz{1}});
ExOp.os_labels = {'spin'};
ExOp.nn_operators = tntMatCreateOpArray({sz{1},sz{1}});
ExOp.nn_labels = {'spin_spin'};
ExOp.cs_operators = tntMatCreateOpArray({});
ExOp.cs_labels = {};
ExOp.ap_operators = tntMatCreateOpArray({});
ExOp.ap_labels = {};
%% Save all the parameters
save(savename);