-
Notifications
You must be signed in to change notification settings - Fork 8
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
Objectives penalizing e.g. the amplitude of the pulse #15
Comments
Are you looking for running costs, or amplitude constraints? As for amplitude constraints, the only thing that's currently implemented is Pulse Parametrization for Krotov. That exact same feature should also be implemented for GRAPE at some point, but I haven't gotten around to that. Those constraints are just for the maximum/minimum amplitude, and aren't time-dependent (so enforcing Specifically for GRAPE, the underlying A third option that I've been thinking about would be to have a custom type for the controls, so instead of a As for running costs, that's also on the TODO list for GRAPE. Those wouldn't allow you to set hard limits on the amplitude though, just generally penalize larger amplitudes (which probably works fine in practice). It also wouldn't allow you to enforce boundary conditions, although it would allow you to enforce smoothness, so in combination with the L-BFGS-B bounds that might work quite well. Let me know which of these you'd want to have prioritized, and maybe I can whip up a rough PR on a relatively short time scale. |
Thanks for the speedy reply! I'd be most interested in the last two options you mentioned. The |
Actually, having an With that, it's now possible to use the "shaped control". I've implemented a proof-of-concept at https://github.com/goerz-testing/2022-09-GRAPE-jl-shaped-controls and specifically in the I'll try to have a go at the running costs next weekend. |
Thanks so much for this! I will take a look and let you know my thoughts. |
I have a tentative plan for running costs: JuliaQuantumControl/GRAPE.jl#30 Let me know what you think about the proposed interface (also @seba-car, @alastair-marshall, @Basilewitsch) |
The proposed interface looks good. It is minimal and consistent with everything. |
Let's have the specific discussion about the running costs over at JuliaQuantumControl/GRAPE.jl#30 ... |
The |
That's a major pain point, indeed. As long as it's just one non-published package, and nothing depends on that package, BTW, especially for any sort of technical problem that doesn't warrant a GH issue: I'm generally also reachable on the
Not very much, no. I'm seeing about 2.0 seconds per gradient evaluation for the shaped control vs 1.8 seconds for the original example, on one particular workstation. The one obvious possible cause for this would be the |
The I'd still consider this a bit experimental, so there isn't much explicit documentation around it beyond just the API docstrings. I did try to play around with it a little bit in https://nbviewer.org/gist/goerz/19785600cd688a60dd7e69935ede324a and while I don't see any indication that there's something wrong with the implementation, adding a penalty on the fluence does seem to introduce local traps in the optimization landscape. So I'm not getting very useful results in that example. I'm not 100% settled on how the λₐ parameter should be set, and whether there's some better default value than 1.0, or some other way to "normalize" running costs. There's also the question of how to report the convergence data (the table that gets printed during the optimization) in the most helpful way. @dkweiss31 Feel free to play around with this and suggest any possible improvements to the implementation. Also, in the longer term, if you think the example you're currently working on could be instructive, maybe you can contribute a notebook for the documentation at some point in the future. I'll probably not be very much available for QuantumControl.jl development during the next couple of weeks, but maybe after that, I'll tackle the L-BFGS-B amplitude bounds. |
Oh great! I will definitely give the running costs a look. And agreed re the slowdown for That could be a nice idea re the example notebook: right now my implementation for my problem leans heavily on your example notebooks, but hopefully as I get more comfortable and have a sufficiently different problem from what you already have I can contribute something. |
the `optimize_grape` routine can now be called with an `upper_bound` and `lower_bound` parameter. For time-dependent bounds, or different bounds on different pulses, it is also possible to give `pulse_options` with keys `upper_bounds` and `lower_bounds`. This is only implemented for the L-BFGS-B backend. I couln't really figure out how to add bounds to Optim.jl. JuliaQuantumControl/QuantumControl.jl#15
the `optimize_grape` routine can now be called with an `upper_bound` and `lower_bound` parameter. For time-dependent bounds, or different bounds on different pulses, it is also possible to give `pulse_options` with keys `upper_bounds` and `lower_bounds`. This is only implemented for the L-BFGS-B backend. I couln't really figure out how to add bounds to Optim.jl. JuliaQuantumControl/QuantumControl.jl#15
Hello, I have been really enjoying this package! I have what is probably a quick question. In addition to Objectives that ensure that the initial states reach the target states, I'd also like to use objectives that penalize the amplitude of the pulse, or penalize deviations of the pulse from zero amplitude at the beginning or the end, etc. I didn't see an example of such an Objective in your examples, and it wasn't immediately obvious to me how it would be implemented (fwiw I'm more interested in GRAPE than Krotov). Thanks!
The text was updated successfully, but these errors were encountered: