Quickstart Guide
Here is a simple example where we set up a NamedTrajectory
with some dummy data and plot populations of the columns of the unitary matrix. First we will load some of the necessary packages:
using CairoMakie
using NamedTrajectories
using PiccoloQuantumObjects
using PiccoloPlots
Next we will define some Hamiltonians
H_drives = [PAULIS[:Z], PAULIS[:Y]]
H_drift = PAULIS[:X]
2×2 Matrix{ComplexF64}:
0.0+0.0im 1.0+0.0im
1.0+0.0im 0.0+0.0im
Now we will generate some dummy control data
N = 100
Δt = 0.1
ts = 0:Δt:Δt*(N-1)
A = 0.1 * randn(length(H_drives), length(ts))
2×100 Matrix{Float64}:
0.155589 0.0558865 0.0712123 … -0.0457503 0.00342994 0.158942
-0.0027539 -0.0132332 0.0279598 0.17362 -0.00450658 -0.0705778
Now we will generate the unitaries
Us = exp.(-im * [(H_drift + sum(A[:, k] .* H_drives)) * ts[k] for k = 1:N])
Us[1]
2×2 Matrix{ComplexF64}:
1.0+0.0im 0.0+0.0im
0.0-0.0im 1.0+0.0im
And create the trajectory
traj = NamedTrajectory(
(
Ũ⃗ = hcat(operator_to_iso_vec.(Us)...), # here we store the isomorphisms
a = A,
Δt = ts
);
controls = :a,
timestep = :Δt
)
T = 100, (Ũ⃗ = 1:8, a = 9:10, → Δt = 11:11)
Finally we will plot the populations
plot_unitary_populations(traj)

We can also only plot the first column (or any other subset of columns)
plot_unitary_populations(traj; unitary_columns=[1])

This page was generated using Literate.jl.