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

Remove hf dependency in qubit tapering #2510

Merged
merged 6 commits into from
Apr 29, 2022
Merged

Conversation

obliviateandsurrender
Copy link
Contributor

Context:
This PR removes the dependency of _generate_qubit_operator from the hf module. It also adds a consistency check to manually add wires to the tapered observable if some go missing due to the simplify() routine.

Description of the Change:

  1. Replaces _generate_qubit_operator from hf module with the jordan_wigner from unified qchem module.
  2. Adds consistency check for tapered wires inqml.taper. This allows us to return consistent observables in the case of tapering of non-Hamiltonian observables.
  3. Replaced the test_hf_energy unittest with a newer test_taper_obs unittest that uses the above consistency check.
  4. Fix a minor documentation issue with jordan_wigner.

Benefits:
Removes dependency for the deprecated hf module and addresses wires consistency issue with empty simplified tapered observables.

Possible Drawbacks:
None.

Related GitHub Issues:
None.

@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@codecov
Copy link

codecov bot commented Apr 28, 2022

Codecov Report

Merging #2510 (a46628d) into master (58666c8) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2510      +/-   ##
==========================================
- Coverage   99.47%   99.47%   -0.01%     
==========================================
  Files         244      244              
  Lines       19427    19423       -4     
==========================================
- Hits        19325    19321       -4     
  Misses        102      102              
Impacted Files Coverage Δ
pennylane/qchem/observable_hf.py 100.00% <ø> (ø)
pennylane/qchem/tapering.py 100.00% <100.00%> (ø)

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 58666c8...a46628d. Read the comment docs.

Copy link
Contributor

@soranjh soranjh left a comment

Choose a reason for hiding this comment

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

Thanks @obliviateandsurrender, looks good to me, just left few comments and suggestions.

@antalszava
Copy link
Contributor

Coverage checks out, overriding the check.

@antalszava antalszava merged commit 3850713 into master Apr 29, 2022
@antalszava antalszava deleted the qml-tapering-improv branch April 29, 2022 17:28
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.

4 participants