It is not clear if something like that is possible or not.
About OpSum
, it seems that after this Issue PastaQ.jl/Issue#247 it is possible to pass multi site operators and parameters, So I can write something like
sites = siteinds("Qubit",4)
os = OpSum() + ("Rn", 1, (θ = 0.5, ϕ = 0.2, λ = 1.2))
U = MPO(os, sites)
But I can’t find this in any documentation or example, if not from PastaQ
(OpSum · ITensors.jl), is the documentation outdated or is there a reason for not exposing this?
Meanwhile about MPS
it doesn’t seem possible to pass parameters to the state. What I mean is that given this overload of state
function ITensors.state(::StateName"ψ_θ",::SiteType"Qubit"; θ)
@assert 0. <= θ <=1.
return [sqrt(θ), sqrt(1-θ)]
end
It is not possible to do something like
psi = MPS(sites, i-> ("ψ_θ", (θ = isodd(i) ? 0.1 : 0.5,)))
Since it would be trivial to just construct the Vector{ITensor}
and construct the MPS from it directly
states = [ state(site,"ψ_θ"; θ = isodd(i) ? 0.1 : 0.5) for (i,site) in enumerate(sites)]
ψ = MPS(states)
I’m wondering if it is a choice of style or just it hasn’t been implemented yet. In either case I think it would be a good idea to put (if not the example I proposed, something similar) in the documentation or in the Examples
section