kestrelquantum / NamedTrajectories.jl

Efficient Handling of Trajectories with User Defined Named Components
MIT License
6 stars 4 forks source link

[Feature]: Global Trajectory Parameters #37

Closed jack-champagne closed 1 month ago

jack-champagne commented 2 months ago

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):

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

Importance

1 (lowest)

What does this feature affect?

ErikQQY commented 1 month ago

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