qiskit-community / povm-toolbox

A toolbox for the implementation of positive operator-valued measures (POVMs).
https://qiskit-community.github.io/povm-toolbox/
Apache License 2.0
6 stars 0 forks source link

Add option to return inidividual samples from POVMSampler #33

Closed LaurinFischer closed 3 weeks ago

LaurinFischer commented 3 weeks ago

It would nice to have the option to return POVM outcomes as individual samples rather than as a counts dictionary.

The current qiskit_ibm_runtime.SamplerV2 has some utility functions that enable this. More specifically,

job = sampler.run([test_circ])
job.result()[0].data.meas.get_counts()

returns a counts dictionary, while job.result()[0].data.meas.get_bitstrings() returns a list of individual samples.

A similar functionality for the POVMSampler could be enabled with an additional method for the POVMSPubResult class. I guess .get_bitstrings is a poor name in the context of POVMs, but I suggest this could be called ..get_samples.