Closed bobisnot closed 1 year ago
Hey @bobisnot,
Thanks for posting this issue.
It looks like some of the arguments to Objective
do not have the expected type.
Typically, the coloring in the Julia REPL gives you a lot of information about which arguments match the types from the "closest candidates" (white) and which do not (red). Using this, can you provide information about which arguments don't have the correct type?
REPL shows that the following arguments (marked in codeblocks) do not match. I'm not sure what the issue is though.
ERROR: MethodError: no method matching (Objective{QuadraticCost{n, m, T, SizedMatrix{n, n, T, 2, TData} where TData<:AbstractMatrix{T}, SizedMatrix{m, m, T, 2, TData} where TData<:AbstractMatrix{T}}} where {n, m, T})(
::Objective{QuadraticCost{11, 1, Float64, SizedMatrix{11, 11, Float64, 2, Matrix{Float64}}, SizedMatrix{1, 1, Float64, 2, Matrix{Float64}}}}
, ::Model)
Closest candidates are:
(Objective{QuadraticCost{n, m, T, SizedMatrix{n, n, T, 2, TData} where TData<:AbstractMatrix{T}, SizedMatrix{m, m, T, 2, TData} where TData<:AbstractMatrix{T}}} where {n, m, T})(
::Objective{QuadraticCost{n, m, T, SizedMatrix{n, n, T, 2, TData} where TData<:AbstractMatrix{T}, SizedMatrix{m, m, T, 2, TData} where TData<:AbstractMatrix{T}}} where {n, m, T}
, ::AbstractModel) at ~/.julia/packages/TrajectoryOptimization/gPd37/src/objective.jl:85
Hey @tpr0p , sorry for the bump, I just had another question: Looking into the code a bit, is there a particular reason the XPI gate is written as [0 -im; -im 0] as opposed to just [0 1; 1 0]? Does this global phase help the optimizer somehow? Coderef: https://github.com/SchusterLab/rbqoc/blob/master/src/spin/spin.jl#L319
Thanks!
@bobisnot No worries, happy to answer any questions. Unfortunately, I haven't had time to help debug your error. Regarding the gate, see the Rx(theta) definition https://www.quantum-inspire.com/kbase/rx-gate/. Note that Rx(theta) = e^{i \theta X} where X is the Pauli matrix you're familiar with [0 1; 1 0]. The optimizer is phase sensitive, so if you're trying to do a simple state transfer, picking the correct phase will make a difference in the minimum time required to complete that operation.
closing due to inactivity. feel free to reopen the issue if this didn’t resolve it
I'm also trying to run the optimization for spin13.jl, got the same error in lu.jl which was fixed by adding the codeblock you provided. However, I am now getting the following issue:
Is there any way to fix this? Thanks!
Originally posted by @bobisnot in https://github.com/SchusterLab/rbqoc/issues/5#issuecomment-1334411654