You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to use qpy to save to disk a QuantumCircuit to which a many-qubit PauliLindbladError has been appended (as a 'quantum_channel' instruction).
qpy.dump tries to access the definition attribute of the 'quantum_channel' instruction, which tries to express the error channel as a Kraus object, which involves constructing the object as a SuperOp, which requires some astronomical amount of memory. Since appending PauliLindbladError seems like a nicely portable means of constructing a noisy circuit, it would be convenient if the noisy circuit could be saved to disk.
How can we reproduce the issue?
from qiskit import qpy
from qiskit_aer.noise.errors import PauliLindbladError
qc = QuantumCircuit(20)
qc.cx(0,1)
qc.cx(0,1)
qc.append(PauliLindbladError(generators=['X'+'I'*19],rates=[0.1]),range(20))
with open('circuit_filename','wb') as f:
qpy.dump(qc, f)
Out:
ValueError: array is too big; `arr.size * arr.dtype.itemsize` is larger than the maximum possible size.
What should happen?
Would be nice to be able to add large error channels (such as appending PauliLindbladError) to a circuit, and save/load that circuit using qpy.
Any suggestions?
I'm not sure if this should be fixed in Qiskit (don't have qpy unpack the definition of the 'quantum_channel' instruction's operation?), or in Aer (change the definition of the 'quantum_channel' to be a sequence of sparse Pauli channels instead of one huge channel?), or somewhere else. I'm not very familiar with qpy, but naively I'd wonder if it's possible to avoid looking at the channel's definition and just leave the instructions in their original forms, which seems desirable. OTOH, apparently any attempt to access the definition will raise this error, which seems like a more general problem independent of qpy specifically.
Whatever the means, it would be nice to have a way to compactly save a QuantumCircuit containing sparse Pauli-Lindblad noise.
The text was updated successfully, but these errors were encountered:
Environment
What is happening?
Similar to #13457.
I'd like to use
qpy
to save to disk a QuantumCircuit to which a many-qubitPauliLindbladError
has been appended (as a 'quantum_channel' instruction).qpy.dump
tries to access thedefinition
attribute of the 'quantum_channel' instruction, which tries to express the error channel as aKraus
object, which involves constructing the object as aSuperOp
, which requires some astronomical amount of memory. Since appendingPauliLindbladError
seems like a nicely portable means of constructing a noisy circuit, it would be convenient if the noisy circuit could be saved to disk.How can we reproduce the issue?
Out:
What should happen?
Would be nice to be able to add large error channels (such as appending
PauliLindbladError
) to a circuit, and save/load that circuit using qpy.Any suggestions?
I'm not sure if this should be fixed in Qiskit (don't have qpy unpack the
definition
of the 'quantum_channel' instruction'soperation
?), or in Aer (change the definition of the 'quantum_channel' to be a sequence of sparse Pauli channels instead of one huge channel?), or somewhere else. I'm not very familiar withqpy
, but naively I'd wonder if it's possible to avoid looking at the channel'sdefinition
and just leave the instructions in their original forms, which seems desirable. OTOH, apparently any attempt to access thedefinition
will raise this error, which seems like a more general problem independent ofqpy
specifically.Whatever the means, it would be nice to have a way to compactly save a QuantumCircuit containing sparse Pauli-Lindblad noise.
The text was updated successfully, but these errors were encountered: