Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Modify definition of readout fidelity in TensoredMeasFitter #595

Open
peendebak opened this issue Sep 13, 2021 · 0 comments
Open

Modify definition of readout fidelity in TensoredMeasFitter #595

peendebak opened this issue Sep 13, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@peendebak
Copy link

What is the expected behavior?

I have a question on the definition of the readout fidelity for the TensoredMeasFitter (see TensoredMeasFitter docs ). It is defined as the average of the diagonal entries in the individual calibration matrices. But this does not reflect the fidelity of the overall system. This also means the fidelity is not equal to the fidelity we can when we project a full system onto components and then put the components in a TensoredMeasFitter . A minimal example

import itertools
import numpy as np
from qiskit.ignis.mitigation.measurement import CompleteMeasFitter, TensoredMeasFitter

N=3
v=[ [0,1]]*N
state_labels_full = [ ''.join([str(x) for x in t]) for t in itertools.product(*v) ]

full_calibration_matrix=np.array([1])
for ii in range(5):
    A=0.1+.05*np.random.rand(2,2)
    A[0,0]=1-A[0,1]
    A[1,1]=1-A[1,0]
    full_calibration_matrix = np.kron(A, full_calibration_matrix)

print(np.round(full_calibration_matrix, 3))


#print(full_calibration_matrix)

meas_fitter_full = CompleteMeasFitter(None, state_labels=state_labels_full)
meas_fitter_full.cal_matrix = full_calibration_matrix

single_fitters = [meas_fitter_full.subset_fitter([q]) for q in range(N)]


tf=TensoredMeasFitter(results=None, mit_pattern= [ [x] for x in range(N)])
tf.cal_matrices= [s.cal_matrix for s in single_fitters]

print(f'full fitter: fidelity {meas_fitter_full.readout_fidelity():.4f}')

for ii in range(N):
    print(f'subsystem {ii}: fidelity {single_fitters[ii].readout_fidelity():.4f}')
print(f'tensored fitter: fidelity {tf.readout_fidelity():.4f}') # should be equal to the full fitter fidelity?

The output is:

full fitter: fidelity 0.4967
subsystem 0: fidelity 0.6649
subsystem 1: fidelity 0.6696
subsystem 2: fidelity 0.6819
tensored fitter: fidelity 0.6649

Is there a reason for the current definition of the readout fidelity in the TensoredMeasFitter? Or would it be better to refine the fidelity to be more in line with the CompleteMeasFitter?

@peendebak peendebak added the enhancement New feature or request label Sep 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant