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
init_domain_wall.m

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

This creates the same system as the template Domain Wall on TNTgo.

%% Creating an initialisation file for TNT library functions
clear all;
% matlab filename for input file
savename = 'domain_wall.mat';
% Initialise all variables required
%% Create single species spin operator
ns = 1; % Number of species
s = 1/2; % 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;
%% Create the start state - start with half spins pointing down, half up
% Note that the required product state is created directly rather than by applying a modifier
% MPO
su = zeros(d,1); su(1) = 1;
sd = zeros(d,1); sd(2) = 1;
wf_start = cell(1,L);
for loop = 1:L/2
wf_start{loop} = sd;
end
for loop = (L/2+1):L
wf_start{loop} = su;
end
wf_start = tntMatCreateProdMps(wf_start,qnums);
%% Parameters for time evolution
dt = 0.01;
numsteps = 1000;
tbigstep = 25;
%% Evolution Hamiltonian
% Carry out evolution under the action of the XXZ Hamiltonian
osparamt = [];
nnlt = tntMatCreateOpArray({sp{1},sm{1},sz{1}});
nnrt = tntMatCreateOpArray({sm{1},sp{1},sz{1}});
nnparamt = [0.5; 0.5; 0.5];
%% Expectation values to take
ExOp.os_operators = tntMatCreateOpArray({sz{1}});
ExOp.os_labels = {'spin'};
ExOp.nn_operators = tntMatCreateOpArray({});
ExOp.nn_labels = {};
ExOp.cs_operators = tntMatCreateOpArray({});
ExOp.cs_labels = {};
ExOp.ap_operators = tntMatCreateOpArray({});
ExOp.ap_labels = {};
%% Save all the parameters
save(savename);