https://github.com/harmoniqs/quantumcollocation.jl
Quantum Optimal Control with Direct Collocation
https://github.com/harmoniqs/quantumcollocation.jl
direct-collocation julia optimal-control optimization quantum-computing quantum-optimal-control trajectory-optimization
Last synced: 6 months ago
JSON representation
Quantum Optimal Control with Direct Collocation
- Host: GitHub
- URL: https://github.com/harmoniqs/quantumcollocation.jl
- Owner: harmoniqs
- License: mit
- Created: 2023-02-09T21:13:27.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-06-23T04:42:06.000Z (7 months ago)
- Last Synced: 2025-06-23T05:31:52.362Z (7 months ago)
- Topics: direct-collocation, julia, optimal-control, optimization, quantum-computing, quantum-optimal-control, trajectory-optimization
- Language: Julia
- Homepage:
- Size: 94.5 MB
- Stars: 34
- Watchers: 6
- Forks: 14
- Open Issues: 37
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
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
```math
\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](https://github.com/harmoniqs/NamedTrajectories.jl).
For details of our implementation please see our IEEE QCE 2023 paper, [Direct Collocation for Quantum Optimal Control](https://arxiv.org/abs/2305.03261). If you use QuantumCollocation.jl in your work, please cite :raised_hands:!
## Installation
This package is registered! To install, enter the Julia REPL, type `]` to enter pkg mode, and then run:
```julia
pkg> add QuantumCollocation
```
## Example
### Single Qubit Hadamard Gate
```Julia
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)
```