Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decompose PauliLindbladError into subsystem errors before attempting to simulate #2262

Open
aeddins-ibm opened this issue Nov 22, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@aeddins-ibm
Copy link

aeddins-ibm commented Nov 22, 2024

What is the expected behavior?

PauliLindbladError was created to facilitate doing many-qubit simulations with Sparse Pauli-Lindblad noise.

However, attempting to simulate a circuit with a many-qubit PauliLindbladError fatally crashes (in my notebook, it crashes the kernel). This should not occur if the PauliLindbladError is truly sparse in the relevant sense, i.e. each error term involves only a few qubits. In this example, the error is really only a 1-qubit error, with identities on all other qubits, but it still crashes:

from qiskit_aer import AerSimulator
from qiskit_aer.noise import PauliLindbladError
from qiskit import QuantumCircuit

num_qubits = 12
qc = QuantumCircuit(num_qubits)
qc.append(PauliLindbladError([('I'*(num_qubits-1))+'X'],[0.001]),range(num_qubits))

backend = AerSimulator()
job = backend.run(qc)

Presumably this crash is related to attempting to construct the twelve-qubit error channel as a very large matrix. It would be convenient if Aer could try to avoid this by first decomposing the PauliLindbladChannel into subsystem errors, which should, in many cases, break up the many-qubit channel into an equivalent set of few-qubit channels, which can then be included in the simulation as usual:

ple = PauliLindbladError([('I'*(num_qubits-1))+'X',
                          'I'*(num_qubits-2)+'XX',
                          'I'*(num_qubits-4)+'IXXI'],
                          [0.001,0.002,0.003])
ple.subsystem_errors()

The output contains smaller channels that can be substituted into the circuit in place of the original PauliLindbladError, and then simulated without memory issues:

[(PauliLindbladError(['IX', 'XX'], [0.001, 0.002]),
  (np.int64(0), np.int64(1))),
 (PauliLindbladError(['XX'], [0.003]), (np.int64(1), np.int64(2)))]
@aeddins-ibm aeddins-ibm added the enhancement New feature or request label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant