Skip to main content

Python package for computation of geometric entanglement

Project description

entcalcpy

entcalcpy is a Python package for computing the geometric entanglement of a given quantum state. It works by computing lower and upper bounds for the geometric entanglement. These bounds are often close to each other, allowing us to estimate the value of the geometric entanglement in a given quantum state.

Table of Contents

Installation

pip install entcalcpy

Dependencies

This package requires the following Python packages:

  • numpy ≥ 2.2.4
  • scipy ≥ 1.15.2
  • cvxpy ≥ 1.6.4
  • qutip ≥ 5.1.0

Getting started

To get started with entcalcpy, we recommend checking the examples section. The documentation is written in docstrings. Below we present some basic usage of functions. For example, the following code computes the upper bound of the geometric entanglement of a random quantum state.

import qutip
import entcalcpy as en
rho=qutip.rand_dm(8)
print(en.uppersame(rho,[2,2,2])) #second argument specifies that we have a 3-qubit state
print(en.upperbip(rho,[4,2])) #here we have a 4x2 bipartite state

Similarly, we can compute the lower bound

import qutip
import entcalcpy as en
rho=qutip.rand_dm(8)
print(en.ge_mixed_gr(rho,[2,2,2])) #second argument specifies that we have a 3-qubit state
print(en.ge_mixed_gr(rho,[4,2])) #here we have a 4x2 bipartite state

The lower bound can be computed using four different methods.

ge_mixed_gr vs ge_mixed_ra_gr

ge_mixed_gr and ge_mixed_sm as a first step computes a purification of the input state. They do it by so-called canonical purification. ge_mixed_ra_gr takes input state in the form of orthogonal decomposition. Thanks to it, it can compute lower-dimensional purification and compute lower boudnd more efficiently. For example, if ge_mixed_gr takes n-qubit state as input, it must optimize over matrix with dimesnions $2^{2n}\times 2^{2n}$ matrices. If the state is rank-2, ge_mixed_ra_gr optimizes over matrix with dimesnions $2^{n+1}\times 2^{n+1}$. Thanks to this, it can compute entanglement for more qubits and can make it much faster.

Solvers

entcalcpy can use two solvers: "SCS" and "MOSEK". "SCS" is installed when cvxpy is installed. For some problems, it may need a long time to find a solution. If the solution is not found within given iteration limit, it return message that the solution might be inaccurate. In that scenario, the result might be higher than a lower bound. If this happens, we recommend using "MOSEK". It is not a free solver, but one can use it for free for academic purposes.

Issues

If you find any issues, we encourage you to report them via GitHub or by emailing maspiotr00@gmail.com.

Acknowledgment

Special thanks to Krystyna Mordzińska for coming up with the package name after a creative brainstorming session.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citing

If you use entcalcpy in academic work, please cite this package.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

entcalcpy-0.1.0.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

entcalcpy-0.1.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file entcalcpy-0.1.0.tar.gz.

File metadata

  • Download URL: entcalcpy-0.1.0.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for entcalcpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 185bf1589d99909fc77b1ccf17a67cd82718fe52518d2ae5dd8e7597e7890b05
MD5 b713c61ec46fba9881878b6f8b37fd32
BLAKE2b-256 fd3cbb1839a7727c0e4d8b8ff0e3d9324f556bbd9c953363722c70cae59b7119

See more details on using hashes here.

File details

Details for the file entcalcpy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: entcalcpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for entcalcpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d570989884a70a945fdd40e4a0fea88d91fab70755bdb527343c7f75a4c54ca
MD5 5bd619062bbaa76959179a54867e3fc9
BLAKE2b-256 573c05d5462ac5eac6e99115ad29e419e5211e03fa8e5a5f7520bc98c392f39c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page