Working in my example i see another kind of error. I'm using include("S=3/2.jl") in begining of my code and works well.
After defining an sitetype function, the call @show(site) returns an correct array of Index Types "S=1" and "S=3/2". Now i'm getting an error in definition of my initial wavefunction with QN conservation. My codes definition of sitetype and state folows :
let
N = 64
function sites_type(n::Int)
if iseven(n) == true
return "S=3/2"
end
if iseven(n) == false
return "S=1"
end
end
sites = siteinds(n->sites_type(n), N; conserve_qns=true)
@show(sites)
J_1 = 1.0 #Same spin couplins
J_2 = 1.0 # \alpha_c = J_2/J_1 \approx 0.7621
ampo = AutoMPO()
# s-s interactions with coupling J_1
for j=1:4:N-4
ampo += 0.5*J_1,"S+",j,"S-",j+2
ampo += 0.5*J_1,"S-",j,"S+",j+2
ampo += J_1,"Sz",j,"Sz",j+2
end
# S-s interations with Coupling J_2
for j=2:4:N-4
ampo += 0.5*J_2,"S+",j,"S-",j+1
ampo += 0.5*J_2,"S-",j,"S+",j+1
ampo += J_2,"Sz",j,"Sz",j+1
end
# S-S interations with coupling J_1
for j=2:4:N-4
ampo += 0.5*J_1,"S+",j,"S-",j+2
ampo += 0.5*J_1,"S-",j,"S+",j+2
ampo += J_1,"Sz",j,"Sz",j+2
end
# S-s interations with coupling J_2
for j=4:4:N-4
ampo += 0.5*J_2,"S+",j,"S-",j+1
ampo += 0.5*J_2,"S-",j,"S+",j+1
ampo += J_2,"Sz",j,"Sz",j+1
end
H = MPO(ampo,sites)
#Definitions of Sz_tot =0 and Sz_tot=1 wave functions
state0, state1 = [], []
for n =1:N/4
push!(state0, "Z0", "Up", "Z0", "Dn")
end
push!(state1, "Up", "Up", "Z0", "Dn")
for n =2:N/4
push!(state1, "Z0", "Up", "Z0", "Dn")
end
psi0 = productMPS(sites,state0)
psi1 = productMPS(sites,state1)
I'm getting an Error in psi0 "ArgumentError : Overload of "state" function not found for Index tags "S=3/2,Site,n=2".