Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Objective constructors have bad initial keyword args #68

Open
1 of 9 tasks
andgoldschmidt opened this issue Jan 24, 2024 · 1 comment
Open
1 of 9 tasks
Assignees
Labels
bug Something isn't working

Comments

@andgoldschmidt
Copy link
Member

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
  • problem setup
  • problem solution
  • problem performance
  • solution analysis
  • plotting
  • documentation
  • tests
  • other (please specify below)

Other information

No response

@andgoldschmidt andgoldschmidt added the bug Something isn't working label Jan 24, 2024
@andgoldschmidt andgoldschmidt self-assigned this Jan 24, 2024
@andgoldschmidt andgoldschmidt changed the title [Bug]: Quadratic objectives incorrectly reference NamedTrajectory in kwargs [Bug]: Objective constructors have bad initial keyword args May 6, 2024
@andgoldschmidt
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant