qiskit-community / qiskit-experiments

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

Analysis results `extra` setter behavior #1343

Open coruscating opened 9 months ago

coruscating commented 9 months ago

As reported by Erick, after the dataframes refactor, MitigatedTomographyAnalysis isn't able to set the extra flag so the user is unable to easily distinguish whether a result is mitigated or not:

https://github.com/Qiskit-Extensions/qiskit-experiments/blob/8cc20dfed97afb1320004b4757b5006b41840777/qiskit_experiments/library/tomography/mit_tomography_analysis.py#L110-L122

ItamarGoldman commented 8 months ago

With the current version of main, I couldn't recreate the error. @coruscating, could you tag Erick with so I will get a code snippet that recreate the error? The code I ran was the following:


from qiskit_aer import AerSimulator
from qiskit.providers.fake_provider import FakePerth

backend = AerSimulator.from_backend(FakePerth())

import qiskit
from qiskit_experiments.library import MitigatedStateTomography

# GHZ State preparation circuit
nq = 2
qc_ghz = qiskit.QuantumCircuit(nq)
qc_ghz.h(0)
qc_ghz.s(0)
for i in range(1, nq):
    qc_ghz.cx(0, i)

# QST Experiment
qstexp1 = MitigatedStateTomography(qc_ghz)
qstdata1 = qstexp1.run(backend, seed_simulation=100).block_for_results()

# Print results
for result in mqstdata1.analysis_results():
    print(result)

state_result = mqstdata1.analysis_results("state")
print(state_result.value)
yaelbh commented 8 months ago

@ItamarGoldman I think @nkanazawa1989 is already working on this issue in #1344.