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

Add support for parametrized pulses #92

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

goerz
Copy link
Member

@goerz goerz commented Jun 5, 2021

This adds support for parametrized pulses by attaching an optional 'parametrization' attribute to control-functions and pulse arrays. The parametrization object stored in that attribute contains information for converting ϵ⟷u and calculating the derivative ∂ϵ/∂u. These are automatically taking into account when calculating the pulse updates (μ = (∂Ĥ/∂ϵ)⋅(∂ϵ/∂u) for an Ĥ that is linear in ϵ).

Thus, all internal storage is for the physical pulse values ϵ(t), and any conversion to u(t) is done on the fly as necessary. This ensures that everything stays 100% compatible with QuTiP, but adds a small overhead from the ϵ⟷u conversions compared to the "hacky" solution discussed in #23 (comment). The latter could still be used by an advanced user when performance is more critical than clarity.

Closes #23

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov
Copy link

codecov bot commented Jun 5, 2021

Codecov Report

Merging #92 (809d94e) into master (cfe6b10) will decrease coverage by 2.8%.
The diff coverage is 45.4%.

@@           Coverage Diff            @@
##           master     #92     +/-   ##
========================================
- Coverage    96.1%   93.2%   -2.9%     
========================================
  Files          13      14      +1     
  Lines        1676    1765     +89     
========================================
+ Hits         1611    1646     +35     
- Misses         65     119     +54     
Impacted Files Coverage Δ
src/krotov/__init__.py 100.0% <ø> (ø)
src/krotov/mu.py 90.0% <33.3%> (-10.0%) ⬇️
src/krotov/parametrization.py 36.1% <36.1%> (ø)
src/krotov/conversions.py 95.6% <75.0%> (-2.5%) ⬇️
src/krotov/optimize.py 96.7% <75.0%> (-1.0%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cfe6b10...809d94e. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement optimization for a Hamiltonian with non linear dependence on the field
1 participant