concurrence

concurrence(state)[source]

Calculate the concurrence of a quantum state.

The concurrence of a bipartite Statevector \(|\psi\rangle\) is given by

where \(\rho_0 = Tr_1[|\psi\rangle\!\langle\psi|]\) is the reduced state from by taking the \(~qiskit.quantum_info.partial_trace\) of the input state.

For density matrices the concurrence is only defined for 2-qubit states, it is given by:

where \(\lambda _1 \ge \lambda _2 \ge \lambda _3 \ge \lambda _4\) are the ordered eigenvalues of the matrix \(R=\sqrt{\sqrt{\rho }(Y\otimes Y)\overline{\rho}(Y\otimes Y)\sqrt{\rho}}}\).

Parameters

state (Statevector or DensityMatrix) – a 2-qubit quantum state.

Returns

The concurrence.

Return type

float

Raises
  • QiskitError – if the input state is not a valid QuantumState.

  • QiskitError – if input is not a bipartite QuantumState.

  • QiskitError – if density matrix input is not a 2-qubit state.