Skip to content

geonda/quantum-computing

Repository files navigation

quantum-computing

Modeling Bell's (CHSH) inequality with Qiskit.

CHSH correlation function (S) vs relative angle between detectors ($\theta$).

CHSH correlation function vs relative angle between detectors (\theta).

Formulation

From the classical point of view, the following inequality holds for any local hidden variable theory

Here

S=E(\textbf{AB})-E(\textbf{AB^'})+E(\textbf{A^'B^'})+E(\textbf{A^'B}) \ \ \ \ \ \ \ (2).

and

E(\textbf{AB}) - is a correlation function (for example, spin-spin correlation function) between two points on different sides of the source and arbitrary unit vectors \textbf{A} and \textbf{B} give the orientation of the detectors.

However, within the framework of quantum mechanics (QM), things are different. There are spicific orientations of the ditectors for which S is greater than two.

Thus ineq. 1 appears to be an important and convenient test in favor of one or another theory. So far, the experiment (despite some challenges) confirms the prediction of the quantum mechanic and, consequently, the non-locality of our nature.

Detectors

We can arbitrary constrain angles between detectors to be \angle(\textbf{A, B})=\angle(\textbf{B, A^'})=\angle(\textbf{A^',B^' })=\theta.

Then S becomes only a function of \theta.

Positions of detectors (A, A', B, B'). Bloch's spheres were projected onto xz plane.

Projection of Bloch's sphere onto xz plane and positions of detectors (A, A', B, B') for \theta=0, \pi/4, \pi/2.

QM analytical solution for spin 1/2 system

E(\textbf{AB}) =\textless \psi|\sigma(\textbf{A}) \sigma(\textbf{B})|\psi \textgreater=cos(\theta) \ \ \ \ \ \ \ (3),

here \left |\psi \textgreater \right . is an entangled state of two qubits (Bell state):

\left |\psi \textgreater \right .= \frac{\[ \ |00 \textgreater + |11 \textgreater \]}{\sqrt{2}} \ \ \ \ \ \ \ (4).

Modeling with Qiskit

E(\textbf{AB}) = \frac{N(\textbf{AB}){11}+N(\textbf{AB}){00}-N(\textbf{AB}){01}-N(\textbf{AB}){10}}{N(\textbf{AB}){11}+N(\textbf{AB}){00}+N(\textbf{AB}){01}+N(\textbf{AB}){10}} \ \ \ \ \ \ \ (5).

N(\textbf{AB})_{ij} is a number of counts registered in a given state (\left |ij \textgreater \right.), where i,j={0,1}  .

QM errors

While quantum simulator gives perfect agreement with the analytical solution, quantum calculations on real devices accompanied by certain noise/errors. For example, measurement of the Bell state along the z-axis, should not in principle, contains any contribution with mixed spin. Still, QC produces non-zero probability to obtain |01> and |10> states (check /quantum_errors/).

Manual

Required packages can be installed using pip and are listed in requirements.txt file.

To get correlation S(\theta) use

$ python run.py

There are two options for QM calculations using Aer qiskit simulator (run_type='sim') or real quantum computer (run_type='ibmq').

To use ibm quantum computer one has to register here and specify token and name of the machine in ibm_setting.json.

Usefull links

Qiskit docs

QC tutorial

References

About

Modeling Bell's (CHSH) inequality with Qiskit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published