New implementation of _group_interchangeable_qubits
can create duplicate keys in returned Tuple
#5148
Labels
area/gates
good for learning
For beginners in QC, this will help picking up some knowledge. Bit harder than "good first issues"
kind/bug-report
Something doesn't seem to work.
no QC knowledge needed
Want to contribute to Cirq, but don't know quantum computing? This issue is for you.
size: S
10< lines changed <50
triage/accepted
A consensus emerged that this bug report, feature request, or other action should be worked on
Description of the issue
#4941 modified the implementation of
_group_interchangeable_qubits
, but in doing so inadvertently made a breaking change in how the returningTuple
is constructed.The example code below shows how the constructed tuple would return
((0, frozenset({cirq.LineQubit(0), cirq.LineQubit(1), cirq.LineQubit(3)})), (2, frozenset({cirq.LineQubit(2)})))
with previous implementation.Now it returns
((0, frozenset({cirq.LineQubit(0), cirq.LineQubit(1)})), (2,frozenset({cirq.LineQubit(2)})), (0, frozenset({cirq.LineQubit(3)})))
.The second tuple has 2 keys that are 0.
How to reproduce the issue
Cirq version
0.14.0
The text was updated successfully, but these errors were encountered: