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

Modify UI for qubit tapering functions #2426

Merged
merged 21 commits into from
Apr 14, 2022
Merged

Conversation

soranjh
Copy link
Contributor

@soranjh soranjh commented Apr 7, 2022

Context:
This PR renames the qubit tapering functions, removes a wrapper function used for generating symmetries and PauliX ops and makes the general-purpose user-facing functions taper, symmetry_generators, paulix_ops accessible with qml.functiion_name.

Description of the Change:
The following functions are renamed:

get_generators  ->  symmetry_generators
generate_paulis -> paulix_ops
transform_hamiltonian -> taper
transform_hf -> taper_hf

The functions taper, symmetry_generators, paulix_ops are added to pennylane.__init__.

Benefits:
The UI is more intuitive and there is flexibility in bringing some general-purpose functions out of the chemistry modules without changing the UI.

Possible Drawbacks:

Related GitHub Issues:

@soranjh soranjh added WIP 🚧 Work-in-progress qchem ⚛️ Related to the QChem package labels Apr 7, 2022
@soranjh soranjh changed the title [WIP] move qchem tapering functions to relevant modules [WIP] move qubit tapering functions to relevant modules Apr 7, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2022

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 7, 2022

Codecov Report

Merging #2426 (ec762ee) into master (7d1dd86) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           master    #2426    +/-   ##
========================================
  Coverage   99.47%   99.47%            
========================================
  Files         244      245     +1     
  Lines       19327    19489   +162     
========================================
+ Hits        19225    19387   +162     
  Misses        102      102            
Impacted Files Coverage Δ
pennylane/__init__.py 100.00% <100.00%> (ø)
pennylane/qchem/__init__.py 100.00% <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 7d1dd86...ec762ee. Read the comment docs.

pennylane/__init__.py Outdated Show resolved Hide resolved
pennylane/hf/tapering.py Outdated Show resolved Hide resolved
tests/hf/test_tapering_hf.py Outdated Show resolved Hide resolved
@soranjh soranjh changed the title [WIP] move qubit tapering functions to relevant modules Modify UI for qubit tapering functions Apr 13, 2022
@soranjh soranjh removed the WIP 🚧 Work-in-progress label Apr 13, 2022
@soranjh soranjh marked this pull request as ready for review April 13, 2022 19:06
Copy link
Contributor

@obliviateandsurrender obliviateandsurrender 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! Leaving a couple of small changes after which it should be good to go!

pennylane/hf/tapering.py Outdated Show resolved Hide resolved
pennylane/hf/tapering.py Outdated Show resolved Hide resolved
pennylane/hf/tapering.py Outdated Show resolved Hide resolved
pennylane/hf/tapering.py Outdated Show resolved Hide resolved
pennylane/hf/tapering.py Outdated Show resolved Hide resolved
tests/hf/test_tapering_hf.py Outdated Show resolved Hide resolved
tests/hf/test_tapering_hf.py Outdated Show resolved Hide resolved
tests/hf/test_tapering_hf.py Outdated Show resolved Hide resolved
Copy link
Contributor

@obliviateandsurrender obliviateandsurrender left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just left one final comment.

tests/hf/test_tapering_hf.py Outdated Show resolved Hide resolved
pennylane/__init__.py Outdated Show resolved Hide resolved
@soranjh soranjh merged commit c5c8ed7 into master Apr 14, 2022
@soranjh soranjh deleted the qchem_tapering_relocate branch April 14, 2022 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qchem ⚛️ Related to the QChem package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants