QuantumCollocation.jl
QuantumCollocation.jl copied to clipboard
[Bug]: Objective constructors have bad initial keyword args
What happened?
function QuadraticSmoothnessRegularizer(;
name::Symbol=nothing,
times::AbstractVector{Int}=1:traj.T,
R::AbstractVector{<:Real}=ones(traj.dims[name]),
eval_hessian=true
)
and
function QuadraticRegularizer(;
name::Symbol=nothing,
times::AbstractVector{Int}=1:traj.T,
dim::Int=nothing,
R::AbstractVector{<:Real}=ones(traj.dims[name]),
values::Union{Nothing,AbstractArray{<:Real}}=nothing,
eval_hessian=true,
timestep_symbol=:Δt
)
are an example of the bug. These interfaces are not usually called, but still the interface of these objectives should be adjusted.
Version
stable release
What does this bug affect?
- [ ] quantum system construction
- [X] problem setup
- [ ] problem solution
- [ ] problem performance
- [ ] solution analysis
- [ ] plotting
- [ ] documentation
- [ ] tests
- [ ] other (please specify below)
Other information
No response
For now, the fix should be to set default args to nothing, with their types declared as Unions with nothing so that the asserts print.
Fixed by migration to DirectTrajOpt.jl, #189