There are a plethora of quantum python libraries being made and produced. So no need to reinvent the wheel here, if you're looking for a certain quantum operation it probably exists.
- open source Python [library](https://vprusso.github.io/toqito/) for studying various objects in quantum information
```
>>> # 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
```
Note: What is the CHSH game?
- The CHSH game:
- is a thought experiment involving two parties separated at a great distance (far enough to preclude classical communication at the speed of light), each of whom has access to one half of an entangled two-qubit pair. Analysis of this game shows that no classical[local hidden-variable theory](https://handwiki.org/wiki/Local_hidden-variable_theory "Local hidden-variable theory")can explain the correlations that can result from entanglement. Since this game is indeed physically realizable, this gives strong evidence that classical physics is fundamentally incapable of explaining certain quantum phenomenon, at least in a "local" fashion.
- ![[Pasted image 20221212135426.png]]
- it validates the quantum mechanical computation of a system
###### Qitensor
- a python [module](http://stahlke.org/dan/qitensor/) for quantum information and map-state duality
###### QuaEC
- a library for working with error correction
- github found [here](https://github.com/cgranade/python-quaec) and by cgrenade!
###### pyqu
- PyQu is an extension module for Python to implement quantum algorithms
- PyQu is an extension module for Python 3 whose main goal is to provide a complete set of data types and functions for simulating quantum computation with a neat syntax. PyQu is written in C and makes extensive use of libquantum-1.0.0 library by Björn Butscher and Hendrik Weimer. However, PyQu intends not to be just a wrapper of libquantum to Python, but rather a new high-level language (in Python style of course) for quantum programming.