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 qchem vibronic transition operation #451

Merged
merged 18 commits into from
Sep 25, 2020
Merged

Conversation

soranjh
Copy link
Contributor

@soranjh soranjh commented Sep 15, 2020

This PR adds the function VibronicTransition to the apps.qchem.vibronic module. This function generates a custom sf operation for applying the Doktorov operator on a given state.

@codecov
Copy link

codecov bot commented Sep 15, 2020

Codecov Report

Merging #451 into master will decrease coverage by 1.00%.
The diff coverage is 99.40%.

@@            Coverage Diff             @@
##           master     #451      +/-   ##
==========================================
- Coverage   97.84%   96.83%   -1.01%     
==========================================
  Files          58       70      +12     
  Lines        6784     7086     +302     
==========================================
+ Hits         6638     6862     +224     
- Misses        146      224      +78     
Impacted Files Coverage Δ
strawberryfields/apps/clique.py 100.00% <ø> (ø)
strawberryfields/apps/plot.py 100.00% <ø> (ø)
strawberryfields/apps/train/embed.py 100.00% <ø> (ø)
...awberryfields/backends/gaussianbackend/__init__.py 100.00% <ø> (ø)
strawberryfields/backends/gaussianbackend/ops.py 100.00% <ø> (+2.70%) ⬆️
strawberryfields/backends/shared_ops.py 96.11% <ø> (-0.98%) ⬇️
strawberryfields/engine.py 95.45% <ø> (+0.55%) ⬆️
strawberryfields/io.py 97.70% <ø> (-1.13%) ⬇️
strawberryfields/ops.py 98.84% <ø> (-0.18%) ⬇️
strawberryfields/parameters.py 99.06% <ø> (+0.03%) ⬆️
... and 75 more

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 69f1c5b...8eebaa3. Read the comment docs.

@soranjh soranjh marked this pull request as ready for review September 16, 2020 12:41
@soranjh soranjh added review-ready and removed WIP labels Sep 16, 2020
@soranjh soranjh changed the title qchem vibronic transition operation Add qchem vibronic transition operation Sep 16, 2020
Copy link
Contributor

@trbromley trbromley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @soranjh, looks great!

strawberryfields/apps/qchem/vibronic.py Outdated Show resolved Hide resolved
strawberryfields/apps/qchem/vibronic.py Outdated Show resolved Hide resolved
strawberryfields/apps/qchem/vibronic.py Outdated Show resolved Hide resolved
strawberryfields/apps/qchem/vibronic.py Outdated Show resolved Hide resolved
strawberryfields/apps/qchem/vibronic.py Outdated Show resolved Hide resolved
strawberryfields/apps/qchem/vibronic.py Outdated Show resolved Hide resolved
tests/apps/qchem/test_vibronic.py Outdated Show resolved Hide resolved
Copy link

@agran2018 agran2018 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @soranjh. Just left one question on the unit test.
Another question, why not to call this function Doktorov?. I noticed in the test that there are two "vibronic" prefixes vibronic.VibronicTransition(U1, r, U2, alpha) | q.

strawberryfields/apps/qchem/vibronic.py Outdated Show resolved Hide resolved
strawberryfields/apps/qchem/vibronic.py Outdated Show resolved Hide resolved
strawberryfields/apps/qchem/vibronic.py Outdated Show resolved Hide resolved
tests/apps/qchem/test_vibronic.py Show resolved Hide resolved
@soranjh
Copy link
Contributor Author

soranjh commented Sep 17, 2020

Thanks @soranjh. Just left one question on the unit test.
Another question, why not to call this function Doktorov?. I noticed in the test that there are two "vibronic" prefixes vibronic.VibronicTransition(U1, r, U2, alpha) | q.

We also thought of Doktorov and it is still an option. The idea is to name the operators in a similar way to the existing sf.ops operators, e.g., MeasureFock. We will make these operations available as qchem.OperatorName in the future.

soranjh and others added 5 commits September 18, 2020 09:04
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
Copy link
Contributor

@ixfoduap ixfoduap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good to go! I just left a couple of suggestions regarding the docstring

strawberryfields/apps/qchem/vibronic.py Outdated Show resolved Hide resolved
strawberryfields/apps/qchem/vibronic.py Show resolved Hide resolved
tests/apps/qchem/test_vibronic.py Show resolved Hide resolved
@josh146 josh146 merged commit 6bf767c into master Sep 25, 2020
@josh146 josh146 deleted the qchem_vibronic_transition_op branch September 25, 2020 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants