4
$\begingroup$

I'm trying to construct a quantum noise model with readout error only: qiskit.providers.aer.noise.NoiseModel.add_readout_error. However, when I try to specify the qubits for my error (there will be 3 qubits), it seems like the program doesn't have a very clear constraint on how I can define that. Here's my code:

prob_nmc = [[0.571787, 0.117113, 0.117113, 0.023987, 0.117113, 0.023987,
        0.023987, 0.004913],
       [0.103335, 0.585565, 0.021165, 0.119935, 0.021165, 0.119935,
        0.004335, 0.024565],
       [0.103335, 0.021165, 0.585565, 0.119935, 0.021165, 0.004335,
        0.119935, 0.024565],
       [0.018675, 0.105825, 0.105825, 0.599675, 0.003825, 0.021675,
        0.021675, 0.122825],
       [0.103335, 0.021165, 0.021165, 0.004335, 0.585565, 0.119935,
        0.119935, 0.024565],
       [0.018675, 0.105825, 0.003825, 0.021675, 0.105825, 0.599675,
        0.021675, 0.122825],
       [0.018675, 0.003825, 0.105825, 0.021675, 0.105825, 0.021675,
        0.599675, 0.122825],
       [0.003375, 0.019125, 0.019125, 0.108375, 0.019125, 0.108375,
        0.108375, 0.614125]]
readout_noise_model_nmc = NoiseModel(basis_gates = ['cx', 'id', 'reset', 'rz', 'sx', 'x'])
readout_noise_model_nmc.add_readout_error(prob_nmc, [0,1,2])
print(readout_noise_model_nmc)

Where prob_nmc is my 8 by 8 confusion matrix. The simulation result based on this model and qubit list doesn't quite make sense, so I wonder if there's anything wrong with the way I added the readout error. I found the code still works if I replace [0,1,2] with [0,-2,1], the latter is obviously incorrect.

Is there anything wrong with my error model? I thought [0,1,2] represents the noise of 'physical qubits' of my simulation model. Am I understanding that correct? Thanks!

$\endgroup$
1

1 Answer 1

3
$\begingroup$

I figured out the problem. We should add the noise separately for each qubit, instead of finding the total matrix and then constructing the noise model:

readout_noise_model_nmc.add_readout_error(probabilities, [0])
readout_noise_model_nmc.add_readout_error(probabilities, [1])

I'm still not clear why we can't assign all the errors at once.

$\endgroup$
2
  • $\begingroup$ Can you add a full snipett on how ti actually implement it? I mean, I cannot understand where this goes exacty. I am trying to implement such a noise model (asymmetric readout) on the QAOA example from Qiskit but I could not understand where exactly this noise goes. $\endgroup$
    – Marion
    May 27, 2022 at 11:41
  • $\begingroup$ is probabilities here the same as prob_nmc from the original question? This seems not to work in the current qiskit release $\endgroup$
    – forky40
    Feb 17, 2023 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.