I know that fidelity is to gauge how similar two states are, so F = |<\psi|\phi>|^2. But I am a bit confused about the mathematical definition of state_fidelity
in qiskit documentation.
qiskit.org/documentation/stubs/qiskit.quantum_info.state_fidelity.html
Besides, after I create 2 quantum circuits, and input them into state_fidelity
, I got an error. Any ideas?
from qiskit import QuantumCircuit
from qiskit.quantum_info import state_fidelity
n = 2
qc1 = QuantumCircuit(n)
qc2 = QuantumCircuit(n)
f = state_fidelity(qc1, qc2, validate=True)
Error:
QiskitError: 'Input is not a quantum state'