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

Update tapering.py to support operator arithmetic #4252

Merged
merged 28 commits into from Jun 16, 2023

Conversation

Jaybsoni
Copy link
Contributor

No description provided.

@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.

@timmysilv timmysilv added this to the v0.31 milestone Jun 14, 2023
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 @Jaybsoni! Leaving an initial review will leave more comments after testing. Currently, tests for HF tapering and Observable tapering are missing. Overall looking good.

pennylane/ops/functions/generator.py Outdated Show resolved Hide resolved
pennylane/qchem/tapering.py Outdated Show resolved Hide resolved
pennylane/qchem/tapering.py Outdated Show resolved Hide resolved
tests/qchem/test_tapering.py Show resolved Hide resolved
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 @Jaybsoni, left some small comments and questions. My main points are:

  1. Have we change the type of input arguments in any user-facing function?
  2. There seems to be some inconsistency in defining the input types in the docstrings. For instance I see both generators (list[Union[~.Hamiltonian, ~.Operator]]) and generators (list[~.Operator]). These should be corrected if they are not.

pennylane/pauli/conversion.py Show resolved Hide resolved
pennylane/pauli/utils.py Outdated Show resolved Hide resolved
pennylane/qchem/tapering.py Show resolved Hide resolved
pennylane/qchem/tapering.py Show resolved Hide resolved
pennylane/qchem/tapering.py Show resolved Hide resolved
pennylane/qchem/tapering.py Outdated Show resolved Hide resolved
pennylane/qchem/tapering.py Show resolved Hide resolved
tests/pauli/test_pauli_utils.py Outdated Show resolved Hide resolved
tests/pauli/test_pauli_utils.py Show resolved Hide resolved
tests/qchem/test_tapering.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

Merging #4252 (b3f733b) into master (ed8ada7) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #4252   +/-   ##
=======================================
  Coverage   99.79%   99.79%           
=======================================
  Files         352      352           
  Lines       31958    31982   +24     
=======================================
+ Hits        31891    31915   +24     
  Misses         67       67           
Impacted Files Coverage Δ
pennylane/ops/qubit/qchem_ops.py 100.00% <ø> (ø)
pennylane/qchem/observable_hf.py 100.00% <ø> (ø)
pennylane/ops/functions/generator.py 100.00% <100.00%> (ø)
pennylane/pauli/conversion.py 100.00% <100.00%> (ø)
pennylane/pauli/utils.py 100.00% <100.00%> (ø)
pennylane/qchem/tapering.py 99.52% <100.00%> (+0.01%) ⬆️

@Jaybsoni Jaybsoni enabled auto-merge (squash) June 16, 2023 17:30
@timmysilv timmysilv added the merge-ready ✔️ All tests pass and the PR is ready to be merged. label Jun 16, 2023
@Jaybsoni Jaybsoni merged commit dbadf45 into master Jun 16, 2023
44 checks passed
@Jaybsoni Jaybsoni deleted the update_tapering_opmath branch June 16, 2023 18:52
@Jaybsoni
Copy link
Contributor Author

[sc-38623]

frederikwilde pushed a commit that referenced this pull request Jul 5, 2023
* save changes to tapering

* add tapering update + tests

* more testing

* lint and tests

* more tests

* Apply suggestions from code review

Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>

* added more tests

* fix bug

* lint

* lint

* lint

* lint + codecov

* more tests

* Added test and warning message for coverage

* Update pennylane/ops/functions/generator.py

Co-authored-by: Utkarsh <utkarshazad98@gmail.com>

* lint

* lint and codefactor

* lint + changelog

* fix tests + lint

* code review

---------

Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-ready ✔️ All tests pass and the PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants