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

[Feature]: Global Trajectory Parameters #37

Closed
3 tasks done
jack-champagne opened this issue May 6, 2024 · 1 comment · Fixed by #41
Closed
3 tasks done

[Feature]: Global Trajectory Parameters #37

jack-champagne opened this issue May 6, 2024 · 1 comment · Fixed by #41
Assignees
Labels
enhancement New feature or request unitaryhack issue Issue is bountied for unitaryhack hackathon

Comments

@jack-champagne
Copy link
Collaborator

jack-champagne commented May 6, 2024

Feature Description

Oten in trajectories there will be a decision variable that works globally on the problem as a parameter.

Some examples are (specific to Quantum Control trajectories):

  • $\alpha$, $\beta$ parameters of some virtual Z gate
  • Carrier frequency for time dependent Hamiltonian

Global parameters shall be stored as vectors in a named tuple, in order that the values may be mutable. The params field should be added to the NamedTrajecotry struct with the type signature

params::NamedTuple{pnames, <:Tuple{Vararg{AbstractVector{R}}}} where pnames

These global parameters would ideally be exposed via some interface like the following:

# some global params as a NamedTuple
params = (
   α = rand(1),
   β = rand(1)
)

# build trajectory (with params as an optional arg)
traj = NamedTrajectory(components; timestep=dt, controls=:u, params=params)

# gives params back as NamedTuple
traj.params
# (α = [0.12], β = [0.39])
)

Implementation requirements

  • add params field to struct and constructor methods in src/struct_named_trajectory.jl
  • add a test file test_constructors.jl to the test dir that creates a simple NamedTrajectory with params. see test/test_methods.jl for reference.
  • add a docs script to docs/literate/man that goes through a simple example (can be identical to what is in the test file, with some exposition)

Importance

1 (lowest)

What does this feature affect?

  • construction
  • methods
  • documentation
@jack-champagne jack-champagne added the enhancement New feature or request label May 6, 2024
@jack-champagne jack-champagne changed the title [Feature]: Global Trajectory Parameters 1[Feature]: Global Trajectory Parameters May 6, 2024
@jack-champagne jack-champagne changed the title 1[Feature]: Global Trajectory Parameters \Feature]: Global Trajectory Parameters May 6, 2024
@jack-champagne jack-champagne changed the title \Feature]: Global Trajectory Parameters [Feature]: Global Trajectory Parameters May 6, 2024
@aarontrowbridge aarontrowbridge added the unitaryhack issue Issue is bountied for unitaryhack hackathon label May 30, 2024
@ErikQQY
Copy link
Contributor

ErikQQY commented Jun 6, 2024

This issue need assignment so that unitaryhack can locate contributor, related pull requests: #41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request unitaryhack issue Issue is bountied for unitaryhack hackathon
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants