qiskit-aer
qiskit-aer copied to clipboard
Promote `QuantumChannelInstruction._quantum_error` to public attribute?
What is the expected behavior?
Currently, a quantum error can be appended to a QuantumCircuit, which will convert the quantum error to a QuantumChannelInstruction. This object consists of a dummy placeholder gate named 'quantum_channel' that represents where the channel occurs in the circuit, along with a private attribute _quantum_error that contains all the info about what the channel actually is:
https://github.com/Qiskit/qiskit-aer/blob/21eae0368929e818978a74d77424644ca9e3f6d3/qiskit_aer/noise/errors/base_quantum_error.py#L102-L113
Changing the private _quantum_error attribute to a public quantum_error attribute would give users a lot more power to perform computations on noisy circuits containing QuantumChannelInstructions.
For example, one can put a PauliLindbladError into a QuantumCircuit, but since _quantum_error is private there is AFAIK no supported means of later crawling the circuit and reading the Pauli-Lindblad generators and rates.
(Other plausible methods of reading the error, such as converting the instruction or subcircuit to quantum-info classes, tend to default to constructing dense representations in the computational basis. Since PauliLindbladError in particular may by design span many qubits, this conversion can attempt to construct ~petabyte-size objects, leading to crashes).