# Simulating readout errors on aer simulator

I'm trying to simulate quantum experiments using a customized noise model. Here's my code:

probabilities[0] = [0.9, 0.15]
probabilities[1] = [0.1, 0.85]


However, as I run the code, it returns me

--> 259         num_outcomes = len(probabilities[0])
260         num_qubits = int(np.log2(num_outcomes))
261         if 2**num_qubits != num_outcomes:

TypeError: object of type 'float' has no len()


I don't know why this happens since I could find len(probabilities[0])=2. How can I set up the noise model for readout errors? Thanks so much for the help!

• It might help if you could provide more of your code (ideally a minimal standalone example to reproduce the error). The error seems to be related to the object type of probabilities but your code doesn't show how that variable is declared. Nov 12 '21 at 19:45

readout_noise_model.add_readout_error(probabilities, [0])