QuantumCollocation.jl sets up and solves quantum control problems as nonlinear programs (NLPs). In this context, a generic quantum control problem looks like
where
For details of our implementation please see our IEEE QCE 2023 paper, Direct Collocation for Quantum Optimal Control. If you use QuantumCollocation.jl in your work, please cite 🙌!
This package is registered! To install, enter the Julia REPL, type ]
to enter pkg mode, and then run:
pkg> add QuantumCollocation
using QuantumCollocation
T = 50
Δt = 0.2
system = QuantumSystem([PAULIS[:X], PAULIS[:Y]])
U_goal = GATES.H
# Hadamard Gate
prob = UnitarySmoothPulseProblem(system, U_goal, T, Δt)
solve!(prob, max_iter=100)
This package uses a Documenter config that is shared with many of our other repositories. To build the docs, you will need to run the docs setup script to clone and pull down the utility.
# first time only
./docs/get_docs_utils.sh # or ./get_docs_utils.sh if cwd is in ./docs/
To build the docs pages:
julia --project=docs docs/make.jl
or editing the docs live:
julia --project=docs
> using LiveServer, QuantumCollocation, Revise
> servedocs(literate_dir="docs/literate", skip_dirs=["docs/src/generated"])
Note:
servedocs
needs to watch a subset of the files in thedocs/
folder. If it watches files that are generated on a docs build/re-build,servedocs
will continuously try to re-serve the pages.To prevent this, ensure all generated files are included in the skip dirs or skip files args for
servedocs
.
For example, if we forget docs/src/generated like so:
julia --project=docs
> using LiveServer, Piccolo, Revise
> servedocs(literate_dir="docs/literate")
it will not build and serve.