qiskit-ibm-runtime icon indicating copy to clipboard operation
qiskit-ibm-runtime copied to clipboard

Dump the running time or outcome of "each shot" in an experiment.

Open alan23273850 opened this issue 10 months ago • 4 comments

What should we add?

Dump the running time or outcome of "each shot" in an experiment. The current version of Qiskit seems not to have this feature. A former version with option "memory=True" can only dump outcomes but not running times. Thank you everyone!

alan23273850 avatar Apr 12 '24 15:04 alan23273850

This is a question that's beyond the scope of base Qiskit's interfaces, but would be special-case access that certain backends might be able to provide, based on how they function underneath. Exposing the raw data can sometimes be very expensive in terms of data transfer for backends, which might explain why people want to drop support for it.

For IBM backends in particular, you might want to look at what options are available to you through the V2 primitives for IBM hardware, which may give you what you need - the exact details are a bit outside my wheelhouse sorry. Beyond that, you'll probably be better off asking on https://github.com/Qiskit/qiskit-ibm-runtime, which is the repository for the frontend to the IBM hardware.

jakelishman avatar Apr 16 '24 15:04 jakelishman

I'm not familiar with this feature. What format would this timing information be specified in, and what exactly is it timing? Like a timestamp for each shot?

ihincks avatar Apr 16 '24 15:04 ihincks

My timing means the total running time of a quantum circuit in each shot. I've participated in some talk where the speaker claims that if this information can be printed, then it would be very helpful to his research. Is it possible for IBM backends? Thanks again!

alan23273850 avatar Apr 16 '24 16:04 alan23273850

Exactly what kind of per-shot running time are you looking for? If it's just gate time (i.e. time needed to process all the gates), then you can already calculate that number using the gate & readout lengths from backend properties. If you want to start the timing from when the quantum program is loaded into control electronics, then there isn't really a "per shot" time since some operations (like load) only happens once.

By the way, in case it wasn't obvious, SamplerV2 already gives you per shot measurement (similar to the old memory=True).

jyu00 avatar Apr 16 '24 21:04 jyu00

Closing since there doesn't seem to be further questions.

jyu00 avatar Jul 02 '24 16:07 jyu00