Open leonbello opened 6 months ago
The problem already occurs when generating ODESystem
, and I think possibly has to do with how I was putting in the the time dependence. Instead of registering a time-dependent function, I just directly used a time-dependent exponent, which didn't register as a system parameter and omitting it from the map, causing an error when trying to solve ODEProblem
(Although I am not sure why it's not -- it seems to work in the steady-state squeezing example on the docs). If I artificially add terms that depend on the exponent, it is correctly registered, it seems to miss them if they only appear inside the exponent.
However, trying to register the time-dependence I ran into another problem. In my problem, the different coupling terms rotate at the frequency difference between the qubits with a time-dependence $exp(-i \delta_{j,k} t)$. To register the time-dependence, I tried to register the following function
@syms t::Real
@register f(j::Index, k::Index, t)
This seems to work only if I explicitly assert j
and k
to be Index
, but fails when I call complete
, giving an error:
{
"name": "MethodError",
"message": "MethodError: no method matching get_order(::Index)
Closest candidates are:
get_order(!Matched::SingleSum)
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/indexing.jl:495
get_order(!Matched::SymbolicUtils.BasicSymbolic{<:QuantumCumulants.AvgSym})
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/average.jl:320
get_order(!Matched::QuantumCumulants.QMul)
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/average.jl:329
...
",
"stack": "MethodError: no method matching get_order(::Index)
Closest candidates are:
get_order(!Matched::SingleSum)
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/indexing.jl:495
get_order(!Matched::SymbolicUtils.BasicSymbolic{<:QuantumCumulants.AvgSym})
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/average.jl:320
get_order(!Matched::QuantumCumulants.QMul)
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/average.jl:329
...
Stacktrace:
[1] iterate
@ ./generator.jl:47 [inlined]
[2] _collect(c::Vector{Any}, itr::Base.Generator{Vector{Any}, typeof(get_order)}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
@ Base ./array.jl:802
[3] collect_similar
@ ./array.jl:711 [inlined]
[4] map
@ ./abstractarray.jl:3261 [inlined]
[5] get_order(t::SymbolicUtils.BasicSymbolic{Real})
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/average.jl:323
[6] iterate
@ ./generator.jl:47 [inlined]
[7] collect_to!(dest::Vector{Int64}, itr::Base.Generator{Vector{Any}, typeof(get_order)}, offs::Int64, st::Int64)
@ Base ./array.jl:840
[8] collect_to_with_first!(dest::Vector{Int64}, v1::Int64, itr::Base.Generator{Vector{Any}, typeof(get_order)}, st::Int64)
@ Base ./array.jl:818
[9] _collect(c::Vector{Any}, itr::Base.Generator{Vector{Any}, typeof(get_order)}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
@ Base ./array.jl:812
[10] collect_similar
@ ./array.jl:711 [inlined]
[11] map
@ ./abstractarray.jl:3261 [inlined]
[12] get_order(t::SymbolicUtils.BasicSymbolic{CNumber})
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/average.jl:323
[13] get_order(a::IndexedAverageSum)
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/index_average.jl:313
[14] get_order(a::SymbolicUtils.BasicSymbolic{IndexedAverageSum})
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/index_average.jl:319
[15] iterate
@ ./generator.jl:47 [inlined]
[16] collect_to!(dest::Vector{Int64}, itr::Base.Generator{Vector{Any}, typeof(get_order)}, offs::Int64, st::Int64)
@ Base ./array.jl:840
[17] collect_to_with_first!(dest::Vector{Int64}, v1::Int64, itr::Base.Generator{Vector{Any}, typeof(get_order)}, st::Int64)
@ Base ./array.jl:818
[18] _collect(c::Vector{Any}, itr::Base.Generator{Vector{Any}, typeof(get_order)}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
@ Base ./array.jl:812
[19] collect_similar
@ ./array.jl:711 [inlined]
[20] map
@ ./abstractarray.jl:3261 [inlined]
[21] get_order(t::SymbolicUtils.BasicSymbolic{CNumber})
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/average.jl:323
[22] iterate
@ ./generator.jl:47 [inlined]
[23] _collect(c::Vector{Any}, itr::Base.Generator{Vector{Any}, typeof(get_order)}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
@ Base ./array.jl:802
[24] collect_similar
@ ./array.jl:711 [inlined]
[25] map
@ ./abstractarray.jl:3261 [inlined]
[26] get_order(t::SymbolicUtils.BasicSymbolic{CNumber})
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/average.jl:323
[27] cumulant_expansion(x::SymbolicUtils.BasicSymbolic{CNumber}, order::Int64; simplify::Bool, kwargs::Base.Pairs{Symbol, typeof(maximum), Tuple{Symbol}, NamedTuple{(:mix_choice,), Tuple{typeof(maximum)}}})
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/average.jl:137
[28] cumulant_expansion
@ ~/.julia/packages/QuantumCumulants/s7jJO/src/average.jl:135 [inlined]
[29] #536
@ ./none:0 [inlined]
[30] iterate
@ ./generator.jl:47 [inlined]
[31] collect(itr::Base.Generator{Vector{SymbolicUtils.BasicSymbolic{CNumber}}, QuantumCumulants.var\"#536#539\"{Bool, Int64, typeof(maximum)}})
@ Base ./array.jl:782
[32] indexed_meanfield(a::Vector{QuantumCumulants.QMul{Nothing}}, H::QuantumCumulants.QAdd, J::Vector{QSym}; Jdagger::Vector{QSym}, rates::Vector{SymbolicUtils.BasicSymbolic{Parameter}}, multithread::Bool, simplify::Bool, order::Int64, mix_choice::Function, iv::SymbolicUtils.BasicSymbolic{Real}, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/index_meanfield.jl:102
[33] indexed_complete!(de::QuantumCumulants.IndexedMeanfieldEquations; order::Int64, multithread::Bool, filter_func::Nothing, mix_choice::Function, simplify::Bool, extra_indices::Vector{Symbol}, scaling::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/index_meanfield.jl:391
[34] indexed_complete!(de::QuantumCumulants.IndexedMeanfieldEquations)
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/index_meanfield.jl:223
[35] #complete!#596
@ ~/.julia/packages/QuantumCumulants/s7jJO/src/index_meanfield.jl:760 [inlined]
[36] complete!(eqs::QuantumCumulants.IndexedMeanfieldEquations)
@ QuantumCumulants ~/.julia/packages/QuantumCumulants/s7jJO/src/index_meanfield.jl:760
[37] top-level scope
@ ~/qbus-rc/basic_qbus.ipynb:5"
}
Hi @leonbello
I fixed your issue in the new version 0.2.27. The problem was that evaluate()
did not replace indices inside a function as e.g. exp()
.
I think I also solved the other problem that Lis not fully removed, but I am not 100% sure since you did not provide the Hamiltonian in the issue above. It would be awesome if you could test this and let me know if it works now. If
L` is not fully removed, something might be wrong.
Registering indexed time-dependent functions is not implemented.
Hi @ChristophHotter,
The function now properly substitutes the indices inside the exponent, but L
seems to still not be replaced.
The Hamiltonian I try to solve is the following,
χT = ∑(χ(j)*σz(j), j)
H0 = (Δ_b + χT)*b'*b + 1//2*∑(Δ(j)*σz(j), j)
Hqdr = ∑(
∑(
u(j,k)*σm(j)*exp.(-1im.*δ(j,k).*t) + u(j,k)*σp(j)*exp.(1im.*δ(j,k).*t),
j),
k)
Hbdr = ϵ_r*(b + b')
Hqq = ∑(
∑(
J(j,k)*σm(j)*σp(k)*exp(-1im*δ(j,k)*t),
j,[k]),
k)
H = H0 + Hbdr + Hqdr + Hqq
L
still appears in the equations after calling evaluate
, and when I try solving the equations I get a new error:
UndefVarError: `u_{1,Index(ℋ(bus) ⊗ ℋ(atoms), :k, L, 2)}` not defined
Error stacktrace:
{
"name": "UndefVarError",
"message": "UndefVarError: `u_{1,Index(ℋ(bus) ⊗ ℋ(atoms), :k, L, 2)}` not defined",
"stack": "UndefVarError: `u_{1,Index(ℋ(bus) ⊗ ℋ(atoms), :k, L, 2)}` not defined
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/SymbolicUtils/ssQsQ/src/code.jl:418 [inlined]
[2] macro expansion
@ ~/.julia/packages/Symbolics/gBKZv/src/build_function.jl:537 [inlined]
[3] macro expansion
@ ~/.julia/packages/SymbolicUtils/ssQsQ/src/code.jl:375 [inlined]
[4] macro expansion
@ ~/.julia/packages/RuntimeGeneratedFunctions/Yo8zx/src/RuntimeGeneratedFunctions.jl:163 [inlined]
[5] macro expansion
@ ./none:0 [inlined]
[6] generated_callfunc
@ ./none:0 [inlined]
[7] (::RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var\"#_RGF_ModTag\", ModelingToolkit.var\"#_RGF_ModTag\", (0x326c3d26, 0x763b6861, 0x4723a01a, 0xd9e7b48c, 0x9891ff5d), Nothing})(::Vector{ComplexF64}, ::Vector{ComplexF64}, ::Vector{Float64}, ::Float64)
@ RuntimeGeneratedFunctions ~/.julia/packages/RuntimeGeneratedFunctions/Yo8zx/src/RuntimeGeneratedFunctions.jl:150
[8] k
@ ~/.julia/packages/ModelingToolkit/dCa81/src/systems/diffeqs/abstractodesystem.jl:371 [inlined]
[9] Void
@ ~/.julia/packages/SciMLBase/8XHkk/src/utils.jl:481 [inlined]
[10] (::FunctionWrappers.CallWrapper{Nothing})(f::SciMLBase.Void{ModelingToolkit.var\"#k#551\"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var\"#_RGF_ModTag\", ModelingToolkit.var\"#_RGF_ModTag\", (0x63de109c, 0xb0fbb681, 0xdbe53fb8, 0x62e0b171, 0x07a772fe), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var\"#_RGF_ModTag\", ModelingToolkit.var\"#_RGF_ModTag\", (0x326c3d26, 0x763b6861, 0x4723a01a, 0xd9e7b48c, 0x9891ff5d), Nothing}}}, arg1::Vector{ComplexF64}, arg2::Vector{ComplexF64}, arg3::Vector{Float64}, arg4::Float64)
@ FunctionWrappers ~/.julia/packages/FunctionWrappers/Q5cBx/src/FunctionWrappers.jl:65
[11] macro expansion
@ ~/.julia/packages/FunctionWrappers/Q5cBx/src/FunctionWrappers.jl:137 [inlined]
[12] do_ccall
@ ~/.julia/packages/FunctionWrappers/Q5cBx/src/FunctionWrappers.jl:125 [inlined]
[13] FunctionWrapper
@ ~/.julia/packages/FunctionWrappers/Q5cBx/src/FunctionWrappers.jl:144 [inlined]
[14] _call
@ ~/.julia/packages/FunctionWrappersWrappers/9XR0m/src/FunctionWrappersWrappers.jl:12 [inlined]
[15] FunctionWrappersWrapper
@ ~/.julia/packages/FunctionWrappersWrappers/9XR0m/src/FunctionWrappersWrappers.jl:10 [inlined]
[16] ODEFunction
@ ~/.julia/packages/SciMLBase/8XHkk/src/scimlfunctions.jl:2407 [inlined]
[17] initialize!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Vector{ComplexF64}, Nothing, Float64, Vector{Float64}, Float64, Float64, Float64, Float64, Vector{Vector{ComplexF64}}, ODESolution{ComplexF64, 2, Vector{Vector{ComplexF64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{ComplexF64}}}, ODEProblem{Vector{ComplexF64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, SciMLBase.AutoSpecialize, FunctionWrappersWrappers.FunctionWrappersWrapper{Tuple{FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{ComplexF64}, Vector{ComplexF64}, Vector{Float64}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Float64}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{ComplexF64}, Vector{Float64}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Float64}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}}, false}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, Vector{Symbol}, ModelingToolkit.var\"#661#generated_observed#561\"{Bool, ODESystem, Dict{Any, Any}, Vector{SymbolicUtils.BasicSymbolic{Parameter}}}, Nothing, ODESystem}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, SciMLBase.AutoSpecialize, FunctionWrappersWrappers.FunctionWrappersWrapper{Tuple{FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{ComplexF64}, Vector{ComplexF64}, Vector{Float64}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Float64}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{ComplexF64}, Vector{Float64}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Float64}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}}, false}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, Vector{Symbol}, ModelingToolkit.var\"#661#generated_observed#561\"{Bool, ODESystem, Dict{Any, Any}, Vector{SymbolicUtils.BasicSymbolic{Parameter}}}, Nothing, ODESystem}, Vector{Vector{ComplexF64}}, Vector{Float64}, Vector{Vector{Vector{ComplexF64}}}, OrdinaryDiffEq.Tsit5Cache{Vector{ComplexF64}, Vector{ComplexF64}, Vector{ComplexF64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, SciMLBase.DEStats, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, FunctionWrappersWrappers.FunctionWrappersWrapper{Tuple{FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{ComplexF64}, Vector{ComplexF64}, Vector{Float64}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Float64}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{ComplexF64}, Vector{Float64}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Float64}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}}, false}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, Vector{Symbol}, ModelingToolkit.var\"#661#generated_observed#561\"{Bool, ODESystem, Dict{Any, Any}, Vector{SymbolicUtils.BasicSymbolic{Parameter}}}, Nothing, ODESystem}, OrdinaryDiffEq.Tsit5Cache{Vector{ComplexF64}, Vector{ComplexF64}, Vector{ComplexF64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Float64, Tuple{}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, Tuple{}}, Vector{ComplexF64}, ComplexF64, Nothing, OrdinaryDiffEq.DefaultInit}, cache::OrdinaryDiffEq.Tsit5Cache{Vector{ComplexF64}, Vector{ComplexF64}, Vector{ComplexF64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False})
@ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/Y6bIX/src/perform_step/low_order_rk_perform_step.jl:792
[18] __init(prob::ODEProblem{Vector{ComplexF64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, SciMLBase.AutoSpecialize, FunctionWrappersWrappers.FunctionWrappersWrapper{Tuple{FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{ComplexF64}, Vector{ComplexF64}, Vector{Float64}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Float64}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{ComplexF64}, Vector{Float64}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Float64}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}}, false}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, Vector{Symbol}, ModelingToolkit.var\"#661#generated_observed#561\"{Bool, ODESystem, Dict{Any, Any}, Vector{SymbolicUtils.BasicSymbolic{Parameter}}}, Nothing, ODESystem}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, alg::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, timeseries_init::Tuple{}, ts_init::Tuple{}, ks_init::Tuple{}, recompile::Type{Val{true}}; saveat::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, tstops::Tuple{}, d_discontinuities::Tuple{}, save_idxs::Nothing, save_everystep::Bool, save_on::Bool, save_start::Bool, save_end::Nothing, callback::Nothing, dense::Bool, calck::Bool, dt::Float64, dtmin::Nothing, dtmax::Float64, force_dtmin::Bool, adaptive::Bool, gamma::Rational{Int64}, abstol::Nothing, reltol::Nothing, qmin::Rational{Int64}, qmax::Int64, qsteady_min::Int64, qsteady_max::Int64, beta1::Nothing, beta2::Nothing, qoldinit::Rational{Int64}, controller::Nothing, fullnormalize::Bool, failfactor::Int64, maxiters::Float64, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), internalopnorm::typeof(LinearAlgebra.opnorm), isoutofdomain::typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), unstable_check::typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), verbose::Bool, timeseries_errors::Bool, dense_errors::Bool, advance_to_tstop::Bool, stop_at_next_tstop::Bool, initialize_save::Bool, progress::Bool, progress_steps::Int64, progress_name::String, progress_message::typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), progress_id::Symbol, userdata::Nothing, allow_extrapolation::Bool, initialize_integrator::Bool, alias_u0::Bool, alias_du0::Bool, initializealg::OrdinaryDiffEq.DefaultInit, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/Y6bIX/src/solve.jl:512
[19] __init (repeats 5 times)
@ ~/.julia/packages/OrdinaryDiffEq/Y6bIX/src/solve.jl:10 [inlined]
[20] __solve(::ODEProblem{Vector{ComplexF64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, SciMLBase.AutoSpecialize, FunctionWrappersWrappers.FunctionWrappersWrapper{Tuple{FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{ComplexF64}, Vector{ComplexF64}, Vector{Float64}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Float64}, Float64}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{ComplexF64}, Vector{Float64}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, FunctionWrappers.FunctionWrapper{Nothing, Tuple{Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Complex{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}, Vector{Float64}, ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ComplexF64}, ComplexF64, 1}}}}, false}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, Vector{Symbol}, ModelingToolkit.var\"#661#generated_observed#561\"{Bool, ODESystem, Dict{Any, Any}, Vector{SymbolicUtils.BasicSymbolic{Parameter}}}, Nothing, ODESystem}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:saveat, :maxiters), Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, Float64}}})
@ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/Y6bIX/src/solve.jl:5
[21] __solve
@ ~/.julia/packages/OrdinaryDiffEq/Y6bIX/src/solve.jl:1 [inlined]
[22] #solve_call#34
@ ~/.julia/packages/DiffEqBase/7s9cb/src/solve.jl:608 [inlined]
[23] solve_up(prob::ODEProblem{Vector{ComplexF64}, Tuple{Int64, Int64}, true, Vector{Float64}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var\"#k#551\"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var\"#_RGF_ModTag\", ModelingToolkit.var\"#_RGF_ModTag\", (0x63de109c, 0xb0fbb681, 0xdbe53fb8, 0x62e0b171, 0x07a772fe), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var\"#_RGF_ModTag\", ModelingToolkit.var\"#_RGF_ModTag\", (0x326c3d26, 0x763b6861, 0x4723a01a, 0xd9e7b48c, 0x9891ff5d), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, Vector{Symbol}, ModelingToolkit.var\"#661#generated_observed#561\"{Bool, ODESystem, Dict{Any, Any}, Vector{SymbolicUtils.BasicSymbolic{Parameter}}}, Nothing, ODESystem}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, sensealg::Nothing, u0::Vector{ComplexF64}, p::Vector{Float64}, args::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:saveat, :maxiters), Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, Float64}}})
@ DiffEqBase ~/.julia/packages/DiffEqBase/7s9cb/src/solve.jl:1057
[24] solve_up
@ ~/.julia/packages/DiffEqBase/7s9cb/src/solve.jl:1043 [inlined]
[25] solve(prob::ODEProblem{Vector{ComplexF64}, Tuple{Int64, Int64}, true, Vector{Float64}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var\"#k#551\"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var\"#_RGF_ModTag\", ModelingToolkit.var\"#_RGF_ModTag\", (0x63de109c, 0xb0fbb681, 0xdbe53fb8, 0x62e0b171, 0x07a772fe), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var\"#_RGF_ModTag\", ModelingToolkit.var\"#_RGF_ModTag\", (0x326c3d26, 0x763b6861, 0x4723a01a, 0xd9e7b48c, 0x9891ff5d), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, Vector{Symbol}, ModelingToolkit.var\"#661#generated_observed#561\"{Bool, ODESystem, Dict{Any, Any}, Vector{SymbolicUtils.BasicSymbolic{Parameter}}}, Nothing, ODESystem}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, args::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; sensealg::Nothing, u0::Nothing, p::Nothing, wrap::Val{true}, kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:saveat, :maxiters), Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, Float64}}})
@ DiffEqBase ~/.julia/packages/DiffEqBase/7s9cb/src/solve.jl:980
[26] top-level scope
@ ~/qbus-rc/basic_qbus.ipynb:1"
}
I'm trying to solve a problem with all-to-all coupling between different two-level systems, with the following parameters,
Some of my parameters are double-indexed,
I'm able to run all the definitions, including carrying out the meanfield equations,
After that, I run into two problems. First, when using
evaluate
,L
is not completely removed from the equations and I have to include it in the variable map.Second, and more severe, I get and
UndefVarErrror
when I try to run solve the resultingODESystem
,When I try to solve
prob
I get an error,I suspect I may be doing something wrong in the assignment of the values in
value_map
, but I'm not sure what I'm doing wrong.Note that I've only used
L=2
for testing purposes, so I can't just define my parameters explicitly and have to use theIndexedOperator
scheme.Full error trace: