From 156732bc3c06305b2c9e250f8bd9c872412613c1 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Wed, 5 Jun 2024 17:43:25 +0000 Subject: [PATCH] build based on 88c5ef1 --- dev/.documenter-siteinfo.json | 2 +- dev/contribution_guide/index.html | 2 +- dev/generated/examples/multilevel_transmon/index.html | 6 +++--- dev/generated/man/losses/index.html | 2 +- dev/generated/man/problem_templates/index.html | 2 +- dev/generated/man/utils/index.html | 2 +- dev/generated/quickstart/index.html | 6 +++--- dev/index.html | 2 +- dev/lib/index.html | 2 +- dev/release_notes/index.html | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 0ed21919..2fb97664 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-06-05T17:35:43","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-06-05T17:43:20","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/dev/contribution_guide/index.html b/dev/contribution_guide/index.html index 24554721..bd3a2914 100644 --- a/dev/contribution_guide/index.html +++ b/dev/contribution_guide/index.html @@ -12,4 +12,4 @@ solve!(prob, max_iter=100) @test unitary_fidelity(prob) > 0.99 -end

Individual tests will populate in the Testing panel in VSCode. All tests are integrated into the base test system for CI, which occurs at each PR submission.

We organize our tests in two ways:

  1. Modules in single files (e.g. quantum_utils.jl, direct_sums.jl) should have a single test file in the test/ directory.
  2. Module directories containing templates (e.g. quantum_system_templates/, problem_templates/) should include tests in the same file that the template is defined, so problem_templates/unitary_smooth_pulse_problem.jl includes the test items for UnitarySmoothPulseProblem.

Reporting Issues

Issue templates are available on GitHub. We are happy to take feature requests!

+end

Individual tests will populate in the Testing panel in VSCode. All tests are integrated into the base test system for CI, which occurs at each PR submission.

We organize our tests in two ways:

  1. Modules in single files (e.g. quantum_utils.jl, direct_sums.jl) should have a single test file in the test/ directory.
  2. Module directories containing templates (e.g. quantum_system_templates/, problem_templates/) should include tests in the same file that the template is defined, so problem_templates/unitary_smooth_pulse_problem.jl includes the test items for UnitarySmoothPulseProblem.

Reporting Issues

Issue templates are available on GitHub. We are happy to take feature requests!

diff --git a/dev/generated/examples/multilevel_transmon/index.html b/dev/generated/examples/multilevel_transmon/index.html index 870df23b..dce76f93 100644 --- a/dev/generated/examples/multilevel_transmon/index.html +++ b/dev/generated/examples/multilevel_transmon/index.html @@ -158,7 +158,7 @@ Number of equality constraint Jacobian evaluations = 51 Number of inequality constraint Jacobian evaluations = 0 Number of Lagrangian Hessian evaluations = 50 -Total seconds in IPOPT = 17.227 +Total seconds in IPOPT = 16.818 EXIT: Maximum Number of Iterations Exceeded.

Let's look at the fidelity in the subspace

println("Fidelity: ", unitary_fidelity(prob; subspace=op.subspace_indices))
Fidelity: 0.9999842782034291

and plot the result using the plot_unitary_populations function.

plot_unitary_populations(prob; fig_size=(900, 700))
Example block output

Leakage suppresion

As can be seen from the above plot, there is a substantial amount of leakage into the higher levels during the evolution. To mitigate this, we have implemented the ability to add a cost to populating the leakage levels, in particular this is an $L_1$ norm cost, which is implemented via slack variables and should ideally drive those leakage populations down to zero. To implement this, pass leakage_suppresion=true and R_leakage={value} to the UnitarySmoothPulseProblem template.

# create the a leakage suppression problem, initializing with the previous solution
 
@@ -271,6 +271,6 @@
 Number of equality constraint Jacobian evaluations   = 51
 Number of inequality constraint Jacobian evaluations = 0
 Number of Lagrangian Hessian evaluations             = 50
-Total seconds in IPOPT                               = 3.975
+Total seconds in IPOPT                               = 3.348
 
-EXIT: Maximum Number of Iterations Exceeded.

Let's look at the fidelity in the subspace

println("Fidelity: ", unitary_fidelity(prob_leakage; subspace=op.subspace_indices))
Fidelity: 0.999884421231116

and plot the result using the plot_unitary_populations function.

plot_unitary_populations(prob_leakage; fig_size=(900, 700))
Example block output

Here we can see that the leakage populations have been driven substantially down.


This page was generated using Literate.jl.

+EXIT: Maximum Number of Iterations Exceeded.

Let's look at the fidelity in the subspace

println("Fidelity: ", unitary_fidelity(prob_leakage; subspace=op.subspace_indices))
Fidelity: 0.999884421231116

and plot the result using the plot_unitary_populations function.

plot_unitary_populations(prob_leakage; fig_size=(900, 700))
Example block output

Here we can see that the leakage populations have been driven substantially down.


This page was generated using Literate.jl.

diff --git a/dev/generated/man/losses/index.html b/dev/generated/man/losses/index.html index 4ce362b3..1c13a778 100644 --- a/dev/generated/man/losses/index.html +++ b/dev/generated/man/losses/index.html @@ -2,4 +2,4 @@ Losses · QuantumCollocation.jl

Losses

Unitary Losses

QuantumCollocation.Losses.isovec_unitary_fidelityFunction
isovec_unitary_fidelity(Ũ::AbstractVector, Ũgoal::AbstractVector)

Returns the fidelity between the isomorphic unitary $\vec{\widetilde{U}} \sim U \in SU(n)$ and the isomorphic goal unitary $\vec{\widetilde{U}}_{\text{goal}}$.

\[\begin{aligned} \mathcal{F}(\vec{\widetilde{U}}, \vec{\widetilde{U}}_{\text{goal}}) &= \frac{1}{n} \abs{\tr \qty(U_{\text{goal}}^\dagger U)} \\ &= \frac{1}{n} \sqrt{T_R^{2} + T_I^{2}} -\end{aligned}\]

where $T_R = \langle \vec{\widetilde{U}}_{\text{goal}, R}, \vec{\widetilde{U}}_R \rangle + \langle \vec{\widetilde{U}}_{\text{goal}, I}, \vec{\widetilde{U}}_I \rangle$ and $T_I = \langle \vec{\widetilde{U}}_{\text{goal}, R}, \vec{\widetilde{U}}_I \rangle - \langle \vec{\widetilde{U}}_{\text{goal}, I}, \vec{\widetilde{U}}_R \rangle$.

source

This page was generated using Literate.jl.

+\end{aligned}\]

where $T_R = \langle \vec{\widetilde{U}}_{\text{goal}, R}, \vec{\widetilde{U}}_R \rangle + \langle \vec{\widetilde{U}}_{\text{goal}, I}, \vec{\widetilde{U}}_I \rangle$ and $T_I = \langle \vec{\widetilde{U}}_{\text{goal}, R}, \vec{\widetilde{U}}_I \rangle - \langle \vec{\widetilde{U}}_{\text{goal}, I}, \vec{\widetilde{U}}_R \rangle$.

source

This page was generated using Literate.jl.

diff --git a/dev/generated/man/problem_templates/index.html b/dev/generated/man/problem_templates/index.html index 91f85915..1a302fd3 100644 --- a/dev/generated/man/problem_templates/index.html +++ b/dev/generated/man/problem_templates/index.html @@ -39,4 +39,4 @@ \text{ subject to } & \quad \vb{P}^{(n)}\qty(\vec{\tilde{U}}_{t+1}, \vec{\tilde{U}}_t, a_t, \Delta t_t) = 0 \\ & c(\vec{\tilde{U}}, a, \dot{a}, \ddot{a}) = 0 \\ & \quad \Delta t_{\text{min}} \leq \Delta t_t \leq \Delta t_{\text{max}} \\ -\end{aligned}\]

Arguments

Keyword Arguments

source

This page was generated using Literate.jl.

+\end{aligned}\]

Arguments

Keyword Arguments

source

This page was generated using Literate.jl.

diff --git a/dev/generated/man/utils/index.html b/dev/generated/man/utils/index.html index 4b124bad..6a3f08a5 100644 --- a/dev/generated/man/utils/index.html +++ b/dev/generated/man/utils/index.html @@ -1,2 +1,2 @@ -Utilities · QuantumCollocation.jl
+Utilities · QuantumCollocation.jl
diff --git a/dev/generated/quickstart/index.html b/dev/generated/quickstart/index.html index 839aea46..7bf5a662 100644 --- a/dev/generated/quickstart/index.html +++ b/dev/generated/quickstart/index.html @@ -109,7 +109,7 @@ Number of equality constraint Jacobian evaluations = 31 Number of inequality constraint Jacobian evaluations = 0 Number of Lagrangian Hessian evaluations = 30 -Total seconds in IPOPT = 1.819 +Total seconds in IPOPT = 1.745 EXIT: Maximum Number of Iterations Exceeded.

The above output comes from the Ipopt.jl solver. To see the final fidelity we can use the unitary_fidelity function exported by QuantumCollocation.jl.

println("Final fidelity: ", unitary_fidelity(prob))
Final fidelity: 0.9999999856466126

We can also easily plot the solutions using the plot function exported by NamedTrajectories.jl.

plot(prob.trajectory, [:Ũ⃗, :a])
Example block output

Minimum Time Problems

We can also easily set up and solve a minimum time problem, where we enforce a constraint on the final fidelity:

\[\mathcal{F}(U_T, U_{\text{goal}}) \geq \mathcal{F}_{\text{min}}\]

Using the problem we just solved we can do the following:

# final fidelity constraint
 final_fidelity = 0.99
@@ -200,7 +200,7 @@
 Number of equality constraint Jacobian evaluations   = 31
 Number of inequality constraint Jacobian evaluations = 31
 Number of Lagrangian Hessian evaluations             = 30
-Total seconds in IPOPT                               = 6.113
+Total seconds in IPOPT                               = 5.910
 
 EXIT: Maximum Number of Iterations Exceeded.

We can see that the final fidelity is indeed greater than the minimum fidelity we set.

println("Final fidelity:    ", unitary_fidelity(prob_min_time))
Final fidelity:    0.8701471114054447

and that the duration of the pulse has decreased.

initial_dur = get_times(prob.trajectory)[end]
 min_time_dur = get_times(prob_min_time.trajectory)[end]
@@ -209,4 +209,4 @@
 println("Minimum duration:  ", min_time_dur)
 println("Duration decrease: ", initial_dur - min_time_dur)
Initial duration:  11.340642303998557
 Minimum duration:  6.436133149104498
-Duration decrease: 4.9045091548940585

We can also plot the solutions for the minimum time problem.

plot(prob_min_time.trajectory, [:Ũ⃗, :a])
Example block output

This page was generated using Literate.jl.

+Duration decrease: 4.9045091548940585

We can also plot the solutions for the minimum time problem.

plot(prob_min_time.trajectory, [:Ũ⃗, :a])
Example block output

This page was generated using Literate.jl.

diff --git a/dev/index.html b/dev/index.html index 6dbf0e83..f85b9fca 100644 --- a/dev/index.html +++ b/dev/index.html @@ -6,4 +6,4 @@ f(U_{t+1}, U_t, a_t, \Delta t_t) &= U_{t+1} - \exp(-i \Delta t_t H(a_t)) U_t \\ &\approx U_{t+1} - B^{-1}(a_t, \Delta t_t) F(a_t, \Delta t_t) U_t \\ &= B(a_t, \Delta t_t) U_{t+1} - F(a_t, \Delta t_t) U_t \\ -\end{aligned}\]

where $B(a_t)$ and $F(a_t)$ are the backward and forward Pade operators and are just polynomials in $H(a_t)$.

This implementation is possible because direct collocation allows for the dynamics to be implicit. Since numerically calculating matrix exponentials inherently requires an approximation – the Padé approximant is commonly used – utilizing this formulation significantly improves performance, as, at least here, no matrix inversion is required.

Index

+\end{aligned}\]

where $B(a_t)$ and $F(a_t)$ are the backward and forward Pade operators and are just polynomials in $H(a_t)$.

This implementation is possible because direct collocation allows for the dynamics to be implicit. Since numerically calculating matrix exponentials inherently requires an approximation – the Padé approximant is commonly used – utilizing this formulation significantly improves performance, as, at least here, no matrix inversion is required.

Index

diff --git a/dev/lib/index.html b/dev/lib/index.html index af2c16ee..1851dc94 100644 --- a/dev/lib/index.html +++ b/dev/lib/index.html @@ -9,4 +9,4 @@ H_drives::Vector{Matrix{<:Number}}; params=Dict{Symbol, Any}(), kwargs... -)::QuantumSystem

Constructs a QuantumSystem object from the drift and drive Hamiltonian terms.

source
QuantumCollocation.QuantumSystems.QuantumSystemCouplingType
QuantumSystemCoupling <: AbstractQuantumSystem
source
QuantumCollocation.QuantumSystems.GMethod
G(H::AbstractMatrix)::Matrix{Float64}

Returns the isomorphism of $-iH$:

\[G(H) = \widetilde{- i H} = \mqty(1 & 0 \\ 0 & 1) \otimes \Im(H) - \mqty(0 & -1 \\ 1 & 0) \otimes \Re(H)\]

where $\Im(H)$ and $\Re(H)$ are the imaginary and real parts of $H$ and the tilde indicates the standard isomorphism of a complex valued matrix:

\[\widetilde{H} = \mqty(1 & 0 \\ 0 & 1) \otimes \Re(H) + \mqty(0 & -1 \\ 1 & 0) \otimes \Im(H)\]

source
QuantumCollocation.QuantumSystems.HMethod
H(G::AbstractMatrix{<:Number})::Matrix{ComplexF64}

Returns the inverse of G(H) = iso(-iH), i.e. returns H

source

Integrators

QuantumCollocation.Integrators.UnitaryPadeIntegratorType
source
+)::QuantumSystem

Constructs a QuantumSystem object from the drift and drive Hamiltonian terms.

source
QuantumCollocation.QuantumSystems.QuantumSystemCouplingType
QuantumSystemCoupling <: AbstractQuantumSystem
source
QuantumCollocation.QuantumSystems.GMethod
G(H::AbstractMatrix)::Matrix{Float64}

Returns the isomorphism of $-iH$:

\[G(H) = \widetilde{- i H} = \mqty(1 & 0 \\ 0 & 1) \otimes \Im(H) - \mqty(0 & -1 \\ 1 & 0) \otimes \Re(H)\]

where $\Im(H)$ and $\Re(H)$ are the imaginary and real parts of $H$ and the tilde indicates the standard isomorphism of a complex valued matrix:

\[\widetilde{H} = \mqty(1 & 0 \\ 0 & 1) \otimes \Re(H) + \mqty(0 & -1 \\ 1 & 0) \otimes \Im(H)\]

source
QuantumCollocation.QuantumSystems.HMethod
H(G::AbstractMatrix{<:Number})::Matrix{ComplexF64}

Returns the inverse of G(H) = iso(-iH), i.e. returns H

source

Integrators

QuantumCollocation.Integrators.UnitaryPadeIntegratorType
source
diff --git a/dev/release_notes/index.html b/dev/release_notes/index.html index 38feaee1..1f747d92 100644 --- a/dev/release_notes/index.html +++ b/dev/release_notes/index.html @@ -1,2 +1,2 @@ -Release Notes · QuantumCollocation.jl
+Release Notes · QuantumCollocation.jl