Skip to content

Latest commit

 

History

History
116 lines (101 loc) · 4.54 KB

README.md

File metadata and controls

116 lines (101 loc) · 4.54 KB
Documentation
Stable Dev arXiv
Build Status
Build Status Coverage
License
MIT License
Support
Unitary Fund
Quickly set up and solve problem templates for quantum optimal control

QuantumCollocation.jl

QuantumCollocation.jl sets up and solves quantum control problems as nonlinear programs (NLPs). In this context, a generic quantum control problem looks like

$$\begin{aligned} \arg \min_{\mathbf{Z}}\quad & J(\mathbf{Z}) \\\ \nonumber \text{s.t.}\qquad & \mathbf{f}(\mathbf{Z}) = 0 \\\ \nonumber & \mathbf{g}(\mathbf{Z}) \le 0 \end{aligned}$$

where $\mathbf{Z}$ is a trajectory containing states and controls, from NamedTrajectories.jl.

Problem Templates

Problem Templates are reusable design patterns for setting up and solving common quantum control problems.

For example, a UnitarySmoothPulseProblem is tasked with generating a pulse sequence $a_{1:T-1}$ in orderd to minimize infidelity, subject to constraints from the Schroedinger equation,

$$\begin{aligned} \arg \min_{\mathbf{Z}}\quad & |1 - \mathcal{F}(U_T, U_\text{goal})| \\\ \nonumber \text{s.t.} \qquad & U_{t+1} = \exp\{- i H(a_t) \Delta t_t \} U_t, \quad \forall\, t \\\ \end{aligned}$$

while a UnitaryMinimumTimeProblem minimizes time and constrains fidelity,

$$\begin{aligned} \arg \min_{\mathbf{Z}}\quad & \sum_{t=1}^T \Delta t_t \\\ \qquad & U_{t+1} = \exp\{- i H(a_t) \Delta t_t \} U_t, \quad \forall\, t \\\ \nonumber & \mathcal{F}(U_T, U_\text{goal}) \ge 0.9999 \end{aligned}$$

In each case, 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 🙌!

Problem templates give 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.

Installation

This package is registered! To install, enter the Julia REPL, type ] to enter pkg mode, and then run:

pkg> add QuantumCollocation

Example

Single Qubit Hadamard Gate

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)