Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core peeloff #173

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
f0af49e
moving otimes to isomorphisms
aarontrowbridge Nov 1, 2024
e7aacc4
manifest update
aarontrowbridge Nov 1, 2024
c0a550e
integrator signature refactor -- removes sys dependence
aarontrowbridge Nov 1, 2024
eeac85a
problem template fixes (tests passing)
aarontrowbridge Nov 1, 2024
f2dd861
moved isomorphisms to core
aarontrowbridge Nov 1, 2024
e634cc3
big rip
aarontrowbridge Nov 4, 2024
d07420d
big rip 2: quantum objects
aarontrowbridge Nov 6, 2024
e3412e4
traj init for unitary
andgoldschmidt Nov 6, 2024
c0cdbbf
state sampling problem template
andgoldschmidt Nov 6, 2024
d54f53c
refactored system to integrator interface
aarontrowbridge Nov 6, 2024
4708228
density operators
aarontrowbridge Nov 10, 2024
f66b443
traj init for unitary
andgoldschmidt Nov 6, 2024
c7bdccc
state sampling problem template
andgoldschmidt Nov 6, 2024
b69af1d
bug fix: a_guess option
andgoldschmidt Nov 7, 2024
c215e41
bug fix: free phase obj
andgoldschmidt Nov 7, 2024
edde00e
phase rollout fidelity
andgoldschmidt Nov 7, 2024
43e73d9
free phase initialization
andgoldschmidt Nov 7, 2024
f5d943e
Tests for free phases
andgoldschmidt Nov 9, 2024
2ab761f
free phase incr
andgoldschmidt Nov 9, 2024
b4d5eea
bug fix: mintime and robprob fidelity subspace
andgoldschmidt Nov 9, 2024
d26420c
bug fix: drop drive_sigma arg, fix subspace nothing
andgoldschmidt Nov 9, 2024
3a34581
problem template fixes (tests passing)
aarontrowbridge Nov 1, 2024
98800fd
big rip
aarontrowbridge Nov 4, 2024
1bdd6a4
refactored system to integrator interface
aarontrowbridge Nov 6, 2024
6705653
density operators
aarontrowbridge Nov 10, 2024
91fd3a5
rebase fixes (broken)
aarontrowbridge Nov 11, 2024
a6aae3b
Merge remote-tracking branch 'origin/main' into 163-feature-peel-off-…
aarontrowbridge Nov 11, 2024
c8621ac
rebase complete (fixes free phase loss)
aarontrowbridge Nov 11, 2024
bfb6ff8
docs uopdates
aarontrowbridge Nov 12, 2024
0d2efae
renaming OperatorType -> AbstractPiccoloOperator
aarontrowbridge Nov 19, 2024
560c857
adding quantum system templates + cleaning
aarontrowbridge Nov 19, 2024
fbcbb1b
update system type from AbstractQuantumSystem to OpenQuantumSystem an…
aarontrowbridge Dec 2, 2024
5c4d06f
refactor trajectory initialization to use density_to_iso_vec for init…
aarontrowbridge Dec 5, 2024
881e083
refactor rollout_fidelity to have sys as arg
aarontrowbridge Dec 23, 2024
eac5100
passing tests (except for direct sum prob)
aarontrowbridge Jan 6, 2025
cbeebbb
refactor add_suffix and remove_suffix functions to eliminate sys para…
aarontrowbridge Jan 9, 2025
5199435
bump version to 0.5.0 and update dependencies for compatibility
aarontrowbridge Jan 9, 2025
601cd2d
Merge branch 'main' into 163-feature-peel-off-core-functionality-into…
jack-champagne Jan 13, 2025
6107ce4
remove operatortype
jack-champagne Jan 13, 2025
09a3143
add back in zero initial and final
jack-champagne Jan 13, 2025
45b6d36
revert removing list of state names
jack-champagne Jan 13, 2025
f72f5fd
refactor callbacks and problem templates to use rollout fidelity and …
aarontrowbridge Jan 14, 2025
ae3a31f
update Project.toml dependencies and refactor drive length references…
aarontrowbridge Jan 14, 2025
19004b3
fix callbacks except for new tol
jack-champagne Jan 15, 2025
8211e7c
remove fidelity test from callback test suite - see PR comment #173
jack-champagne Jan 15, 2025
cc602dc
add qualified path for get_datavec
jack-champagne Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "QuantumCollocation"
uuid = "0dc23a59-5ffb-49af-b6bd-932a8ae77adf"
authors = ["Aaron Trowbridge <[email protected]> and contributors"]
version = "0.3.2"
version = "0.5.0"

[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Expand All @@ -11,13 +11,15 @@ Einsum = "b7d42ee7-0b51-5a75-98ca-779d3107e4c0"
ExponentialAction = "e24c0720-ea99-47e8-929e-571b494574d3"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
NamedTrajectories = "538bc3a1-5ab9-4fc3-b776-35ca1e893e08"
PiccoloQuantumObjects = "5a402ddf-f93c-42eb-975e-5582dcda653d"
PkgTemplates = "14b8a8f1-9102-5b29-a752-f990bacb7fe1"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
QuantumCollocationCore = "2b384925-53cb-4042-a8d2-6faa627467e1"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Expand All @@ -27,24 +29,29 @@ TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe"
TrajectoryIndexingUtils = "6dad8b7f-dd9a-4c28-9b70-85b9a079bfc8"

[compat]
BenchmarkTools = "1.5"
BenchmarkTools = "1.6"
CairoMakie = "0.12"
Distributions = "0.25"
Einsum = "0.4"
ExponentialAction = "0.2"
ForwardDiff = "0.10"
Interpolations = "0.15"
Ipopt = "1.6"
JLD2 = "0.5"
MathOptInterface = "1.31"
NamedTrajectories = "0.2.4"
LinearAlgebra = "1.10, 1.11"
MathOptInterface = "1.35"
NamedTrajectories = "0.2"
PiccoloQuantumObjects = "0.1"
PkgTemplates = "0.7"
ProgressMeter = "1.10"
QuantumCollocationCore = "0.1"
Random = "1.10, 1.11"
Reexport = "1.2"
Symbolics = "6.14"
SparseArrays = "1.10, 1.11"
Symbolics = "6.22"
TestItemRunner = "1.0"
TestItems = "1.0"
TrajectoryIndexingUtils = "0.1"
julia = "1.10"
julia = "1.10, 1.11"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
NamedTrajectories = "538bc3a1-5ab9-4fc3-b776-35ca1e893e08"
QuantumCollocation = "0dc23a59-5ffb-49af-b6bd-932a8ae77adf"
QuantumCollocationCore = "2b384925-53cb-4042-a8d2-6faa627467e1"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"

[compat]
Expand Down
4 changes: 2 additions & 2 deletions docs/literate/examples/multilevel_transmon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ solve!(prob; max_iter=50)

# Let's look at the fidelity in the subspace

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

# and plot the result using the `plot_unitary_populations` function.

Expand All @@ -96,7 +96,7 @@ solve!(prob_leakage; max_iter=50)

# Let's look at the fidelity in the subspace

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

# and plot the result using the `plot_unitary_populations` function.

Expand Down
8 changes: 4 additions & 4 deletions docs/literate/examples/two_qubit_gates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ prob = UnitarySmoothPulseProblem(
solve!(prob; max_iter=100)

## Let's take a look at the final fidelity
unitary_fidelity(prob)
unitary_rollout_fidelity(prob)

# Looks good!

Expand All @@ -124,7 +124,7 @@ min_time_prob = UnitaryMinimumTimeProblem(prob; final_fidelity=.99)

solve!(min_time_prob; max_iter=300)

unitary_fidelity(min_time_prob)
unitary_rollout_fidelity(min_time_prob)

# And let's plot this solution
plot_unitary_populations(min_time_prob)
Expand Down Expand Up @@ -176,7 +176,7 @@ prob = UnitarySmoothPulseProblem(
solve!(prob; max_iter=1_000)

## Let's take a look at the final fidelity
unitary_fidelity(prob)
unitary_rollout_fidelity(prob)

# Again, looks good!

Expand All @@ -190,7 +190,7 @@ min_time_prob = UnitaryMinimumTimeProblem(prob; final_fidelity=.999)

solve!(min_time_prob; max_iter=300)

unitary_fidelity(min_time_prob)
unitary_rollout_fidelity(min_time_prob)

# And let's plot this solution

Expand Down
4 changes: 2 additions & 2 deletions docs/literate/quickstart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ solve!(prob; max_iter=30)

# 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))
println("Final fidelity: ", unitary_rollout_fidelity(prob))

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

Expand Down Expand Up @@ -86,7 +86,7 @@ solve!(prob_min_time; max_iter=30)

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

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

# and that the duration of the pulse has decreased.

Expand Down
2 changes: 0 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ push!(LOAD_PATH, joinpath(@__DIR__, "..", "src"))

# DocMeta.setdocmeta!(QuantumCollocation, :DocTestSetup, :(using QuantumCollocation); recursive=true)

println("")

pages = [
"Home" => "index.md",
"Quickstart Guide" => "generated/quickstart.md",
Expand Down
4 changes: 2 additions & 2 deletions docs/src/generated/examples/multilevel_transmon.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ solve!(prob; max_iter=50)
Let's look at the fidelity in the subspace

````@example multilevel_transmon
println("Fidelity: ", unitary_fidelity(prob; subspace=op.subspace_indices))
println("Fidelity: ", unitary_rollout_fidelity(prob; subspace=op.subspace_indices))
````

and plot the result using the `plot_unitary_populations` function.
Expand Down Expand Up @@ -114,7 +114,7 @@ solve!(prob_leakage; max_iter=50)
Let's look at the fidelity in the subspace

````@example multilevel_transmon
println("Fidelity: ", unitary_fidelity(prob_leakage; subspace=op.subspace_indices))
println("Fidelity: ", unitary_rollout_fidelity(prob_leakage; subspace=op.subspace_indices))
````

and plot the result using the `plot_unitary_populations` function.
Expand Down
8 changes: 4 additions & 4 deletions docs/src/generated/examples/two_qubit_gates.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ prob = UnitarySmoothPulseProblem(
solve!(prob; max_iter=100)

# Let's take a look at the final fidelity
unitary_fidelity(prob)
unitary_rollout_fidelity(prob)
````

Looks good!
Expand All @@ -138,7 +138,7 @@ min_time_prob = UnitaryMinimumTimeProblem(prob; final_fidelity=.99)

solve!(min_time_prob; max_iter=300)

unitary_fidelity(min_time_prob)
unitary_rollout_fidelity(min_time_prob)
````

And let's plot this solution
Expand Down Expand Up @@ -194,7 +194,7 @@ prob = UnitarySmoothPulseProblem(
solve!(prob; max_iter=1_000)

# Let's take a look at the final fidelity
unitary_fidelity(prob)
unitary_rollout_fidelity(prob)
````

Again, looks good!
Expand All @@ -212,7 +212,7 @@ min_time_prob = UnitaryMinimumTimeProblem(prob; final_fidelity=.999)

solve!(min_time_prob; max_iter=300)

unitary_fidelity(min_time_prob)
unitary_rollout_fidelity(min_time_prob)
````

And let's plot this solution
Expand Down
4 changes: 2 additions & 2 deletions docs/src/generated/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ solve!(prob; max_iter=30)
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.

````@example quickstart
println("Final fidelity: ", unitary_fidelity(prob))
println("Final fidelity: ", unitary_rollout_fidelity(prob))
````

We can also easily plot the solutions using the `plot` function exported by NamedTrajectories.jl.
Expand Down Expand Up @@ -99,7 +99,7 @@ solve!(prob_min_time; max_iter=30)
We can see that the final fidelity is indeed greater than the minimum fidelity we set.

````@example quickstart
println("Final fidelity: ", unitary_fidelity(prob_min_time))
println("Final fidelity: ", unitary_rollout_fidelity(prob_min_time))
````

and that the duration of the pulse has decreased.
Expand Down
40 changes: 0 additions & 40 deletions docs/src/lib.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,6 @@ Modules = [QuantumCollocation.ProblemTemplates]
Modules = [QuantumCollocation.DirectSums]
```

## Quantum Object Utils
```@autodocs
Modules = [QuantumCollocation.QuantumObjectUtils]
```

## Quantum Systems
```@autodocs
Modules = [QuantumCollocation.QuantumSystems]
```

## Integrators
```@autodocs
Modules = [QuantumCollocation.Integrators]
```

## Objectives
```@autodocs
Modules = [QuantumCollocation.Objectives]
```

## Losses
```@autodocs
Modules = [QuantumCollocation.Losses]
```

## Embedded Operators
```@autodocs
Modules = [QuantumCollocation.EmbeddedOperators]
```

## Isomorphisms
```@autodocs
Modules = [QuantumCollocation.Isomorphisms]
```

## Options
```@autodocs
Modules = [QuantumCollocation.Options]
Expand All @@ -70,11 +35,6 @@ Modules = [QuantumCollocation.Rollouts]
Modules = [QuantumCollocation.SaveLoadUtils]
```

## Structure Utils
```@autodocs
Modules = [QuantumCollocation.StructureUtils]
```

## Trajectory Initialization
```@autodocs
Modules = [QuantumCollocation.TrajectoryInitialization]
Expand Down
58 changes: 4 additions & 54 deletions src/QuantumCollocation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,8 @@ module QuantumCollocation

using Reexport


include("options.jl")
@reexport using .Options

include("isomorphisms.jl")
@reexport using .Isomorphisms

include("quantum_object_utils.jl")
@reexport using .QuantumObjectUtils

include("structure_utils.jl")
@reexport using .StructureUtils

include("quantum_systems.jl")
@reexport using .QuantumSystems

include("quantum_system_templates/_quantum_system_templates.jl")
@reexport using .QuantumSystemTemplates

include("embedded_operators.jl")
@reexport using .EmbeddedOperators

include("quantum_system_utils.jl")
@reexport using .QuantumSystemUtils

include("losses/_losses.jl")
@reexport using .Losses

include("constraints/_constraints.jl")
@reexport using .Constraints

include("objectives/_objectives.jl")
@reexport using .Objectives

include("integrators/_integrators.jl")
@reexport using .Integrators

include("dynamics.jl")
@reexport using .Dynamics

include("evaluators.jl")
@reexport using .Evaluators

include("problems.jl")
@reexport using .Problems
@reexport using QuantumCollocationCore
@reexport using PiccoloQuantumObjects

include("direct_sums.jl")
@reexport using .DirectSums
Expand All @@ -63,17 +20,10 @@ include("trajectory_interpolations.jl")
include("problem_templates/_problem_templates.jl")
@reexport using .ProblemTemplates

include("save_load_utils.jl")
@reexport using .SaveLoadUtils

include("problem_solvers.jl")
@reexport using .ProblemSolvers

include("plotting.jl")
@reexport using .Plotting
include("quantum_system_templates/_quantum_system_templates.jl")
@reexport using .QuantumSystemTemplates

include("callbacks.jl")
@reexport using .Callbacks


end
Loading
Loading