Skip to content

killianlutz/pyMagicarp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Forewords

This code is a proof of concept designed to solve a minimal-time transfer problem on the special unitary group $SU(d)$ applied to the control of driftless closed quantum systems, as detailled in Janković et al. (2025).

This code is written in the JAX ecosystem using Python version 3.14.0. The solver is based on a natural gradient descent in the discretize-then-optimize paradigm, also known as direct method.

Getting started

Open the terminal and run

git clone https://github.com/killianlutz/pyMagicarp.git

Create and activate a new virtual environment

python -m venv magicarp
source magicarp/bin/activate

Install the required packages

pip install -r requirements.txt

Run the optimizer

python -m scripts.main

This creates or overwrites the file ./sims/example.npz to store both the target gate and the optimal control.

Mathematical details

We are given $m$ orthonormal control Hamiltonians $H_1, \ldots, H_m$ generating the Lie algebra of $SU(d)$ and a target special unitary gate $U_{\mathrm{target}}$. We then optimize for the self-adjoint traceless matrix $g$ minimizing

$$T = \sqrt{\sum_{j=1}^m \mathrm{Tr}\left(H_{j}g\right)^2}$$

subject to the constraint that the solution $U_g(\cdot)$ of

$$\dot{U} = -\mathrm{i}\sum_{j=1}^m \mathrm{Re} \mathrm{Tr}\left(U^\dagger H_{j}U g\right)H_j U, \quad 0 < t < 1$$

starting at $U(0) = I$ reaches the target at time $t = 1$, that is $U_g(1) = U_{\mathrm{target}}$.

Caveats: at the moment, the solver only solves for a control $g$ such that $U_g(1) = U_{\mathrm{target}}$.

Troubleshooting

Feel free to reach out to me: Killian Lutz.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages