juliaquantumcontrol / krotov.jl Goto Github PK
View Code? Open in Web Editor NEWJulia implementation of Krotov's method for quantum optimal control
Home Page: https://juliaquantumcontrol.github.io/Krotov.jl
License: MIT License
Julia implementation of Krotov's method for quantum optimal control
Home Page: https://juliaquantumcontrol.github.io/Krotov.jl
License: MIT License
In the krotov.jl
documentation section, the spelling of parameterization is not normalized.
Please see here: https://juliaquantumcontrol.github.io/Krotov.jl/stable/examples/ This leads to QuantumControlExamples.jl
where we have the same issue.
I will fix this soon.
The example for the PE optimization with Krotov should be expanded similarly to JuliaQuantumControl/GRAPE.jl#26
See also JuliaQuantumControl/GRAPE.jl#24
I am trying to optimise the control pulse to empty an optical resonator as fast as possible by, e.g switching off a driving field and controlling its detuning from the resonance frequency.
The initial state is therefore a coherent state, and the final one, the vacuum. To maximise the speed at which the cavity is empty the cost function to minimise would be, e.g, the photon number integrated cross the dynamics. Is there a way to set this as the optimisation functional?
When the guess controls are actually pulses (vectors defined on the midpoint of the time grid), the optimization will mutate the original objective.generator
. This happens because currently, disretize_on_midpoints
simply returns the input vector instead of a copy of the input vector.
using Test
using QuantumControl
using LinearAlgebra
using StableRNGs
using QuantumControlTestUtils.DummyOptimization: dummy_control_problem
using QuantumControl.Controls: get_controls, discretize_on_midpoints
using QuantumControl.Functionals: J_T_re
rng = StableRNG(1244561944)
# The problem occurs when the controls are actually pulses (on the midpoints of
# the time grid), so that the optimization does not have to call
# `discretize_on_midpoints` internally
problem = dummy_control_problem(; pulses_as_controls=true)
nt = length(problem.tlist)
guess_pulse = QuantumControl.Controls.get_controls(problem.objectives)[1]
@test length(guess_pulse) == nt - 1
guess_pulse_copy = copy(QuantumControl.Controls.get_controls(problem.objectives)[1])
# Optimizing this should not modify the original generator in any way
res = optimize(problem; method=:krotov, J_T=J_T_re, iter_stop=2)
opt_control = res.optimized_controls[1]
@test length(opt_control) == nt # optimized_controls are always *on* tlist
opt_pulse = discretize_on_midpoints(opt_control, problem.tlist)
post_pulse = QuantumControl.Controls.get_controls(problem.objectives)[1]
# * The generator should still have the exact same objects as controls
@test guess_pulse ≡ post_pulse
# * These objects should not have been modified
@test norm(guess_pulse_copy - guess_pulse) ≈ 0.0 # FAILS
# * But the values of the optimized pulse should differ from the pulse in the
# generator
@test norm(post_pulse - opt_pulse) > 0.1 # FAILS
This is an ongoing issue to trigger package registration
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.