-
Notifications
You must be signed in to change notification settings - Fork 15
Feature: Ipopt callbacks #157
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
Merged
Merged
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 7f35b40
add callbacks tests
jack-champagne f25a057
add tmp callback changes
jack-champagne 1a0e8fb
Merge branch 'main' into feature/ipopt-callbacks
jack-champagne f88cde8
add docstrings
jack-champagne 81cbad7
add generic callback factory
jack-champagne 6b4a6cc
Merge commit '18d52526351f71093d7bca9b111779ac00e77bb4' into feature/…
andgoldschmidt 6428fa6
add get best iterate to callbacks lib
jack-champagne 70d5fa1
fix renamed callback
jack-champagne 972aea9
move callback tests, rename callbacks
andgoldschmidt 587c051
Merge branch 'feature/ipopt-callbacks' of github.com:kestrelquantum/Q…
andgoldschmidt bc406f3
local project toml changes
jack-champagne d267338
remove pulse animation pngs
jack-champagne ddb9f0e
add NamedTrajectories to docs compat
jack-champagne e5e64c6
fix typo NM version
jack-champagne 1701f19
roll back callback fidelity
andgoldschmidt e8dabda
Merge branch 'feature/ipopt-callbacks' of github.com:kestrelquantum/Q…
andgoldschmidt 0ecef44
rm manifest
jack-champagne 1c4d641
test unitary fid callback
andgoldschmidt f712b40
fix doctests
jack-champagne e4f7cbc
fixup docs
jack-champagne a1586aa
callbacks version bump
jack-champagne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add generic callback factory
- Loading branch information
commit 81cbad70477bc6e4fba4498184e48625e0304497
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| module Callbacks | ||
|
|
||
| export make_save_best_trajectory_callback | ||
|
|
||
| using NamedTrajectories | ||
|
|
||
| import ..QuantumControlProblem | ||
| import ..Problems: get_datavec | ||
|
|
||
| function make_save_best_trajectory_callback(prob::QuantumControlProblem, traj::NamedTrajectory) | ||
| best_traj = NamedTrajectory(get_datavec(prob), prob.trajectory) | ||
| best_fidelity = 0.0 | ||
|
|
||
| function save_best_trajectory_callback(prob::QuantumControlProblem) | ||
| fidelity = prob.objective.fidelity(prob) | ||
| if fidelity > best_fidelity | ||
| best_fidelity = fidelity | ||
| copy!(best_traj, prob.trajectory) | ||
| end | ||
| return true | ||
| end | ||
|
|
||
| return save_best_trajectory_callback, best_traj | ||
| end | ||
|
|
||
| end | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.