2
$\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$
2
$\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$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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