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.1.tar.gz (17.6 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.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: entcalcpy-0.1.1.tar.gz
  • Upload date:
  • Size: 17.6 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.1.tar.gz
Algorithm Hash digest
SHA256 324bf1ed481a0826a59483e9035b05cdcfcb66ba3ffe1221e760dd07622f4498
MD5 c783c845171912f922a18959cf51b5ae
BLAKE2b-256 0d6b759a3f88585aff3812b05e3b05fded8aa938ea2bbfbd1971158284afac19

See more details on using hashes here.

File details

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

File metadata

  • Download URL: entcalcpy-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd4b5549ee2126b737b5c986f47473c82043d6e505b0df47ad3c42d5227923d5
MD5 66424900c13b5638404552f17f91ccdd
BLAKE2b-256 8fcf57d7b9ed2902955fcaa4055987459139a99b8f196f3aef828c30e64f6168

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