qiskit-community / qiskit-experiments

Qiskit Experiments
https://qiskit-community.github.io/qiskit-experiments/
Apache License 2.0
160 stars 126 forks source link

Investigate performance of ExperimentData regarding adding more data to it #1394

Open wshanks opened 9 months ago

wshanks commented 9 months ago

In #1360, there was some discussion that we give up performance in order to allow experiments to be extended with additional data. We should look at how much ExperimentData could benefit from only allowing a fixed set of data and if it would be better to write a function that could run analysis on multiple ExperimentData objects. Or perhaps calling .run() a second time should generate a new ExperimentData object and new experiment ID that combines the old data and the new data? Perhaps there would need to be a new method .extend_run() instead of changing run.

          Another option would be to stop over-engineering. We currently allow users to run experiment on existing experiment data to get more statistically confident result. But I don't think this is heavy used feature and we can remove. In principle we run very expensive operation for the sake of something useless; if we have 100 xvals, we need to iterate over them and create new table with size=1 to average... Even if we switch to polars there still be overhead of object creation.

_Originally posted by @nkanazawa1989 in https://github.com/Qiskit-Extensions/qiskit-experiments/pull/1360#discussion_r1480133699_