1

I want to compare the fidelity of a circuit implemented on IBMQ Santiago with the ideal circuit simulated using the statevector backend. Is there a way to do this? So far I have only seen examples where both circuits involve the statevector backend.

glS
  • 24,708
  • 5
  • 34
  • 108
sycramore
  • 325
  • 1
  • 10

1 Answers1

1

It is not possible to compare the statevector of a circuit run on the statevector_simulator and on a real device, like IBMQ Santiago, because the result of a job run on hardware is in the form of counts. You can see this by running the following command in qiskit:

job.result().data(circuit)

for a specific circuit and job run on a real IBMQ device. The output you will get will be in the form of

{'counts': {...}}

where {...} is a dictionary mapping states to counts for those states.

If you run the same command on a job run on the statevector simulator, you will get

{'counts':{...}, 'statevector': array([...])}

where array([...]) is an array form of the resulting statevector, and the dictionary for counts maps that same statevector to a count of 1.

However, you can compute the hellinger fidelity, which compares counts instead of state vectors. You can read more about it here: https://qiskit.org/documentation/stubs/qiskit.quantum_info.hellinger_fidelity.html

Winona
  • 479
  • 3
  • 5