kestrelquantum / QuantumCollocation.jl

Quantum Optimal Control with Direct Collocation
MIT License
29 stars 7 forks source link

[Feature]: Embedded operators for control problems and fidelity #115

Open andgoldschmidt opened 4 months ago

andgoldschmidt commented 4 months ago

What happened?

There is no subspace information in a control problem.

Consider a three level transmon

η = -0.2
a = annihilate(3)
sys = QuantumSystem(η / 2 * a'*a'*a*a, [(a + a') / 2, -im*(a - a') / 2])

and solve a control problem with an embedded operator

T = 50
Δt = 0.2
U_goal = EmbeddedOperator(GATES[:X], sys)
prob = UnitarySmoothPulseProblem(sys, U_goal, T,  Δt)

The fidelity is not computed in the subspace by default:

|julia> unitary_fidelity(prob)
0.6666...
|julia> unitary_fidelity(prob, subspace=get_subspace_indices(1:2, 3))
0.9999...

Version

stable release

What does this bug affect?

Other information

No response

andgoldschmidt commented 4 months ago

My preferred solution would be to add U_goal to the fields of

mutable struct QuantumControlProblem <: AbstractProblem
...

in problems.jl, then make the adaptations to unitary_fidelity, and add appropriate tests to preserve this behavior.

andgoldschmidt commented 3 months ago

Two utilities that would benefit from this change:

  1. unitary_fidelity
  2. is_reachable