toqito is an open source Python library for studying various objects in quantum information.

  • Estimate quantum and classical values of nonlocal games.
  • Optimizations for quantum state distinguishability scenarios.
  • Functions for exploring measures of entanglement and entangled states.
  • Perform operations on and determine properties of quantum states, channels, and measurements.
  • Support for generating random quantum states and measurement operators.
  • Pure Python module that easily integrates into existing projects.
>>> # Calculate the 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)
>>> 
>>> chsh.classical_value()
0.75
>>> chsh.quantum_value()
0.8535533