I have a few questions on how iTensor works. I’ve been working on some code that runs quite slowly, so I suspect it’s some inner workings I don’t fully understand.
Firstly, I have seen the following code example for representing a string of N spin ups for a spin 1/2 system:
state = ["Up" for n=1:N]
s = siteinds("S=1/2", N; conserve_qns=true)
psi = MPS(s, state)
My understanding is that this that psi
will be this state written as an MPS, but what exactly is this MPS? Is it possible to write down what it is? There should be numerous ways to write this down, so I’m a bit lost on what exactly this code is doing.
Secondly, how does iTensor create MPOs? If I want to create the following operator: \sum_{j=1}^N \sigma_-^j
I can construct my MPO to be: \sum_{i_1,i_2,\dots i_N} \langle 0 | A^{i_1}A^{i_2}\dots A^{i_N}|1\rangle \tau^{i_1} \otimes \tau^{i_2}\otimes \dots \otimes \tau^{i_N}, where each i_k=\{0, 1\}, and \tau^0=1, \tau^1 = \sigma_-, A^0=1,$ and A^1 = \sigma_-. This makes it so that \langle 0 | A^{i_1}A^{i_2}\dots A^{i_N}|1\rangle=1 if and only if just one of the i_k=1. In this case, A^0, A^1 are 2\times 2 matrices, so I’m working with bond dimension 2.
Based on tutorials, I would implement this similarly using
S_minus = OpSum()
for i in 1:N
S_minus += 1.,"S-", i
end
s = siteinds("S=1/2", N; conserve_qns=true)
S_minus_MPO = MPO(Jmin, s)
What exactly does this create? How would I write down what this is?
Also, if I know the form of the MPO I want (as I do above), is there some way to implement this MPO manually (i.e. literally specifying the matrices A^0,A^1, etc.)?