Repository navigation
Validate lookup qubit labels and cache swap absorption labels - #1
Closed
masterFoad wants to merge 1 commit into
Closed
masterFoad wants to merge 1 commit into
masterFoad wants to merge 1 commit into
Conversation
check_commutation_entries now takes each qubit label as a Qubit or as an integer converted with operator.index, so NumPy integers name the same qubit as equal Python ints. A bool or any other label raises QiskitError instead of silently giving None. The shared get_bits_from_py helper, commute() and commute_nodes() are unchanged. _AbsorbIntoSwaps keeps the labels it derives from the session commutation table in a module-level cache keyed by (name, width), so a second pass call does not query the table again. Tests that replace the lookup clear the cache for their duration. Document why the crz, crx, rzz, rxx, ryy and rzx labels found by the parameter-free lookup hold at every angle.
Owner
Author
|
Included in #2, which now targets your branch directly. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to c81cf60.
(operator.index), so NumPy ints work; reject bool or anything else
with QiskitError instead of returning None.
call does not query the table again.
crz, crx, rzz, rxx, ryy and rzx at every angle.
Checked: 149 tests pass; same output as your branch on 1690 small
inputs and on Benchpress (6246 cases, identical counts/depth/ESP).