Dear ITensor Team,
The question may be somewhat long --please bear with me–I appologise in adv.
Before I go to why I am asking this question, let me start with an example. Suppose I have the Hamiltonian H=\sum_{i}X_{i}X_{i+1} + Y_{i}Y_{i+1} + Z_{i}Z_{i+1} where X_i=S_x^{i} and so on for S=1/2 particles.
Now, for time evolution (say via TEBD) I consider a two site gate. To this end, I simply use the following code (say for the first bond):
using ITensors
N = 10
s = siteinds("S=1/2", N)
s1, s2 = s[1], s[2]
hj_1 = 1.0*op("Sx", s1)*op("Sx",s2) + 1.0*op("Sy", s1)*op("Sy",s2) + 1.0*op("Sz", s1)*op("Sz", s2)
print(hj_1)
Now, if I print hj_1 in the above code snippet I simply get
ITensor ord=4
Dim 1: (dim=2|id=826|"S=1/2,Site,n=1")'
Dim 2: (dim=2|id=826|"S=1/2,Site,n=1")
Dim 3: (dim=2|id=246|"S=1/2,Site,n=2")'
Dim 4: (dim=2|id=246|"S=1/2,Site,n=2")
NDTensors.Dense{ComplexF64, Vector{ComplexF64}}
2×2×2×2
[:, :, 1, 1] =
0.25 + 0.0im 0.0 + 0.0im
0.0 + 0.0im -0.25 + 0.0im
[:, :, 2, 1] =
0.0 + 0.0im 0.5 + 0.0im
0.0 + 0.0im 0.0 + 0.0im
[:, :, 1, 2] =
0.0 + 0.0im 0.0 + 0.0im
0.5 + 0.0im 0.0 + 0.0im
[:, :, 2, 2] =
-0.25 + 0.0im 0.0 + 0.0im
0.0 + 0.0im 0.25 + 0.0im
Now, suppose for some reason (will clarify later), I do not want to use the op(“Sz”, site)*op(“Sz”, site+1) type stuffs. Since at each bond the gate operator is X_{i} \otimes X_{i+1} + Y_{i} \otimes Y_{i+1} + Z_{i} \otimes Z_{i+1} I could have simply done the following
using ITensors
import ITensors: op
N=10
const sz = (1/2.0)*[1. 0.;0. -1.]
const sx = (1/2.0)*[0. 1.; 1. 0.]
const sy = (1/2.0)*[0. -1.0im; +1.0im 0.]
s = siteinds("S=1/2", N)
function op(::OpName"test",::SiteType"S=1/2",s1::Index,s2::Index)
h = kron(sz, sz) + kron(sx, sx) + kron(sy, sy)
return itensor(Matrix(h),s1',s1,s2',s2)
end
print(op("test", s, 1, 2))
Interestingly, now I get a result of the form
ITensor ord=4
Dim 1: (dim=2|id=51|"S=1/2,Site,n=1")'
Dim 2: (dim=2|id=51|"S=1/2,Site,n=1")
Dim 3: (dim=2|id=183|"S=1/2,Site,n=2")'
Dim 4: (dim=2|id=183|"S=1/2,Site,n=2")
NDTensors.Dense{ComplexF64, Vector{ComplexF64}}
2×2×2×2
[:, :, 1, 1] =
0.25 + 0.0im 0.0 + 0.0im
0.0 + 0.0im 0.0 + 0.0im
[:, :, 2, 1] =
0.0 - 0.0im 0.5 - 0.0im
-0.25 + 0.0im 0.0 + 0.0im
[:, :, 1, 2] =
0.0 - 0.0im -0.25 + 0.0im
0.5 - 0.0im 0.0 + 0.0im
[:, :, 2, 2] =
0.0 + 0.0im 0.0 - 0.0im
0.0 - 0.0im 0.25 + 0.0im
Clearly the matrix structures in the two cases are different although my naive impression was that I am doing the same thing. Could you please clarify what is going on?
Just to clarify why I’m asking this question: I have a scenario where I am Trotterizing a Liouvillean and for boundary bonds I have the matrix for dissipative part of the Liouvillean which I want to convert in Itensor operator and add to the Hamiltonian part of the Liouvillean which can be written in terms of product of conventional S=1/2 operator available in ITensor.
Best,
Sourav.