xloft 0.1.21__py3-none-any.whl → 0.1.22__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.
Potentially problematic release.
This version of xloft might be problematic. Click here for more details.
xloft/quantum.py
CHANGED
|
@@ -4,7 +4,7 @@ The module contains the following tools:
|
|
|
4
4
|
|
|
5
5
|
- `count_qubits()` - Counting the number of qubits of your computer.
|
|
6
6
|
- `LoopMode` - Quantum loop mode.
|
|
7
|
-
- `QuantumLoop` -
|
|
7
|
+
- `QuantumLoop` - Separation of the cycle into quantums.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
10
|
import concurrent.futures
|
|
@@ -16,9 +16,11 @@ from typing import Any, Callable, Iterable, Never, assert_never
|
|
|
16
16
|
def count_qubits() -> int:
|
|
17
17
|
"""Counting the number of qubits of your computer.
|
|
18
18
|
|
|
19
|
-
A qubit in a regular computer is
|
|
19
|
+
A qubit in a regular computer is quantum of algorithm that is executed in
|
|
20
20
|
one iteration of a cycle in a separate processor thread.
|
|
21
21
|
|
|
22
|
+
Quantum is a function with an algorithm of task for data processing.
|
|
23
|
+
|
|
22
24
|
Examples:
|
|
23
25
|
>>> from xloft.quantum import count_qubits
|
|
24
26
|
>>> count_qubits()
|
|
@@ -38,18 +40,17 @@ class LoopMode(Enum):
|
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
class QuantumLoop:
|
|
41
|
-
"""
|
|
43
|
+
"""Separation of the cycle into quantums.
|
|
42
44
|
|
|
43
45
|
Args:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
mode: The operating mode for a quantum loop: LoopMode.PROCESS_POOL | LoopMode.THREAD_POOL.
|
|
46
|
+
quantum: A function that describes the task.
|
|
47
|
+
data: The data that needs to be processed.
|
|
48
|
+
timeout: The maximum number of seconds to wait. If None, then there
|
|
49
|
+
is no limit on the wait time.
|
|
50
|
+
chunksize: The size of the chunks the iterable will be broken into
|
|
51
|
+
before being passed to a child process. This argument is only
|
|
52
|
+
used by ProcessPoolExecutor; it is ignored by ThreadPoolExecutor.
|
|
53
|
+
mode: The operating mode for a quantum loop: LoopMode.PROCESS_POOL | LoopMode.THREAD_POOL.
|
|
53
54
|
|
|
54
55
|
Examples:
|
|
55
56
|
>>> from xloft.quantum import LoopMode, QuantumLoop, count_qubits
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xloft
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.22
|
|
4
4
|
Summary: (XLOFT) X-Library of tools
|
|
5
5
|
Project-URL: Homepage, https://github.com/kebasyaty/xloft
|
|
6
6
|
Project-URL: Repository, https://github.com/kebasyaty/xloft
|
|
@@ -177,7 +177,8 @@ from xloft.quantum import LoopMode, QuantumLoop, count_qubits
|
|
|
177
177
|
num = count_qubits()
|
|
178
178
|
print(num) # => 16
|
|
179
179
|
|
|
180
|
-
def quantum(
|
|
180
|
+
def quantum(item):
|
|
181
|
+
"""Task."""
|
|
181
182
|
return item * item
|
|
182
183
|
|
|
183
184
|
data = range(10)
|
|
@@ -3,8 +3,8 @@ xloft/errors.py,sha256=GYXvi2l01VUDQSs6skiOfQsKLF6tFuUhJMqNkL7BJNI,857
|
|
|
3
3
|
xloft/humanism.py,sha256=I6q56MhviapBSWF4B_1xd77TDwQMM1jrkbl1N-fOURc,1068
|
|
4
4
|
xloft/namedtuple.py,sha256=OkAHqMaV4hN6Qj_oaOYQ9-y9x4Muv4mNrBn48T6RpiI,6818
|
|
5
5
|
xloft/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
xloft/quantum.py,sha256=
|
|
7
|
-
xloft-0.1.
|
|
8
|
-
xloft-0.1.
|
|
9
|
-
xloft-0.1.
|
|
10
|
-
xloft-0.1.
|
|
6
|
+
xloft/quantum.py,sha256=jkDo4mMTy2FXzeYWRDMG_iQ6DjixdeO1ujPNUIZF688,3867
|
|
7
|
+
xloft-0.1.22.dist-info/METADATA,sha256=6qB7pAWa-hf7XygBqewmZZERodNsQXYQbCVzFcyz-Xs,7116
|
|
8
|
+
xloft-0.1.22.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
9
|
+
xloft-0.1.22.dist-info/licenses/LICENSE,sha256=2zZINd6m_jNYlowdQImlEizyhSui5cBAJZRhWQURcEc,1095
|
|
10
|
+
xloft-0.1.22.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|