Skip to content

aarontrowbridge/QuantumCollocation.jl

Repository files navigation

QuantumCollocation.jl

Documentation Build Status Support Paper License
Dev Build Status Coverage Unitary Fund arXiv License: MIT

QuantumCollocation.jl uses NamedTrajectories.jl to set up and solve direct collocation problems specific to quantum optimal control, i.e. generating a pulse sequence $a_{1:T-1}$ to drive a quantum system and realize a target gate $U_{\text{goal}}$. We formulate this problem as a nonlinear program (NLP) of the form

$$\begin{aligned} \underset{U, a, \Delta t}{\text{minimize}} & \quad \ell(U_T, U_{\text{goal}})\\\ \text{ subject to } & \quad U_{t+1} = \exp(-i \Delta t H(a_t)) U_t \end{aligned}$$

Where the dynamics between knot points $(U_t, a_t)$ and $(U_{t+1}, a_{t+1})$ are enforced as constraints on the states which are free variables in the solver; this optimization framework is called direct collocation. For details of our implementation please see our award-winning IEEE QCE 2023 paper, Direct Collocation for Quantum Optimal Control. If you use QuantumCollocation.jl in your work, please cite 🙌!

QuantumCollocation.jl gives the user the ability to add other constraints and objective functions to this problem and solve it efficiently using Ipopt.jl and MathOptInterface.jl under the hood.

⚠️ Notice ⚠️

This package is under active development and issues may arise -- please be patient and report any issues you find!

Installation

QuantumCollocation.jl is registered! To install:

using Pkg
Pkg.add(QuantumCollocation)

Examples

Single Qubit X-Gate

See the example script examples/scripts/single_qubit_gate.jl, which produces the following plot:

Single Qubit X-Gate