Created by Vincent Russo. Supported by the Unitary Fund.
Quantum information consists of:
from toqito.states import bell
bell(0)
[[0.70710678],
[0. ],
[0. ],
[0.70710678]]
$$\texttt{bell(0)} = \frac{1}{\sqrt{2}} \left( |00 \rangle + |11 \rangle \right)$$
from toqito.states import bell
# Density matrices corresponding to Bell states.
rho_0 = bell(0) * bell(0).conj().T
rho_1 = bell(1) * bell(1).conj().T
$$\rho_0 = \frac{1}{2} \left( |0\rangle \langle 0| + |0 \rangle \langle 1 | + |1 \rangle \langle 0| + |1 \rangle \langle 1|\right)$$
$$\rho_1 = \frac{1}{2} \left( |0\rangle \langle 0| - |0 \rangle \langle 1 | - |1 \rangle \langle 0| + |1 \rangle \langle 1|\right)$$
from toqito.states import bell
from toqito.channels import partial_trace, partial_transpose
from toqito.matrix_ops import tensor
from toqito.state_props import is_pure
from toqito.state_metrics import fidelity
# Density matrices corresponding to Bell states.
rho_0 = bell(0) * bell(0).conj().T
rho_1 = bell(1) * bell(1).conj().T
# Compute tensor product of density matrices.
sigma = tensor(rho_0, rho_1)
# Trace out Alice's subsystem of the state.
partial_trace(sigma, sys=[1, 3], dim=[2, 2, 2, 2])
[[0.25 0. 0. 0. ]
[0. 0.25 0. 0. ]
[0. 0. 0.25 0. ]
[0. 0. 0. 0.25]]
# Compute partial transpose of rho_0.
partial_transpose(rho_0)
[[0.5 0. 0. 0. ]
[0. 0. 0.5 0. ]
[0. 0.5 0. 0. ]
[0. 0. 0. 0.5]]
# Check if rho_0 is a pure state.
is_pure(rho_0)
True
# Fidelity between states rho_0 and rho_1.
fidelity(rho_0, rho_1)
0
# Fidelity between identical states.
fidelity(rho_0, rho_0)
1
Play cooperatively. Cannot communicate once game begins.
Gives questions. Takes answers. Decides fate.
$$ a \oplus b = x \land y$$
import numpy as np
from toqito.nonlocal_games.xor_game import XORGame
# The probability matrix.
prob_mat = np.array([[1/4, 1/4], [1/4, 1/4]])
# The predicate matrix.
pred_mat = np.array([[0, 0], [0, 1]])
Classical and quantum value of the CHSH game.
import numpy as np
from toqito.nonlocal_games.xor_game import XORGame
# The probability matrix.
prob_mat = np.array([[1/4, 1/4], [1/4, 1/4]])
# The predicate matrix.
pred_mat = np.array([[0, 0], [0, 1]])
# Define CHSH game from matrices.
chsh = XORGame(prob_mat, pred_mat)
# Classical value of the CHSH game.
# Value of 0.75 which is 3/4.
chsh.classical_value()
0.75
# Quantum value of the CHSH game.
# Value is 0.8536 \approx cos^2(pi/8).
chsh.quantum_value()
0.8535533
State randomly selected from set. What state was given?
from toqito.states import bell
from toqito.state_opt import state_distinguishability
from toqito.state_opt import ppt_distinguishability
from toqito.state_opt import symmetric_extension_hierarchy
# Define the list of states.
states = [bell(0), bell(1), bell(2), bell(3)]
# Probability with which the state is selected.
probs = [1 / 4, 1 / 4, 1 / 4, 1 / 4]
# Distinguishing via global measurements.
state_distinguishability(states, probs)
1
# Distinguishing via PPT measurements.
ppt_distinguishability(states, probs)
0.5
# Hierarchy of SDPs converge to separable value (for some level).
symmetric_extension_hierarchy(states, probs, level=2)
0.5
Distinguishing Bell states via global, PPT, and separable measurements.
from toqito.states import bell
from toqito.state_opt import state_distinguishability
from toqito.state_opt import ppt_distinguishability
from toqito.state_opt import symmetric_extension_hierarchy
# Define the list of states.
states = [bell(0), bell(1), bell(2), bell(3)]
# Probability with which the state is selected.
probs = [1 / 4, 1 / 4, 1 / 4, 1 / 4]
# Distinguishing via global measurements.
state_distinguishability(states, probs)
1
# Distinguishing via PPT measurements.
ppt_distinguishability(states, probs)
0.5
# Hierarchy of SDPs converge to separable value (for some level).
symmetric_extension_hierarchy(states, probs, level=2)
0.5
It is known that distinguishing the Bell states via PPT, SEP, and LOCC yields 1/2.
- GitHub: vprusso/toqito
- Website: vprusso.github.io/toqito
- Documentation toqito.readthedocs.io