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

Fix tapering of zero/empty operators #7262

Merged
merged 4 commits into from
Nov 15, 2021
Merged

Conversation

woodsp-ibm
Copy link
Member

Tapering logic would detect an empty/zero operator, log a warning and return the original operator unchanged. When running code with symmetry reduction in Qiskit Nature this ended up failing in VQE if one or more of the auxilary operators was zero. The set that ended up getting passed in would tapered non-zero operators and any zero operators were the originals which now were bigger, in terms of num_qubits, that the tapered operators. Given the number of qubits mismatched VQE raised an error.

This alters the code to so that a zero operator of the correct tapered size is returned from taper and not the original as before.

@woodsp-ibm woodsp-ibm requested review from manoelmarques and a team as code owners November 12, 2021 17:17
@woodsp-ibm
Copy link
Member Author

@ikkoham - since I cannot add you as a reviewer...

@woodsp-ibm woodsp-ibm added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Nov 12, 2021
@woodsp-ibm woodsp-ibm added this to the 0.19 milestone Nov 12, 2021
@woodsp-ibm woodsp-ibm added the mod: opflow Related to the Opflow module label Nov 12, 2021
@coveralls
Copy link

coveralls commented Nov 12, 2021

Pull Request Test Coverage Report for Build 1463550680

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 82.538%

Totals Coverage Status
Change from base Build 1463415742: 0.003%
Covered Lines: 49807
Relevant Lines: 60344

💛 - Coveralls

Copy link
Contributor

@ikkoham ikkoham left a comment

Choose a reason for hiding this comment

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

Thank you. I did not understand this part when I implement this. LGTM.

@mergify mergify bot merged commit 277aa87 into Qiskit:main Nov 15, 2021
@woodsp-ibm woodsp-ibm deleted the z2taper_fx branch November 16, 2021 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog mod: opflow Related to the Opflow module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants