Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7f9c195
feat: add boilerplate and inner function call
jack-champagne Sep 25, 2024
7f35b40
add callbacks tests
jack-champagne Sep 25, 2024
f25a057
add tmp callback changes
jack-champagne Nov 11, 2024
1a0e8fb
Merge branch 'main' into feature/ipopt-callbacks
jack-champagne Nov 11, 2024
f88cde8
add docstrings
jack-champagne Nov 11, 2024
81cbad7
add generic callback factory
jack-champagne Nov 11, 2024
6b4a6cc
Merge commit '18d52526351f71093d7bca9b111779ac00e77bb4' into feature/…
andgoldschmidt Nov 11, 2024
6428fa6
add get best iterate to callbacks lib
jack-champagne Nov 12, 2024
70d5fa1
fix renamed callback
jack-champagne Nov 12, 2024
972aea9
move callback tests, rename callbacks
andgoldschmidt Nov 12, 2024
587c051
Merge branch 'feature/ipopt-callbacks' of github.com:kestrelquantum/Q…
andgoldschmidt Nov 12, 2024
bc406f3
local project toml changes
jack-champagne Nov 12, 2024
d267338
remove pulse animation pngs
jack-champagne Nov 12, 2024
ddb9f0e
add NamedTrajectories to docs compat
jack-champagne Nov 12, 2024
e5e64c6
fix typo NM version
jack-champagne Nov 12, 2024
1701f19
roll back callback fidelity
andgoldschmidt Nov 12, 2024
e8dabda
Merge branch 'feature/ipopt-callbacks' of github.com:kestrelquantum/Q…
andgoldschmidt Nov 12, 2024
0ecef44
rm manifest
jack-champagne Nov 12, 2024
1c4d641
test unitary fid callback
andgoldschmidt Nov 12, 2024
f712b40
fix doctests
jack-champagne Nov 12, 2024
e4f7cbc
fixup docs
jack-champagne Nov 12, 2024
a1586aa
callbacks version bump
jack-champagne Nov 12, 2024
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
Prev Previous commit
Next Next commit
add tmp callback changes
  • Loading branch information
jack-champagne committed Nov 11, 2024
commit f25a057f6a0953c1215ced32ba6ba254c92891e7
Binary file added docs/src/assets/animation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/pulse-optimization.gif
20 changes: 11 additions & 9 deletions test/callbacks_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,22 @@ end
piccolo_options=PiccoloOptions(verbose=false)
)

trajectory_history = NamedTrajectory[]
function get_history_callback(
kwargs...
)
x_vals = map(x -> MOI.get(prob.optimizer, MOI.CallbackVariablePrimal(prob.optimizer), x), prob.variables)
push!(trajectory_history, NamedTrajectory(x_vals, prob.trajectory))
return true
end
trajectory_history = []
function get_history_callback(
kwargs...
)
push!(trajectory_history, QuantumCollocation.Problems.get_datavec(prob))
return true
end

initial = fidelity(prob)
solve!(prob, max_iter=20, callback=get_history_callback)

# for (iter, traj) in enumerate(trajectory_history)
# plot("./iteration-$iter-trajectory.png", traj, [:ψ̃1, :a])
# # change next line to plot the trajectory but on fixed xaxis and yaxis
# # get the length of the trajectory history depending on length and left pad the index with leading zeros
# str_index = lpad(iter, length(string(length(trajectory_history))), "0")
# plot("./test_animation_frames/iteration-$str_index-trajectory.png", NamedTrajectory(traj, prob.trajectory), [:ψ̃1, :a], xlims=(-Δt, (T+5)*Δt), plot_ylims=(ψ̃1 = (-2, 2), a = (-1.1, 1.1)))
# end
@test length(trajectory_history) == 21
end
Expand Down