Skip to content

Mitigatied State Tomography re-analyze problem #1499

@44hsiang

Description

@44hsiang

Informations

  • Qiskit Experiments version: 0.7.0
  • Python version: 3.9.18
  • Operating system: MacOs

What is the current behavior?

I am trying to re-analyze my data by using MitigatedStateTomography, but it didn't improve the fidelity. I compare it with the StateTomography.

Steps to reproduce the problem

I prepare a set of measurement data of Bell state.

{'XX': {'01': 38, '10': 40, '00': 450, '11': 496},
 'XY': {'10': 254, '00': 254, '11': 259, '01': 257},
 'XZ': {'01': 242, '00': 244, '10': 266, '11': 272},
 'YX': {'01': 249, '10': 273, '11': 231, '00': 271},
 'YY': {'01': 458, '11': 44, '00': 37, '10': 485},
 'YZ': {'01': 261, '00': 252, '11': 241, '10': 270},
 'ZX': {'01': 244, '10': 260, '00': 264, '11': 256},
 'ZY': {'10': 245, '11': 262, '00': 264, '01': 253},
 'ZZ': {'01': 40, '10': 28, '00': 432, '11': 524}}

and local mitigator data

[{'01': 30, '11': 1, '00': 953, '10': 40},
 {'01': 47, '00': 3, '10': 37, '11': 937}]

First I use StateTomography to check my fidelity

from qiskit.providers.fake_provider import GenericBackendV2
from qiskit_experiments.library import StateTomography

fake_backend = GenericBackendV2(num_qubits=len(qubits))

qc_ghz = QuantumCircuit(2)
qc_ghz.h(0)
for i in range(1, 2):
    qc_ghz.cx(0, i)

qstexp = StateTomography(qc_ghz)
qstdata = qstexp.run(fake_backend).block_for_results()

then replace the data by

qiskit_measurement_list = ['ZZ', 'ZX', 'ZY', 'XZ', 'XX', 'XY', 'YZ', 'YX', 'YY']
for i in range(len(qiskit_measurement_list)):
    qstdata.data(i)['counts']= measurement_counts[qiskit_measurement_list[I]]
analysis_again = qstexp.analysis.run(experiment_data=qstdata,replace_results=True)

Then I can get the fidelity = 88.91%

fidelity = analysis_again.analysis_results("state_fidelity").value
print(f"fidelity ={fidelity:.4%}")

Then I try to use the MitigatedStateTomography to see if I can perform readout mitigation

mitiga_qstexp1 = MitigatedStateTomography(qc_ghz)
mitiga_qstdata1 = mitiga_qstexp1.run(fake_backend).block_for_results()
qiskit_measurement_list = ['ZZ', 'ZX', 'ZY', 'XZ', 'XX', 'XY', 'YZ', 'YX', 'YY']

for i in range(len(qubits)):
    mitiga_qstdata1.data()[i]['counts']= LRE_result[i]

for i in range(len(qiskit_measurement_list)):
    mitiga_qstdata1.data()[i+len(qubits)]['counts']= measurement_counts[qiskit_measurement_list[I]]

#re-analyze the data
mitigated_analysis_again1 = mitiga_qstexp1.analysis.run(experiment_data=mitiga_qstdata1,replace_results=True)

mitigated_fidelity1 = mitigated_analysis_again1.analysis_results("state_fidelity").value
print(f"mitigated fidelity ={mitigated_fidelity1:.4%}")

Finally I got the similar fidelity with previous data, without readout mitigation.

What is the expected behavior?

I expected after the readout mitigation, the state fidelity will close to 99%. Because the data I prepared are produced by the qiskit fakebackend. But it seems the data didn't change too much. I have check the Local Readout Mitigator before and after run the analysis. It did change.

Suggested solutions

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions