|
1 | 1 | # # Problem Templates Overview |
2 | 2 |
|
3 | | -# QuantumCollocation.jl provides **8 problem templates** that cover common quantum optimal control scenarios. These templates make it easy to set up and solve problems without manually constructing objectives, constraints, and integrators. |
4 | | - |
| 3 | +# QuantumCollocation.jl provides **4 problem templates** that cover common quantum optimal control scenarios. These templates make it easy to set up and solve problems without manually constructing objectives, constraints, and integrators. |
5 | 4 | # ## Template Comparison |
6 | 5 |
|
7 | | -# | Template | State Type | Objective | Time | Use Case | |
8 | | -# |:---------|:-----------|:----------|:-----|:---------| |
9 | | -# | [`UnitarySmoothPulseProblem`](@ref) | Unitary | Minimize control effort + infidelity | Fixed | Standard gate synthesis with smooth pulses | |
10 | | -# | [`UnitaryMinimumTimeProblem`](@ref) | Unitary | Minimize duration | Variable | Fastest gate given fidelity constraint | |
11 | | -# | [`UnitarySamplingProblem`](@ref) | Unitary | Minimize control effort + infidelity | Fixed | Robust control over multiple systems | |
12 | | -# | [`UnitaryFreePhase Problem`](@ref) | Unitary | Minimize control effort + infidelity | Fixed | Gate synthesis with free global phase | |
13 | | -# | [`UnitaryVariationalProblem`](@ref) | Unitary | Minimize control effort + infidelity ± sensitivity | Fixed | Sensitivity/robustness to Hamiltonian terms | |
14 | | -# | [`QuantumStateSmoothPulseProblem`](@ref) | Ket | Minimize control effort + infidelity | Fixed | State transfer with smooth pulses | |
15 | | -# | [`QuantumStateMinimumTimeProblem`](@ref) | Ket | Minimize duration | Variable | Fastest state transfer | |
16 | | -# | [`QuantumStateSamplingProblem`](@ref) | Ket | Minimize control effort + infidelity | Fixed | Robust state transfer over multiple systems | |
17 | | - |
18 | | -# ## Key Differences |
19 | 6 |
|
20 | | -# ### Unitary vs Ket (Quantum State) |
21 | | -# - **Unitary problems**: Optimize gate operations (full unitary matrices), commonly used for universal quantum control |
22 | | -# - **Ket problems**: Optimize state-to-state transfers, useful for initialization and specific state preparation |
| 7 | +# | Template | Objective | Time | Use Case | |
| 8 | +# |:---------|:-----------|:-----|:---------| |
| 9 | +# | [`SmoothPulseProblem`](@ref) | Minimize control effort + infidelity | Fixed | Standard gate/state synthesis with smooth pulses | |
| 10 | +# | [`MinimumTimeProblem`](@ref) | Minimize duration | Variable | Fastest gate/state synthesis given fidelity constraint | |
| 11 | +# | [`SplinePulseProblem`](@ref) | Minimize control effort + infidelity | Fixed | Gate/state synthesis with spline-based pulses where the derivative variables (`du`) are the actual spline coefficients or slopes. | |
| 12 | +# | [`SamplingProblem`](@ref) | Minimize control effort + weighted sum of infidelity objectives | Fixed | Robust gate/state synthesis where the controls are shared across all systems, with differing dynamics. | |
23 | 13 |
|
24 | 14 | # ### Smooth Pulse vs Minimum Time |
25 | 15 | # - **Smooth Pulse**: Fixed total time `T × Δt`, minimizes control effort with regularization on `u`, `u̇`, `ü` |
|
30 | 20 | # - Useful for robustness against parameter uncertainties or manufacturing variations |
31 | 21 | # - Examples: different coupling strengths, detunings, or environmental conditions |
32 | 22 |
|
33 | | -# ### Free Phase & Variational |
34 | | -# - **Free Phase**: Optimizes global phase of target unitary (sometimes easier to reach) |
35 | | -# - **Variational**: Uses sensitivity analysis to find controls that are robust or sensitive to specific Hamiltonian terms |
36 | | - |
37 | 23 | # ## Quick Selection Guide |
38 | 24 |
|
39 | 25 | # **I want to implement a quantum gate:** |
40 | | -# - Start simple? → `UnitarySmoothPulseProblem` |
41 | | -# - Need speed? → `UnitaryMinimumTimeProblem` |
42 | | -# - Need robustness? → `UnitarySamplingProblem` |
| 26 | +# - Start simple? → [`SmoothPulseProblem`](@ref) + `UnitaryTrajectory` |
| 27 | +# - Need speed? → [`MinimumTimeProblem`](@ref) + `UnitaryTrajectory` |
| 28 | +# - Need robustness? → [`SamplingProblem`](@ref) + `UnitaryTrajectory` |
43 | 29 |
|
44 | 30 | # **I want to prepare a quantum state:** |
45 | | -# - Standard case? → `QuantumStateSmoothPulseProblem` |
46 | | -# - Speed critical? → `QuantumStateMinimumTimeProblem` |
47 | | -# - Robust preparation? → `QuantumStateSamplingProblem` |
48 | | - |
49 | | -# **I'm tuning my solution:** |
50 | | -# - Struggling with convergence? → Try `UnitaryFreePhase Problem` |
51 | | -# - Need parameter sensitivity? → Use `UnitaryVariationalProblem` |
| 31 | +# - Standard case? → [`SmoothPulseProblem`](@ref) + `KetTrajectory` |
| 32 | +# - Speed critical? → [`MinimumTimeProblem`](@ref) + `KetTrajectory` |
| 33 | +# - Robust preparation? → [`SamplingProblem`](@ref) + `KetTrajectory` |
52 | 34 |
|
53 | 35 | # ## Common Parameters |
54 | 36 |
|
55 | 37 | # All templates share these key parameters: |
56 | 38 |
|
57 | | -# ```julia |
58 | | -# prob = UnitarySmoothPulseProblem( |
59 | | -# system, # QuantumSystem defining H(u) |
60 | | -# U_goal, # Target unitary or state |
61 | | -# N, # Number of timesteps |
62 | | -# |
63 | | -# # Derivative bounds (smoothness) |
64 | | -# du_bound = 0.01, # |u̇| ≤ du_bound |
65 | | -# ddu_bound = 0.001, # |ü| ≤ ddu_bound |
66 | | -# |
67 | | -# # Regularization weights |
68 | | -# R_u = 0.01, # Penalize u² |
69 | | -# R_du = 0.01, # Penalize u̇² |
70 | | -# R_ddu = 0.01, # Penalize ü² |
71 | | -# |
72 | | -# # Initial guess |
73 | | -# u_guess = nothing, # Optional initial controls |
74 | | -# |
75 | | -# # Advanced options |
76 | | -# piccolo_options = PiccoloOptions(...) |
77 | | -# ) |
78 | | -# ``` |
| 39 | +using QuantumCollocation # hide |
| 40 | +using PiccoloQuantumObjects # hide |
| 41 | +H_drift = 0.1 * PAULIS.Z # hide |
| 42 | +H_drives = [PAULIS.X, PAULIS.Y] # hide |
| 43 | +drive_bounds = [1.0, 1.0] # hide |
| 44 | +sys = QuantumSystem(H_drift, H_drives, drive_bounds) # hide |
| 45 | +U_goal = GATES[:H] # hide |
| 46 | +T = 10.0 # hide |
| 47 | +qtraj = UnitaryTrajectory(sys, U_goal, T) # hide |
| 48 | +N = 51 # hide |
| 49 | + |
| 50 | +prob = SmoothPulseProblem( |
| 51 | + qtraj, # QuantumTrajectory wrapping system information, Unitary/Ket/MultiKet problem type |
| 52 | + N; # Number of timesteps |
| 53 | + |
| 54 | + Q=100.0, # Objective weighting coefficient for the infidelity |
| 55 | + R=1e-2, # Objective weighting coefficient for the controls regularization |
| 56 | + |
| 57 | + piccolo_options = PiccoloOptions(verbose = true), # PiccoloOptions for solver configuration |
| 58 | +) |
79 | 59 |
|
80 | 60 | # See the individual template pages for parameter details and examples. |
0 commit comments