Is there a way to access the results of measurements 'per shot' performed on a backend such as one of the real IBM machines?

I know it can generate a histogram from the cumulative data, but I was wondering if it is possible to see what the measurement outcomes were for a particular shot out of the standard 1024.


1 Answer 1


There is indeed. You just need to use get_memory() instead of get_counts() (and also use a memory=True flag in the execute function. It works with the local qasm simulator and the 5 qubit device (and not currently with the cloud-based qasm simulator or 14 qubit device).

Here's an example using it to generate a series of random bits.

q = QuantumRegister(1)
c = ClassicalRegister(1)
circ = QuantumCircuit(q, c)



job = execute(circ, Aer.get_backend('qasm_simulator'), shots=10024, memory=True)
data = job.result().get_memory()
  • $\begingroup$ Thank you, this worked when I changed to BasicAer. Are there plans to extend to the other IBM machines? $\endgroup$
    – Caleb GS
    Jan 30, 2019 at 11:43
  • $\begingroup$ All new machine will have it, I think. But for upgrades, I don’t know what the timescales are. $\endgroup$ Jan 30, 2019 at 11:45

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.