Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analysis results extra setter behavior #1343

Open
coruscating opened this issue Dec 13, 2023 · 2 comments
Open

Analysis results extra setter behavior #1343

coruscating opened this issue Dec 13, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@coruscating
Copy link
Collaborator

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:

for res in tomo_data.analysis_results(block=False):
res.extra["mitigated"] = True
# Combine results so that tomography results are ordered first
combined_data = [tomo_data, roerror_data]
# Run unmitigated tomography analysis
if self.options.unmitigated_fit:
tomo_analysis.set_options(measurement_basis=PauliMeasurementBasis())
nomit_data = tomo_analysis.run(tomo_data, replace_results=False).block_for_results()
for res in nomit_data.analysis_results(block=False):
res.extra["mitigated"] = False
combined_data.append(nomit_data)

@coruscating coruscating added the bug Something isn't working label Dec 13, 2023
@ItamarGoldman
Copy link
Contributor

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
Copy link
Contributor

yaelbh commented Dec 21, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants