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]
readout_noise_model = NoiseModel()
readout_noise_model.add_readout_error(probabilities[0], [0])
readout_noise_model.add_readout_error(probabilities[1], [0])
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!
probabilities
but your code doesn't show how that variable is declared. $\endgroup$