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

Reinstate and deprecate loose measure and reset functions #7376

Merged
merged 2 commits into from
Dec 8, 2021

Conversation

jakelishman
Copy link
Member

Summary

Previously, the QuantumCircuit methods .measure and .reset were
defined as regular functions in circuit/measure.py (m.m. reset) and
monkey-patched onto QuantumCircuit. Commit 2cd42b4 removed the
monkey-patching by defining them as regular methods, but did not
implement a deprecation period for the functions. This reinstates them,
with the deprecation warning.

Details and comments

Fix #7370. This came up on pennylane_qiskit: see PennyLaneAI/pennylane-qiskit#164.

Previously, the `QuantumCircuit` methods `.measure` and `.reset` were
defined as regular functions in `circuit/measure.py` (m.m. `reset`) and
monkey-patched onto `QuantumCircuit`.  Commit 2cd42b4 removed the
monkey-patching by defining them as regular methods, but did not
implement a deprecation period for the functions.  This reinstates them,
with the deprecation warning.
@jakelishman jakelishman requested a review from a team as a code owner December 8, 2021 11:38
@jakelishman jakelishman added Changelog: Bugfix Include in the "Fixed" section of the changelog Changelog: Deprecation Include in "Deprecated" section of changelog stable backport potential The bug might be minimal and/or import enough to be port to stable labels Dec 8, 2021
@jakelishman jakelishman added this to the 0.19.1 milestone Dec 8, 2021
@coveralls
Copy link

coveralls commented Dec 8, 2021

Pull Request Test Coverage Report for Build 1553934524

  • 8 of 8 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 83.104%

Totals Coverage Status
Change from base Build 1553906216: 0.002%
Covered Lines: 51680
Relevant Lines: 62187

💛 - Coveralls

@mergify mergify bot merged commit 89b324c into Qiskit:main Dec 8, 2021
mergify bot pushed a commit that referenced this pull request Dec 8, 2021
Previously, the `QuantumCircuit` methods `.measure` and `.reset` were
defined as regular functions in `circuit/measure.py` (m.m. `reset`) and
monkey-patched onto `QuantumCircuit`.  Commit 2cd42b4 removed the
monkey-patching by defining them as regular methods, but did not
implement a deprecation period for the functions.  This reinstates them,
with the deprecation warning.

(cherry picked from commit 89b324c)
mergify bot added a commit that referenced this pull request Dec 8, 2021
)

Previously, the `QuantumCircuit` methods `.measure` and `.reset` were
defined as regular functions in `circuit/measure.py` (m.m. `reset`) and
monkey-patched onto `QuantumCircuit`.  Commit 2cd42b4 removed the
monkey-patching by defining them as regular methods, but did not
implement a deprecation period for the functions.  This reinstates them,
with the deprecation warning.

(cherry picked from commit 89b324c)

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
@jakelishman jakelishman deleted the fix/reinstate-loose-measure branch December 10, 2021 09:21
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 Changelog: Deprecation Include in "Deprecated" section of changelog stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ImportError on Google Colab
3 participants