qec 0.2.0__py3-none-any.whl → 0.2.2__py3-none-any.whl

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,146 @@
1
+ Metadata-Version: 2.2
2
+ Name: qec
3
+ Version: 0.2.2
4
+ Summary: Python Tools for Quantum Error Correction
5
+ Author-email: Joschka Roffe <joschka@roffe.eu>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2023 qec.Codes
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Classifier: Development Status :: 4 - Beta
29
+ Requires-Python: >=3.8
30
+ Description-Content-Type: text/markdown
31
+ License-File: LICENSE
32
+ Requires-Dist: ldpc
33
+ Requires-Dist: numpy>=1.24.0
34
+ Requires-Dist: scipy>=1.9.3
35
+ Requires-Dist: requests
36
+ Requires-Dist: beautifulsoup4
37
+
38
+ <h1>
39
+ <p align="center">
40
+ <br>QEC
41
+ </h1>
42
+ <p align="center">
43
+ Python Tools for Quantum Error Correction
44
+ <br />
45
+ <a href="https://qec.codes/">Website</a>
46
+ ·
47
+ <a href="#features">Features</a>
48
+ ·
49
+ <a href="#installation">Installation</a>
50
+ ·
51
+ <a href="#examples">Examples</a>
52
+ </p>
53
+ </p>
54
+
55
+ # Features
56
+
57
+ ## Code constructions and fundamental analysis
58
+ We currently provide the construction methods for the stabilizer generators of the QEC code families below, along with optimized methods to obtain their fundamental properties. All the classes allow to:
59
+
60
+ - obtain the physical qubit count
61
+ - obtain the logical qubit count
62
+ - calculate the exact code distance
63
+ - estimate the minimum code distance
64
+ - obtain a logical basis
65
+
66
+ The classes (along with their extre methods) are:
67
+
68
+ - Hyperprgarph Product (HGP) codes, with methods:
69
+ - construct the x and z stabiliser matrices from the seed codes
70
+ - obtain the canonical basis (work in progress)
71
+
72
+ - Calderbank-Shor-Steane (CSS) codes
73
+ - check that the seed codes satisfy the CSS criteria
74
+
75
+ - Stabiliser codes
76
+ - check that the input stabiliser matrix is valid
77
+
78
+ ## Circuit compilation
79
+ Work in progress.
80
+
81
+ # Installation
82
+
83
+ Simply do:
84
+ ```bash
85
+ pip install qec
86
+ ```
87
+
88
+ or obtain a local copy of the package by cloning it, then navigate into the created folder:
89
+
90
+ ```bash
91
+ git clone git@github.com:qec-codes/qec.git
92
+ cd qec
93
+ ```
94
+
95
+ Finally, install the package:
96
+
97
+ ```bash
98
+ pip install -e .
99
+ ```
100
+
101
+ You are all set! To import the package use:
102
+
103
+ ```python
104
+ In [1]: import qec
105
+
106
+ In [2]: qec.__version__
107
+ Out [2]: '0.1.0'
108
+
109
+ ```
110
+
111
+ # Examples
112
+
113
+ In this example we are going to create the Steane code, and obtain its fundamental code properties. We start by initialising its seed matrices (the [7, 4, 3] Hamming code):
114
+ ```python
115
+ In [1]: import numpy as np
116
+ In [2]: from qec.code_constructions import CSSCode
117
+
118
+ In [3]: hamming_code = np.array([[1, 0, 0, 1, 0, 1, 1],
119
+ [0, 1, 0, 1, 1, 0, 1],
120
+ [0, 0, 1, 0, 1, 1, 1]])
121
+ ```
122
+ as the Steane code is part of the CSS code family, we can use the `CSSCode` class:
123
+
124
+ ```python
125
+ In [4]: steane_code = CSSCode(x_stabilizer_matrix = hamming_code,
126
+ z_stabilizer_matrix = hamming_code,
127
+ name = "Steane")
128
+ In [5]: print(steane_code)
129
+ Out [6]: Steane Code: [[N=7, K=1, dx<=3, dz<=3]]
130
+ ```
131
+
132
+ we can see that all the fundamental properties (N - physical qubit number, K - logical qubit number, dx - X distance, dz - Z distance) are pre-calculated for us. We can continue our analysis by taking a look at the x and z logical basis of the code:
133
+
134
+ ```python
135
+ In [7]: print(steane_code.x_logical_operator_basis.toarray())
136
+ Out [8]: [[1 1 0 1 0 0 0]]
137
+ In [9]: print(steane_code.z_logical_operator_basis.toarray())
138
+ Out [10]: [[1 1 0 1 0 0 0]]
139
+ ```
140
+
141
+
142
+
143
+
144
+
145
+
146
+
@@ -0,0 +1,18 @@
1
+ qec/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ qec/code_constructions/__init__.py,sha256=MWyNUCS5mYcDzjGr_nbr2-ifkJigRJIzsw7sQIQXDfM,119
3
+ qec/code_constructions/css_code.py,sha256=nIaC24QhQwrmWQNhmX-X4TzlkmNAYoxN0feTdWjhswo,32376
4
+ qec/code_constructions/hgp_code.py,sha256=VAKU2lfZnDXSmAk6xFZCYT5b0hbtXpEoQUw4qHFcaEk,10419
5
+ qec/code_constructions/stabilizer_code.py,sha256=I5u8JKZu88ioC4E2nBJ-00xCmnL8nU6kdAvwYOfmNRk,22138
6
+ qec/code_instances/__init__.py,sha256=z6jOPjekDIx0jgbRFThI95zUzLzjl9Dh89RBzxsT_BE,43
7
+ qec/code_instances/five_qubit_code.py,sha256=ZHyusTEnnnmUv4QxPLXQSKbEQv2QOoBqn2V9N4SgrQE,2177
8
+ qec/codetables_de/__init__.py,sha256=dQBgkBK_DlnI9OrOcfarM7HUbj9NKyO-9QSvItD2cyY,40
9
+ qec/codetables_de/codetables_de.py,sha256=SdOaS7OTMt76uLa1GJXGydMTmwJdNwTDnQyD4SBQDIM,3626
10
+ qec/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
+ qec/utils/binary_pauli_utils.py,sha256=BSlngYDdRICu0aVu4u_m0bvLicohORyGxfk5eRER7TQ,13245
12
+ qec/utils/codetables_de_utils.py,sha256=S1wcVGJkkASQQ5s71QAsYBmpyE-3xTb6UsvgMfQtuiw,9469
13
+ qec/utils/sparse_binary_utils.py,sha256=Y9xfGKzOGFiVTyhb6iF6N7-5oMY6Ah9oLrnv8HhSBHA,1965
14
+ qec-0.2.2.dist-info/LICENSE,sha256=1b_xwNz1znYBfEaCL6pN2gNBAn8pQIjDRs_UhDp1EJI,1066
15
+ qec-0.2.2.dist-info/METADATA,sha256=Soh5GrdXcP861-epLVwGnKlk7tVrrtVVc1xKFTowbhA,4509
16
+ qec-0.2.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
17
+ qec-0.2.2.dist-info/top_level.txt,sha256=d8l_7pJ5u9uWdviNp0FUK-j8VPZqywkDek7qa4NDank,4
18
+ qec-0.2.2.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- from qec.quantum_codes.five_qubit_code import FiveQubitCode
2
- from qec.quantum_codes.codetables_de import CodeTablesDE
@@ -1 +0,0 @@
1
- from qec.stabilizer_code.stabilizer_code import StabilizerCode
@@ -1,6 +0,0 @@
1
- from qec.stabilizer_code import StabilizerCode
2
-
3
-
4
- class CSSCode(StabilizerCode):
5
- def __init__(self):
6
- NotImplemented
@@ -1,82 +0,0 @@
1
- Metadata-Version: 2.2
2
- Name: qec
3
- Version: 0.2.0
4
- Summary: Python Tools for Quantum Error Correction
5
- Author-email: Joschka Roffe <joschka@roffe.eu>
6
- License: MIT License
7
-
8
- Copyright (c) 2023 qec.Codes
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
28
- Classifier: Development Status :: 4 - Beta
29
- Requires-Python: >=3.8
30
- Description-Content-Type: text/markdown
31
- License-File: LICENSE
32
- Requires-Dist: ldpc
33
- Requires-Dist: numpy>=1.24.0
34
- Requires-Dist: scipy>=1.9.3
35
- Requires-Dist: requests
36
- Requires-Dist: beautifulsoup4
37
-
38
- <h1 align="center">QEC </h1>
39
- <h3 align="center"> Python Tools for Quantum Error Correction </h3>
40
-
41
-
42
- - Website: https://qec.codes/
43
-
44
- # Table of contents
45
- 1. [Features](#features)
46
- 2. [Installation](#installation)
47
- 3. [Getting started](#getting-started)
48
-
49
-
50
- # Features
51
-
52
- Here will go the description of all our fancy features!
53
-
54
- # Installation
55
-
56
- Obtain a local copy of the package by cloning it, then navigate into the created folder:
57
-
58
- ```bash
59
- git clone git@github.com:qec-codes/qec.git
60
- cd qec
61
- ```
62
-
63
- Finally, install the package:
64
-
65
- ```bash
66
- pip install -e .
67
- ```
68
-
69
- You are all set! To import the package use:
70
-
71
- ```python
72
- In [1]: import qec
73
-
74
- In [2]: qec.__version__
75
- Out [2]: '0.1.0'
76
-
77
- ```
78
-
79
- # Getting started
80
-
81
- A few simple examples
82
-
@@ -1,16 +0,0 @@
1
- qec/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- qec/quantum_codes/__init__.py,sha256=DQ1ztrq-vBpTyoehaMWOhals46tRj553Jmkq68bDk-E,117
3
- qec/quantum_codes/codetables_de.py,sha256=loBDBOK2cbDJ5moKmIx2MXg6e30XEPrEYau19bbDgac,3623
4
- qec/quantum_codes/five_qubit_code.py,sha256=0zrGLyIpfyKwYG7uL00yMcM5PdhQGF17_MiI2qTMhOk,2190
5
- qec/stabilizer_code/__init__.py,sha256=L5UMjHBlvfQBhkNlEZYSkyaHvNOcDHjc3oxYibMYHRk,63
6
- qec/stabilizer_code/css_code.py,sha256=8BotcCuWrbnxnbZ1ZIJDI1jgr6-ohq-haPolc59TcWw,127
7
- qec/stabilizer_code/stabilizer_code.py,sha256=_3oQwq2UNkPmP2R2qcsKTzYO4CLDvQdaiGxsN4_4r0I,22804
8
- qec/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- qec/utils/binary_pauli_utils.py,sha256=FKxOMyEgUfSL1DF--8GUf4Nl6ytbK8Slyw7x2evhAac,13231
10
- qec/utils/codetables_de_utils.py,sha256=soCf3u2v-C5EYYMiL8Ta4H6UF8KhRCEkjxLd6qBJai4,9467
11
- qec/utils/sparse_binary_utils.py,sha256=Y9xfGKzOGFiVTyhb6iF6N7-5oMY6Ah9oLrnv8HhSBHA,1965
12
- qec-0.2.0.dist-info/LICENSE,sha256=1b_xwNz1znYBfEaCL6pN2gNBAn8pQIjDRs_UhDp1EJI,1066
13
- qec-0.2.0.dist-info/METADATA,sha256=DisbbTcVUey4dp5WelBc4aZeFcUkkwpsxRzMd44QncU,2367
14
- qec-0.2.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
15
- qec-0.2.0.dist-info/top_level.txt,sha256=d8l_7pJ5u9uWdviNp0FUK-j8VPZqywkDek7qa4NDank,4
16
- qec-0.2.0.dist-info/RECORD,,
File without changes
File without changes