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)
u = 0.1 * randn(length(H_drives), length(ts))
2×100 Matrix{Float64}:
  0.0441478  0.123984    0.0742032  …  0.189745   0.155798   -0.141804
 -0.115243   0.0336433  -0.0501886     0.0471434  0.0447096  -0.0923738

Now we will generate the unitaries

Us = exp.(-im * [(H_drift + sum(u[:, 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
        u = u,
        Δt = fill(Δt, N)
    );
    controls = :u,
    timestep = :Δt
)
N = 100, (Ũ⃗ = 1:8, u = 9:10, → Δt = 11:11)

Finally we will plot the populations

plot_unitary_populations(traj)
Example block output

We can also only plot the first column (or any other subset of columns)

plot_unitary_populations(traj; unitary_columns=[1])
Example block output

This page was generated using Literate.jl.