CollectCliffords
pass fails for circuit with large PauliLindbladError
#13457
Labels
bug
Something isn't working
Environment
What is happening?
qiskit.transpiler.passes.CollectCliffords
goes through a circuit and merges recognized clifford gates into combined Clifford operations.However, this fails if we've appended a many-qubit
PauliLindbladError
(qiskit_aer.noise.errors.PauliLindbladError
) to the circuit. ThePauliLindbladError
is represented in the circuit as aquantum_channel
instruction. At some point,CollectCliffords
attempts to convert this channel to aKraus
object, which involves creating a many-qubitSuperOp
which naturally crashes with this error:ValueError: array is too big; `arr.size * arr.dtype.itemsize` is larger than the maximum possible size.
The attempt to convert to a
Kraus
object apparently happens here:qiskit/qiskit/dagcircuit/collect_blocks.py
Line 168 in cd26d49
It looks like it encounters the
PauliLindbladError
(as aquantum_channel
) as a successor node (of something), and tries to use thatquantum_channel
as a dictionary key (suc
). Attempting to check for equality with other dict keys apparently involves converting thequantum_channel
to a many-qubitSuperOp
, which fails.How can we reproduce the issue?
What should happen?
Personally I don't want
CollectCliffords
to attempt to do anything with thequantum_channel
instructions. It should leave those instructions unchanged, without raising any errors.Any suggestions?
It looks like internally, the low-level
collect
functions use afilter_fn
in order to ignore some instructions, avoiding the dictionary lookup:qiskit/qiskit/dagcircuit/collect_blocks.py
Lines 163 to 172 in cd26d49
Can we modify the existing
filter_fn
used byCollectCliffords
so that it ignoresquantum_channel
instructions?The text was updated successfully, but these errors were encountered: