emu-mps 2.2.0__py3-none-any.whl → 2.2.1__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.
emu_mps/__init__.py
CHANGED
emu_mps/mpo.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
-
import itertools
|
|
3
2
|
from typing import Any, List, Sequence, Optional
|
|
4
3
|
|
|
5
4
|
import torch
|
|
@@ -12,24 +11,6 @@ from emu_mps.mps import MPS
|
|
|
12
11
|
from emu_mps.utils import new_left_bath, assign_devices
|
|
13
12
|
|
|
14
13
|
|
|
15
|
-
def _validate_operator_targets(operations: FullOp, nqubits: int) -> None:
|
|
16
|
-
for tensorop in operations:
|
|
17
|
-
target_qids = (factor[1] for factor in tensorop[1])
|
|
18
|
-
target_qids_list = list(itertools.chain(*target_qids))
|
|
19
|
-
target_qids_set = set(target_qids_list)
|
|
20
|
-
if len(target_qids_set) < len(target_qids_list):
|
|
21
|
-
# Either the qubit id has been defined twice in an operation:
|
|
22
|
-
for qids in target_qids:
|
|
23
|
-
if len(set(qids)) < len(qids):
|
|
24
|
-
raise ValueError("Duplicate atom ids in argument list.")
|
|
25
|
-
# Or it was defined in two different operations
|
|
26
|
-
raise ValueError("Each qubit can be targeted by only one operation.")
|
|
27
|
-
if max(target_qids_set) >= nqubits:
|
|
28
|
-
raise ValueError(
|
|
29
|
-
"The operation targets more qubits than there are in the register."
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
|
|
33
14
|
class MPO(Operator[complex, torch.Tensor, MPS]):
|
|
34
15
|
"""
|
|
35
16
|
Matrix Product Operator.
|
|
@@ -176,8 +157,6 @@ class MPO(Operator[complex, torch.Tensor, MPS]):
|
|
|
176
157
|
the operator in MPO form.
|
|
177
158
|
"""
|
|
178
159
|
|
|
179
|
-
_validate_operator_targets(operations, n_qudits)
|
|
180
|
-
|
|
181
160
|
basis = set(eigenstates)
|
|
182
161
|
|
|
183
162
|
operators_with_tensors: dict[str, torch.Tensor | QuditOp]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: emu-mps
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.1
|
|
4
4
|
Summary: Pasqal MPS based pulse emulator built on PyTorch
|
|
5
5
|
Project-URL: Documentation, https://pasqal-io.github.io/emulators/
|
|
6
6
|
Project-URL: Repository, https://github.com/pasqal-io/emulators
|
|
@@ -25,7 +25,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
25
25
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
26
26
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
27
27
|
Requires-Python: >=3.10
|
|
28
|
-
Requires-Dist: emu-base==2.2.
|
|
28
|
+
Requires-Dist: emu-base==2.2.1
|
|
29
29
|
Description-Content-Type: text/markdown
|
|
30
30
|
|
|
31
31
|
<div align="center">
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
emu_mps/__init__.py,sha256=
|
|
1
|
+
emu_mps/__init__.py,sha256=iXV15aC4QkDT-W_pEv2vLF1vcZAUtb7GP6D4kBEYxYk,734
|
|
2
2
|
emu_mps/algebra.py,sha256=78XP9HEbV3wGNUzIulcLU5HizW4XAYmcFdkCe1T1x-k,5489
|
|
3
3
|
emu_mps/custom_callback_implementations.py,sha256=SZGKVyS8U5hy07L-3SqpWlCAqGGKFTlSlWexZwSmjrM,2408
|
|
4
4
|
emu_mps/hamiltonian.py,sha256=gOPxNOBmk6jRPPjevERuCP_scGv0EKYeAJ0uxooihes,15622
|
|
5
|
-
emu_mps/mpo.py,sha256=
|
|
5
|
+
emu_mps/mpo.py,sha256=aWSVuEzZM-_7ZD5Rz3-tSJWX22ARP0tMIl3gUu-_4V4,7834
|
|
6
6
|
emu_mps/mps.py,sha256=8i3Yz5C_cqHWeAJILOm7cz8P8cHDuNl6aBcLXtaO314,19964
|
|
7
7
|
emu_mps/mps_backend.py,sha256=bS83qFxvdoK-c12_1WaPw6O7xUc7vdWifZNHUzNP5sM,2091
|
|
8
8
|
emu_mps/mps_backend_impl.py,sha256=SGqL2KiICE1fLviycrRdVlw3LOYRjpF5B0XgQlElSBs,26047
|
|
@@ -14,6 +14,6 @@ emu_mps/utils.py,sha256=PRPIe9B8n-6caVcUYn3uTFSvb3jAMkXX-63f8KtX5-U,8196
|
|
|
14
14
|
emu_mps/optimatrix/__init__.py,sha256=fBXQ7-rgDro4hcaBijCGhx3J69W96qcw5_3mWc7tND4,364
|
|
15
15
|
emu_mps/optimatrix/optimiser.py,sha256=k9suYmKLKlaZ7ozFuIqvXHyCBoCtGgkX1mpen9GOdOo,6977
|
|
16
16
|
emu_mps/optimatrix/permutations.py,sha256=9DDMZtrGGZ01b9F3GkzHR3paX4qNtZiPoI7Z_Kia3Lc,3727
|
|
17
|
-
emu_mps-2.2.
|
|
18
|
-
emu_mps-2.2.
|
|
19
|
-
emu_mps-2.2.
|
|
17
|
+
emu_mps-2.2.1.dist-info/METADATA,sha256=FLJwfRKhNCuaThXQ39P92HcV4Fpz5KxPqyJMddrV-K8,3587
|
|
18
|
+
emu_mps-2.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
19
|
+
emu_mps-2.2.1.dist-info/RECORD,,
|
|
File without changes
|