Hi,
Thanks for all your support so far! I have a (hopefully) quick question about creating a mixed site set involving electrons and bosons. Ideally, I would like to conserve quantum numbers for the electron sites and not conserve qns for the boson sites. I am able to get my code working in the case where I do not conserve qns for either:
sites = [isodd(n) ? siteind("Electron"; addtags="n=$n",conserve_qns=false) : siteind("Boson"; addtags="n=$n",conserve_qns=false, dim=phonon_dim) for n=1:Nsites]
This works fine. However, when I try to setconserve_qns=true for the electron sites, I get the following error message:
ERROR: LoadError: MethodError: no method matching -(::QN, ::Nothing)
Closest candidates are:
-(::Prod{A}, ::A) where A at /Users/nicole/.julia/packages/ITensors/5CAqA/src/LazyApply/LazyApply.jl:183
-(::ITensors.LazyApply.Applied{typeof(sum), Tuple{Array{ITensors.LazyApply.Applied{typeof(*), Tuple{C, Prod{A}}, NamedTuple{(), Tuple{}}}, 1}}, NamedTuple{(), Tuple{}}}, ::A) where {C, A} at /Users/nicole/.julia/packages/ITensors/5CAqA/src/LazyApply/LazyApply.jl:244
-(::Sum{A}, ::A) where {C, A} at /Users/nicole/.julia/packages/ITensors/5CAqA/src/LazyApply/LazyApply.jl:82
...
Stacktrace:
[1] (::ITensors.var"#calcQN#1172"{Vector{Index}, Dict{Pair{String, Int64}, ITensor}})(term::Vector{Op})
@ ITensors ~/.julia/packages/ITensors/5CAqA/src/physics/autompo/opsum_to_mpo_qn.jl:28
[2] qn_svdMPO(os::Sum{Scaled{ComplexF64, Prod{Op}}}, sites::Vector{Index}; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ ITensors ~/.julia/packages/ITensors/5CAqA/src/physics/autompo/opsum_to_mpo_qn.jl:50
[3] qn_svdMPO
@ ~/.julia/packages/ITensors/5CAqA/src/physics/autompo/opsum_to_mpo_qn.jl:2 [inlined]
[4] MPO(os::Sum{Scaled{ComplexF64, Prod{Op}}}, sites::Vector{Index}; splitblocks::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ ITensors ~/.julia/packages/ITensors/5CAqA/src/physics/autompo/opsum_to_mpo_generic.jl:246
[5] MPO
@ ~/.julia/packages/ITensors/5CAqA/src/physics/autompo/opsum_to_mpo_generic.jl:239 [inlined]
Please let me know if you would like to see code for the full Hamiltonian. Thanks again for everything! I really appreciate it.