Variational Quantum Systems
using PiccoloQuantumObjects
using SparseArrays # for visualizationVariational Quantum Systems
The VariationalQuantumSystem type is used for sensitivity and robustness analysis of quantum control protocols. It allows exploring how the dynamics change under perturbations to the Hamiltonian.
Variational systems are parameterized by variational operators that represent directions of uncertainty or perturbation in the system:
\[H_{\text{perturbed}}(\alpha) = H(\alpha) + \sum_i \epsilon_i H_{\text{var}}^{(i)}\]
where $\alpha$ represents the control parameters and $\epsilon_i$ are perturbation magnitudes.
PiccoloQuantumObjects.QuantumSystems.VariationalQuantumSystem — Type
VariationalQuantumSystem <: AbstractQuantumSystemA struct for storing variational quantum dynamics, used for sensitivity and robustness analysis.
Variational systems allow exploring how the dynamics change under perturbations to the Hamiltonian. The variational operators represent directions of uncertainty or perturbation in the system.
Fields
H::Function: The Hamiltonian function: (u, t) -> H(u, t)G::Function: The isomorphic generator function: (u, t) -> G(u, t)G_vars::AbstractVector{<:Function}: Variational generator functions, one for each perturbation directionT_max::Float64: Maximum evolution timedrive_bounds::Vector{Tuple{Float64, Float64}}: Drive amplitude boundsn_drives::Int: The number of control drives in the systemlevels::Int: The number of levels (dimension) in the system
See also QuantumSystem, OpenQuantumSystem.
Create a variational system with X and Y as both drives and variational directions.
H_drift = 0.0 * PAULIS[:Z] # No drift
H_drives = [PAULIS[:X], PAULIS[:Y]]
H_vars = [PAULIS[:X], PAULIS[:Y]]
T_max = 10.0
drive_bounds = [(-1.0, 1.0), (-1.0, 1.0)]
varsys = VariationalQuantumSystem(H_drift, H_drives, H_vars, T_max, drive_bounds)VariationalQuantumSystem: levels = 2, n_drives = 2The system has 2 drives and 2 variational operators.
varsys.n_drives2length(varsys.G_vars)2Check Tmax and drivebounds.
varsys.T_max10.0varsys.drive_bounds2-element Vector{Tuple{Float64, Float64}}:
(-1.0, 1.0)
(-1.0, 1.0)Variational operators
Variational systems compute the isomorphic generator G along with variational generators G_vars for sensitivity analysis. These can be used to study how the system dynamics change under perturbations.
Evaluate the generator at specific control values.
control_params = [1.0, 0.5]
G = varsys.G(control_params)
G |> sparse4×4 SparseArrays.SparseMatrixCSC{Float64, Int64} with 8 stored entries:
⋅ -0.5 ⋅ 1.0
0.5 ⋅ 1.0 ⋅
⋅ -1.0 ⋅ -0.5
-1.0 ⋅ 0.5 ⋅ Get the first variational generator.
G_var_1 = varsys.G_vars[1](control_params)
G_var_1 |> sparse4×4 SparseArrays.SparseMatrixCSC{Float64, Int64} with 4 stored entries:
⋅ ⋅ ⋅ 1.0
⋅ ⋅ 1.0 ⋅
⋅ -1.0 ⋅ ⋅
-1.0 ⋅ ⋅ ⋅ Get the second variational generator.
G_var_2 = varsys.G_vars[2](control_params)
G_var_2 |> sparse4×4 SparseArrays.SparseMatrixCSC{Float64, Int64} with 4 stored entries:
⋅ -1.0 ⋅ ⋅
1.0 ⋅ ⋅ ⋅
⋅ ⋅ ⋅ -1.0
⋅ ⋅ 1.0 ⋅ Use cases
Variational quantum systems are particularly useful for:
- Sensitivity analysis: Understanding how control imperfections affect gate fidelities
- Robustness optimization: Designing controls that are robust to parameter uncertainties
- Error modeling: Incorporating known sources of systematic error in control optimization
You can create a variational system with no drift Hamiltonian by omitting H_drift:
varsys = VariationalQuantumSystem(H_drives, H_vars, T_max, drive_bounds)Create a variational system with only drive and variational operators.
varsys_nodrift = VariationalQuantumSystem([PAULIS[:X], PAULIS[:Y]], [PAULIS[:Z]], 10.0, [1.0, 1.0])
varsys_nodrift.n_drives2length(varsys_nodrift.G_vars)1Functional variational systems
For more complex scenarios, variational systems can be constructed from functions rather than explicit matrix operators:
Create a variational system using Hamiltonian functions.
H_func = a -> a[1] * PAULIS[:X] + a[2] * PAULIS[:Y]
H_var_funcs = [
a -> a[1] * PAULIS[:X], # Sensitivity to X scaling
a -> PAULIS[:Z] # Sensitivity to Z perturbation
]
varsys_func = VariationalQuantumSystem(H_func, H_var_funcs, 2, 10.0, [1.0, 1.0])VariationalQuantumSystem: levels = 2, n_drives = 2The functional system behaves similarly.
varsys_func.n_drives2length(varsys_func.G_vars)2This page was generated using Literate.jl.