All Projects → stephenhky → pyqentangle

stephenhky / pyqentangle

Licence: MIT license
Quantum Entanglement in Python

Programming Languages

python
139335 projects - #7 most used programming language
cython
566 projects

Projects that are alternatives of or similar to pyqentangle

qnm
Python package for computing Kerr quasinormal mode frequencies, separation constants, and spherical-spheroidal mixing coefficients
Stars: ✭ 21 (+31.25%)
Mutual labels:  physics, numerical-methods
encounter
Remaking the classic C64 game in WebGL.
Stars: ✭ 45 (+181.25%)
Mutual labels:  physics
good-reads
List of inspiring articles, blogs, tutorials and books. Tech stuff.
Stars: ✭ 14 (-12.5%)
Mutual labels:  physics
dh-core
Functional data science
Stars: ✭ 123 (+668.75%)
Mutual labels:  numerical-methods
gopem
GUI for OPEM library
Stars: ✭ 20 (+25%)
Mutual labels:  physics
ai4materials
Deep learning for crystal-structure recognition and analysis of atomic structures
Stars: ✭ 26 (+62.5%)
Mutual labels:  physics
canvas-fluid-solver
Real-time fluid simulation in Javascript.
Stars: ✭ 45 (+181.25%)
Mutual labels:  physics
cannon-es-debugger
Wireframe debugger for use with cannon-es https://github.com/react-spring/cannon-es
Stars: ✭ 69 (+331.25%)
Mutual labels:  physics
spark-ar-physics
A helper module for connecting Spark AR with physics libraries
Stars: ✭ 28 (+75%)
Mutual labels:  physics
MAPLEAF
6-DOF Rocket Flight Simulation Framework
Stars: ✭ 28 (+75%)
Mutual labels:  physics
inelastica
Python package for eigenchannels, vibrations and inelastic electron transport based on SIESTA/TranSIESTA DFT
Stars: ✭ 22 (+37.5%)
Mutual labels:  physics
spfpm
Package for performing fixed-point, arbitrary-precision arithmetic in Python.
Stars: ✭ 61 (+281.25%)
Mutual labels:  numerical-methods
react-redux-platformer
A clone of Six using react-game-kit
Stars: ✭ 24 (+50%)
Mutual labels:  physics
Unity3D-Cars
A project built for a Renaissance Coders tutorial to introduce vehicle physics.
Stars: ✭ 60 (+275%)
Mutual labels:  physics
Comp PhysChem Basic
A mini-course offered to Undergrad chemistry students
Stars: ✭ 19 (+18.75%)
Mutual labels:  numerical-methods
AsFem
A Simple Finite Element Method program (AsFem)
Stars: ✭ 108 (+575%)
Mutual labels:  numerical-methods
poisson-image-blending
🎨 Web-based implementation of the poisson image blending in HTML5 Canvas / JavaScript
Stars: ✭ 22 (+37.5%)
Mutual labels:  numerical-methods
Fermi.jl
Fermi quantum chemistry program
Stars: ✭ 107 (+568.75%)
Mutual labels:  physics
mxfactorial
a payment application intended for deployment by the united states treasury
Stars: ✭ 36 (+125%)
Mutual labels:  physics
DynamicalBilliards.jl
An easy-to-use, modular, extendable and absurdly fast Julia package for dynamical billiards in two dimensions.
Stars: ✭ 97 (+506.25%)
Mutual labels:  physics

Quantum Entanglement in Python

CircleCI GitHub release Documentation Status Updates Python 3 pypi download

Version

The releases of pyqentangle 2.x.x is incompatible with previous releases.

The releases of pyqentangle 3.x.x is incompatible with previous releases.

Since release 3.1.0, the support for Python 2.7 and 3.5 has been decomissioned.

Installation

This package can be installed using pip.

>>> pip install -U pyqentangle

To use it, enter

>>> import pyqentangle
>>> import numpy as np

Schmidt Decomposition for Discrete Bipartite States

We first express the bipartite state in terms of a tensor. For example, if the state is |01>+|10>, then express it as

>>> tensor = np.array([[0., np.sqrt(0.5)], [np.sqrt(0.5), 0.]])

To perform the Schmidt decompostion, just enter:

>>> pyqentangle.schmidt_decomposition(tensor)
[(0.7071067811865476, array([ 0., -1.]), array([-1., -0.])),
 (0.7071067811865476, array([-1.,  0.]), array([-0., -1.]))]

For each tuple in the returned list, the first element is the Schmidt coefficients, the second the component for first subsystem, and the third the component for the second subsystem.

Schmidt Decomposition for Continuous Bipartite States

We can perform Schmidt decomposition on continuous systems too. For example, define the following normalized wavefunction:

>>> fcn = lambda x1, x2: np.exp(-0.5 * (x1 + x2) ** 2) * np.exp(-(x1 - x2) ** 2) * np.sqrt(np.sqrt(8.) / np.pi)

Then perform the Schmidt decomposition,

>>> modes = pyqentangle.continuous_schmidt_decomposition(biwavefcn, -10., 10., -10., 10., keep=10)

where it describes the ranges of x1 and x2 respectively, and keep=10 specifies only top 10 Schmidt modes are kept. Then we can read the Schmidt coefficients:

>>> list(map(lambda dec: dec[0], modes))
[0.9851714310094161,
 0.1690286950361957,
 0.02900073920775954,
 0.004975740210361192,
 0.0008537020544076649,
 0.00014647211608480773,
 2.51306421011773e-05,
 4.311736522272035e-06,
 7.39777032460608e-07,
 1.2692567250688184e-07]

The second and the third elements in each tuple in the list decompositions are lambda functions for the modes of susbsystems A and B respectively. The Schmidt functions can be plotted:

>>> xarray = np.linspace(-10., 10., 100)

    plt.subplot(3, 2, 1)
    plt.plot(xarray, modes[0][1](xarray))
    plt.subplot(3, 2, 2)
    plt.plot(xarray, modes[0][2](xarray))

    plt.subplot(3, 2, 3)
    plt.plot(xarray, modes[1][1](xarray))
    plt.subplot(3, 2, 4)
    plt.plot(xarray, modes[1][2](xarray))

    plt.subplot(3, 2, 5)
    plt.plot(xarray, modes[2][1](xarray))
    plt.subplot(3, 2, 6)
    plt.plot(xarray, modes[2][2](xarray))

alt

Useful Links

Reference

  • Artur Ekert, Peter L. Knight, "Entangled quantum systems and the Schmidt decomposition", Am. J. Phys. 63, 415 (1995).

Acknowledgement

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].