-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Cache dag qubits/clbits #4535
Merged
Merged
Cache dag qubits/clbits #4535
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ajavadia
added
Changelog: Deprecation
Include in "Deprecated" section of changelog
performance
stable backport potential
The bug might be minimal and/or import enough to be port to stable
labels
Jun 2, 2020
mtreinish
added
the
Changelog: Bugfix
Include in the "Fixed" section of the changelog
label
Jun 4, 2020
kdk
approved these changes
Jun 8, 2020
mtreinish
pushed a commit
to mtreinish/qiskit-core
that referenced
this pull request
Jun 9, 2020
* cache dag.qubits and dag.clbits * releasenotes Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com> (cherry picked from commit 01cc5a2) Conflicts: qiskit/dagcircuit/dagcircuit.py qiskit/dagcircuit/dagdependency.py test/python/dagcircuit/test_dagdependency.py
mtreinish
added a commit
that referenced
this pull request
Jun 10, 2020
* Cache dag qubits/clbits (#4535) * cache dag.qubits and dag.clbits * releasenotes Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com> (cherry picked from commit 01cc5a2) Conflicts: qiskit/dagcircuit/dagcircuit.py qiskit/dagcircuit/dagdependency.py test/python/dagcircuit/test_dagdependency.py * Remove deprecation warning for new properties The deprecation for the use of the qubits and clbits properties as methods doesn't start to 0.15.0, for the 0.14.x it isn't deprecated and the caching is backported to just fix the performance bug. This commit removes the deprecation warning and the release note so the deprecation timer doesn't actually start until 0.15.0. Co-authored-by: Ali Javadi-Abhari <ajavadia@users.noreply.github.com> Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com>
faisaldebouni
pushed a commit
to faisaldebouni/qiskit-terra
that referenced
this pull request
Aug 5, 2020
* cache dag.qubits and dag.clbits * releasenotes Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com>
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
performance
stable backport potential
The bug might be minimal and/or import enough to be port to stable
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #4484
The list of qubits and clbits of a dag were being recreated every time
dag.qubits()
anddag.clbits()
methods were called, which was slow. Here I make them cached properties. Being properties is also aligned with how they are in QuantumCircuit.