# How can I get the results from simulating noise models?

I'm trying to run some simulations of my quantum circuits using qasm simulator. I first tried to import the noise data from a quantum device and then use that information on qasm. Here's part of my code:

provider = IBMQ.load_account()
backend = provider.get_backend('ibmq_casablanca')
noise_model = NoiseModel.from_backend(backend)
coupling_map = backend.configuration().coupling_map
basis_gates = noise_model.basis_gates
result = execute(circ, Aer.get_backend('qasm_simulator'),
coupling_map = coupling_map,
basis_gates = basis_gates,
noise_model = noise_model).result()


When I return type(result), it seems like the code is working, but I could not get any counts from here. It returns me QiskitError: 'No counts for experiment "0"' as I attempted counts = result.get_counts(0). I wonder am I really running the simulation? How can I get the counts? Thanks for the help!

• Did you add any measurements to your circuit? If you didn't then that could be the problem. Oct 28 at 2:53
• @KAJ226 You're right. I didn't add the measurement. It works now. Thanks so much!
– ZR-
Oct 28 at 3:03
• --------No problem------ Oct 28 at 3:09