Entanglement measures#
Set of functions to calculate entanglement measures.
Concurrence#
- qibo.quantum_info.concurrence(state, bipartition, check_purity=True, backend=None)[source]#
Calculates concurrence of a pure bipartite quantum state \(\rho \in \mathcal{H}_{A} \otimes \mathcal{H}_{B}\) as
\[C(\rho) = \sqrt{2 \, (\text{tr}^{2}(\rho) - \text{tr}(\rho_{A}^{2}))} \, ,\]where \(\rho_{A} = \text{tr}_{B}(\rho)\) is the reduced density operator obtained by tracing out the qubits in the
bipartition\(B\).- Parameters:
state (ArrayLike) – statevector or density matrix.
bipartition (list or tuple) – qubits in the subsystem to be traced out.
check_purity (bool, optional) – if
True, checks ifstateis pure. IfFalse, it assumesstateis pure. Defaults toTrue.backend (
qibo.backends.abstract.Backend, optional) – backend to be used in the execution. IfNone, it uses the current backend. Defaults toNone.
- Returns:
Concurrence of \(\rho\).
- Return type:
Entanglement of formation#
- qibo.quantum_info.entanglement_of_formation(state, bipartition, base=2, check_purity=True, backend=None)[source]#
Calculates the entanglement of formation \(E_{f}\) of a pure bipartite quantum state \(\rho\), which is given by
\[E_{f} = H([1 - x, x]) \, ,\]where
\[x = \frac{1 + \sqrt{1 - C^{2}(\rho)}}{2} \, ,\]\(C(\rho)\) is the
qibo.quantum_info.concurrence()of \(\rho\), and \(H\) is theqibo.quantum_info.entropies.shannon_entropy().Note
This expression is valid only if at least one of the two subsystems is a single qubit. For pure states of larger subsystems, see
qibo.quantum_info.entanglement_entropy().- Parameters:
state (ArrayLike) – statevector or density matrix.
bipartition (list or tuple) – qubits in the subsystem to be traced out.
base (float) – the base of the log in
qibo.quantum_info.entropies.shannon_entropy(). Defaults to \(2\).check_purity (bool, optional) – if
True, checks ifstateis pure. IfFalse, it assumesstateis pure. Defaults toTrue.backend (
qibo.backends.abstract.Backend, optional) – backend to be used in the execution. IfNone, it uses the current backend. Defaults toNone.
- Returns:
entanglement of formation of state \(\rho\).
- Return type:
References
W. K. Wootters, Entanglement of Formation of an Arbitrary State of Two Qubits, Phys. Rev. Lett. 80, 2245 (1998).
Negativity#
- qibo.quantum_info.negativity(state, bipartition, backend=None)[source]#
Calculates the negativity of a bipartite quantum state.
Given a bipartite state \(\rho \in \mathcal{H}_{A} \otimes \mathcal{H}_{B}\), the negativity \(\operatorname{Neg}(\rho)\) is given by
\[\operatorname{Neg}(\rho) = \frac{1}{2} \, \left( \|\rho^{T_{B}}\|_{1} - 1 \right) \, ,\]where \(\rho^{T_{B}}\) is the partial transpose of \(\rho\) with respect to partition \(B\), and \(\|\cdot\|_{1}\) is the Schatten \(1\)-norm (also known as nuclear norm or trace norm).
- Parameters:
state (ArrayLike) – statevector or density matrix.
bipartition (list or tuple) – indices of qubits in partition \(B\), which is partially transposed.
backend (
qibo.backends.abstract.Backend, optional) – backend to be used in the execution. IfNone, it uses the current backend. Defaults toNone.
- Returns:
Negativity \(\operatorname{Neg}(\rho)\) of state \(\rho\).
- Return type:
References
G. Vidal, R. F. Werner, Computable measure of entanglement, Phys. Rev. A 65, 032314 (2002).
Entanglement fidelity#
- qibo.quantum_info.entanglement_fidelity(channel, nqubits, state=None, backend=None)[source]#
Entanglement fidelity \(F_{\mathcal{E}}\) of a
channel\(\mathcal{E}\) onstate\(\rho\) is given by\[F_{\mathcal{E}}(\rho) = F(\rho_{f}, \rho)\]where \(F\) is the
qibo.quantum_info.fidelity()function for states, and \(\rho_{f} = \mathcal{E}_{A} \otimes I_{B}(\rho)\) is the state after the channel \(\mathcal{E}\) was applied to partition \(A\).- Parameters:
channel (
qibo.gates.channels.Channel) – quantum channel acting on partition \(A\).nqubits (int) – total number of qubits in
state.state (ArrayLike, optional) – statevector or density matrix to be evolved by
channel. IfNone, defaults to the maximally entangled state \(\frac{1}{\sqrt{d}} \, \sum_{k = 0}^{d - 1} \, \ket{k}\ket{k}\), where \(d = 2^{n / 2}\) and \(n\) isnqubits, which has to be even. The first \(n / 2\) qubits are paired with the last \(n / 2\) qubits. Defaults toNone.backend (
qibo.backends.abstract.Backend, optional) – backend to be used in the execution. IfNone, it uses the current backend. Defaults toNone.
- Returns:
Entanglement fidelity \(F_{\mathcal{E}}\).
- Return type:
Meyer-Wallach entanglement#
- qibo.quantum_info.meyer_wallach_entanglement(state, backend=None)[source]#
Compute the Meyer-Wallach entanglement \(Q\) of a
state,\[Q(\rho) = 2\left(1 - \frac{1}{N} \, \sum_{k} \, \text{tr}\left(\rho_{k}^{2}\right)\right) \, ,\]where \(\rho_{k}\) is the reduced density matrix of qubit \(k\), and \(N\) is the total number of qubits in
state. We use the definition of the Meyer-Wallach entanglement as the average purity proposed in Brennen (2003), which is equivalent to the definition introduced in Meyer and Wallach (2002).- Parameters:
state (ArrayLike) – statevector or density matrix of a pure state.
backend (
qibo.backends.abstract.Backend, optional) – backend to be used in the execution. IfNone, it uses the current backend. Defaults toNone.
- Returns:
Meyer-Wallach entanglement \(Q\).
- Return type:
References
G. K. Brennen, An observable measure of entanglement for pure states of multi-qubit systems, Quantum Information and Computation, vol. 3 (6), 619-626 (2003).
D. A. Meyer and N. R. Wallach, Global entanglement in multiparticle systems, J. Math. Phys. 43, 4273–4278 (2002).
Entanglement capability#
- qibo.quantum_info.entangling_capability(circuit, samples, seed=None, backend=None)[source]#
Return the entangling capability \(\text{Ent}\) of a parametrized circuit.
It is defined as the average Meyer-Wallach entanglement \(Q\) (
qibo.quantum_info.meyer_wallach_entanglement()) of thecircuit, i.e.\[\text{Ent} = \frac{1}{|\mathcal{S}|}\sum_{\theta_{k} \in \mathcal{S}} \, Q(\rho_{k}) \, ,\]where \(\mathcal{S}\) is the set of sampled circuit parameters, and \(\rho_{k}\) is the state prepared by the circuit with uniformly-sampled parameters \(\theta_{k}\).
Note
Currently, function does not work with
circuitthat contains noisy channels.Note
The parameters of
circuitare overwritten by the sampling. After the call,circuitholds the last sampled parameters.- Parameters:
circuit (
qibo.models.Circuit) – Parametrized circuit.samples (int) – number of sampled circuit parameter vectors \(|\mathcal{S}|\).
seed (int or
numpy.random.Generator, optional) – Either a generator of random numbers or a fixed seed to initialize a generator. IfNone, initializes a generator with a random seed. Default:None.backend (
qibo.backends.abstract.Backend, optional) – backend to be used in the execution. IfNone, it uses the current backend. Defaults toNone.
- Returns:
Entangling capability \(\text{Ent}\).
- Return type:
References
S. Sim, P. D. Johnson, and A. Aspuru-Guzik, Expressibility and entangling capability of parameterized quantum circuits for hybrid quantum-classical algorithms, Adv. Quantum Technol. 2, 1900070 (2019).