entcalcpy 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, Piotr Masajada and contributors
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,103 @@
1
+ Metadata-Version: 2.4
2
+ Name: entcalcpy
3
+ Version: 0.1.0
4
+ Summary: Python package for computation of geometric entanglement
5
+ Author: Aby Philip, Alexander Streltsov
6
+ Author-email: Piotr Masajada <maspiotr00@gmail.com>
7
+ License: BSD 3-Clause License
8
+
9
+ Copyright (c) 2025, Piotr Masajada and contributors
10
+
11
+ Redistribution and use in source and binary forms, with or without
12
+ modification, are permitted provided that the following conditions are met:
13
+
14
+ 1. Redistributions of source code must retain the above copyright notice, this
15
+ list of conditions and the following disclaimer.
16
+
17
+ 2. Redistributions in binary form must reproduce the above copyright notice,
18
+ this list of conditions and the following disclaimer in the documentation
19
+ and/or other materials provided with the distribution.
20
+
21
+ 3. Neither the name of the copyright holder nor the names of its
22
+ contributors may be used to endorse or promote products derived from
23
+ this software without specific prior written permission.
24
+
25
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
29
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
+
36
+ Requires-Python: >=3.9
37
+ Description-Content-Type: text/markdown
38
+ License-File: LICENSE
39
+ Requires-Dist: numpy>=2.2.4
40
+ Requires-Dist: scipy>=1.15.2
41
+ Requires-Dist: cvxpy>=1.6.4
42
+ Requires-Dist: qutip>=5.1.0
43
+ Dynamic: license-file
44
+
45
+ # entcalcpy
46
+ entcalcpy is a Python package for computing the geometric entanglement of a given quantum state.
47
+ It works by computing lower and upper bounds for the geometric entanglement.
48
+ These bounds are often close to each other, allowing us to estimate the value of the geometric entanglement in a given quantum state.
49
+ ## Table of Contents
50
+ - [Installation](#installation)
51
+ - [Dependencies](#dependencies)
52
+ - [Getting started](#getting-started)
53
+ - [Issues](#issues)
54
+ - [Acknowledgment](#acknowledgment)
55
+ - [License](#license)
56
+ - [Citing](#citing)
57
+ ## Installation
58
+ ```bash
59
+ pip install entcalcpy
60
+ ```
61
+ ## Dependencies
62
+ This package requires the following Python packages:
63
+ - `numpy` ≥ 2.2.4
64
+ - `scipy` ≥ 1.15.2
65
+ - `cvxpy` ≥ 1.6.4
66
+ - `qutip` ≥ 5.1.0
67
+ ## Getting started
68
+ To get started with entcalcpy, we recommend checking the examples section. The documentation is written in docstrings.
69
+ Below we present some basic usage of functions.
70
+ For example, the following code computes the upper bound of the geometric entanglement of a random quantum state.
71
+ ```python
72
+ import qutip
73
+ import entcalcpy as en
74
+ rho=qutip.rand_dm(8)
75
+ print(en.uppersame(rho,[2,2,2])) #second argument specifies that we have a 3-qubit state
76
+ print(en.upperbip(rho,[4,2])) #here we have a 4x2 bipartite state
77
+ ```
78
+ Similarly, we can compute the lower bound
79
+ ```python
80
+ import qutip
81
+ import entcalcpy as en
82
+ rho=qutip.rand_dm(8)
83
+ print(en.ge_mixed_gr(rho,[2,2,2])) #second argument specifies that we have a 3-qubit state
84
+ print(en.ge_mixed_gr(rho,[4,2])) #here we have a 4x2 bipartite state
85
+ ```
86
+ The lower bound can be computed using four different methods.
87
+ ## ge_mixed_gr vs ge_mixed_ra_gr
88
+ 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.
89
+ ge_mixed_ra_gr takes input state in the form of orthogonal decomposition. Thanks to it, it can compute lower-dimensional purification and compute
90
+ lower boudnd more efficiently.
91
+ 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
92
+ 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.
93
+ ## Solvers
94
+ 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
95
+ 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.
96
+ ## Issues
97
+ If you find any issues, we encourage you to report them via GitHub or by emailing maspiotr00@gmail.com.
98
+ ## Acknowledgment
99
+ Special thanks to Krystyna Mordzińska for coming up with the package name after a creative brainstorming session.
100
+ ## License
101
+ This project is licensed under the MIT License - see the LICENSE file for details.
102
+ ## Citing
103
+ If you use entcalcpy in academic work, please cite this package.
@@ -0,0 +1,59 @@
1
+ # entcalcpy
2
+ entcalcpy is a Python package for computing the geometric entanglement of a given quantum state.
3
+ It works by computing lower and upper bounds for the geometric entanglement.
4
+ These bounds are often close to each other, allowing us to estimate the value of the geometric entanglement in a given quantum state.
5
+ ## Table of Contents
6
+ - [Installation](#installation)
7
+ - [Dependencies](#dependencies)
8
+ - [Getting started](#getting-started)
9
+ - [Issues](#issues)
10
+ - [Acknowledgment](#acknowledgment)
11
+ - [License](#license)
12
+ - [Citing](#citing)
13
+ ## Installation
14
+ ```bash
15
+ pip install entcalcpy
16
+ ```
17
+ ## Dependencies
18
+ This package requires the following Python packages:
19
+ - `numpy` ≥ 2.2.4
20
+ - `scipy` ≥ 1.15.2
21
+ - `cvxpy` ≥ 1.6.4
22
+ - `qutip` ≥ 5.1.0
23
+ ## Getting started
24
+ To get started with entcalcpy, we recommend checking the examples section. The documentation is written in docstrings.
25
+ Below we present some basic usage of functions.
26
+ For example, the following code computes the upper bound of the geometric entanglement of a random quantum state.
27
+ ```python
28
+ import qutip
29
+ import entcalcpy as en
30
+ rho=qutip.rand_dm(8)
31
+ print(en.uppersame(rho,[2,2,2])) #second argument specifies that we have a 3-qubit state
32
+ print(en.upperbip(rho,[4,2])) #here we have a 4x2 bipartite state
33
+ ```
34
+ Similarly, we can compute the lower bound
35
+ ```python
36
+ import qutip
37
+ import entcalcpy as en
38
+ rho=qutip.rand_dm(8)
39
+ print(en.ge_mixed_gr(rho,[2,2,2])) #second argument specifies that we have a 3-qubit state
40
+ print(en.ge_mixed_gr(rho,[4,2])) #here we have a 4x2 bipartite state
41
+ ```
42
+ The lower bound can be computed using four different methods.
43
+ ## ge_mixed_gr vs ge_mixed_ra_gr
44
+ 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.
45
+ ge_mixed_ra_gr takes input state in the form of orthogonal decomposition. Thanks to it, it can compute lower-dimensional purification and compute
46
+ lower boudnd more efficiently.
47
+ 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
48
+ 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.
49
+ ## Solvers
50
+ 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
51
+ 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.
52
+ ## Issues
53
+ If you find any issues, we encourage you to report them via GitHub or by emailing maspiotr00@gmail.com.
54
+ ## Acknowledgment
55
+ Special thanks to Krystyna Mordzińska for coming up with the package name after a creative brainstorming session.
56
+ ## License
57
+ This project is licensed under the MIT License - see the LICENSE file for details.
58
+ ## Citing
59
+ If you use entcalcpy in academic work, please cite this package.
@@ -0,0 +1,22 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "entcalcpy"
7
+ version = "0.1.0"
8
+ description = "Python package for computation of geometric entanglement"
9
+ readme = "README.md"
10
+ authors = [
11
+ { name = "Piotr Masajada", email = "maspiotr00@gmail.com" },
12
+ { name = "Aby Philip" },
13
+ { name = "Alexander Streltsov" }
14
+ ]
15
+ license = { file = "LICENSE" }
16
+ requires-python = ">=3.9"
17
+ dependencies = [
18
+ "numpy>=2.2.4",
19
+ "scipy>=1.15.2",
20
+ "cvxpy>=1.6.4",
21
+ "qutip>=5.1.0"
22
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ from entcalcpy import *