You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to do some calculations with QuantumCumulants.jl but when I try to solve the resulting ODEProblem, I keep getting this UndefVarError saying that avg is not defined. Here is a short script that reproduces the issue. I am using v0.2.7.
using QuantumCumulants
using OrdinaryDiffEq, ModelingToolkit
using Plots
@syms t::Real@registerr(t)
@registeri(t)
hq =NLevelSpace(:qubit,(:g,:e))
a =Transition(hq, :annihilate, :g, :e)
σ =Transition(hq, :σ)
σz =σ(:g, :g) -σ(:e, :e)
σy =1im*(σ(:e, :g)-σ(:g, :e))
σx =σ(:g, :e) +σ(:e, :g)
#Hamiltonian
H =r(t) * (a'+ a) +i(t)*1im*(a'- a)
eqns =meanfield([σx, σy, σz], H)
@named sys =ODESystem(eqns)
functionr(t)
return2π*19e-3endfunctioni(t)
return0.end
u0 = [1.0+0im, 0.+0im, 0.+0im]
prob =ODEProblem(sys, u0, (0.0, 1/(4*19e-3)))
sol =solve(prob, Tsit5()) #where error happens
t = sol.t
s22 =real.(sol[σz])
plot(t, s22, xlabel="t", ylabel="⟨σz⟩", legend=false, size=(600,300))
And here is the resulting stacktrace.
Is this some kind of versioning issue? I can't seem to install v0.2.8.
Thank you so much,
Aditya
The text was updated successfully, but these errors were encountered:
Hi Aditya,
You are using operator sums on the left hand side of the equations. This is not possible.
In your case QuantumCumulants.jl always uses sigma_eg and sigma_ee. Just derive the equations for them. You can then calculate the desired numerical averages after the time evolution.
And you are also defining two different operators (symbol name) on the same Hilbertspace, this also causes problems. (Just don't use a and a' here)
Hi,
I have been trying to do some calculations with QuantumCumulants.jl but when I try to solve the resulting ODEProblem, I keep getting this
UndefVarError
saying thatavg
is not defined. Here is a short script that reproduces the issue. I am using v0.2.7.And here is the resulting stacktrace.
Is this some kind of versioning issue? I can't seem to install v0.2.8.
Thank you so much,
Aditya
The text was updated successfully, but these errors were encountered: