emu-base 1.2.4__py3-none-any.whl → 1.2.5__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_base/__init__.py +1 -1
- emu_base/base_classes/config.py +18 -3
- emu_base/pulser_adapter.py +14 -5
- {emu_base-1.2.4.dist-info → emu_base-1.2.5.dist-info}/METADATA +4 -2
- {emu_base-1.2.4.dist-info → emu_base-1.2.5.dist-info}/RECORD +6 -6
- {emu_base-1.2.4.dist-info → emu_base-1.2.5.dist-info}/WHEEL +0 -0
emu_base/__init__.py
CHANGED
emu_base/base_classes/config.py
CHANGED
|
@@ -4,6 +4,7 @@ import logging
|
|
|
4
4
|
import sys
|
|
5
5
|
import pathlib
|
|
6
6
|
from typing import TYPE_CHECKING
|
|
7
|
+
import torch
|
|
7
8
|
|
|
8
9
|
if TYPE_CHECKING:
|
|
9
10
|
from emu_base.base_classes.callback import Callback
|
|
@@ -50,14 +51,28 @@ class BackendConfig:
|
|
|
50
51
|
self.with_modulation = with_modulation
|
|
51
52
|
self.noise_model = noise_model
|
|
52
53
|
|
|
53
|
-
if interaction_matrix is not None and (
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
if interaction_matrix is not None and not (
|
|
55
|
+
isinstance(interaction_matrix, list)
|
|
56
|
+
and isinstance(interaction_matrix[0], list)
|
|
57
|
+
and isinstance(interaction_matrix[0][0], float)
|
|
56
58
|
):
|
|
57
59
|
raise ValueError(
|
|
58
60
|
"Interaction matrix must be provided as a Python list of lists of floats"
|
|
59
61
|
)
|
|
60
62
|
|
|
63
|
+
if interaction_matrix is not None:
|
|
64
|
+
int_mat = torch.tensor(interaction_matrix)
|
|
65
|
+
tol = 1e-10
|
|
66
|
+
if not (
|
|
67
|
+
int_mat.numel() != 0
|
|
68
|
+
and torch.all(torch.isreal(int_mat))
|
|
69
|
+
and int_mat.dim() == 2
|
|
70
|
+
and int_mat.shape[0] == int_mat.shape[1]
|
|
71
|
+
and torch.allclose(int_mat, int_mat.T, atol=tol)
|
|
72
|
+
and torch.norm(torch.diag(int_mat)) < tol
|
|
73
|
+
):
|
|
74
|
+
raise ValueError("Interaction matrix is not symmetric and zero diag")
|
|
75
|
+
|
|
61
76
|
self.interaction_matrix = interaction_matrix
|
|
62
77
|
self.interaction_cutoff = interaction_cutoff
|
|
63
78
|
self.logger = logging.getLogger("global_logger")
|
emu_base/pulser_adapter.py
CHANGED
|
@@ -158,17 +158,26 @@ def _extract_omega_delta_phi(
|
|
|
158
158
|
global_times |= set(i for i in range(slot.ti, slot.tf))
|
|
159
159
|
|
|
160
160
|
step = 0
|
|
161
|
-
t =
|
|
161
|
+
t = (step + 1 / 2) * dt
|
|
162
162
|
|
|
163
163
|
while t < max_duration:
|
|
164
164
|
for q_pos, q_id in enumerate(sequence.register.qubit_ids):
|
|
165
|
-
omega[step, q_pos] =
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
omega[step, q_pos] = (
|
|
166
|
+
locals_a_d_p[q_id]["amp"][math.floor(t)]
|
|
167
|
+
+ locals_a_d_p[q_id]["amp"][math.ceil(t)]
|
|
168
|
+
) / 2.0
|
|
169
|
+
delta[step, q_pos] = (
|
|
170
|
+
locals_a_d_p[q_id]["det"][math.floor(t)]
|
|
171
|
+
+ locals_a_d_p[q_id]["det"][math.ceil(t)]
|
|
172
|
+
) / 2.0
|
|
173
|
+
phi[step, q_pos] = (
|
|
174
|
+
locals_a_d_p[q_id]["phase"][math.floor(t)]
|
|
175
|
+
+ locals_a_d_p[q_id]["phase"][math.ceil(t)]
|
|
176
|
+
) / 2.0
|
|
168
177
|
if t in global_times:
|
|
169
178
|
omega[step] *= waist_factors
|
|
170
179
|
step += 1
|
|
171
|
-
t =
|
|
180
|
+
t = (step + 1 / 2) * dt
|
|
172
181
|
|
|
173
182
|
return omega, delta, phi
|
|
174
183
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: emu-base
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.5
|
|
4
4
|
Summary: Pasqal base classes for emulators
|
|
5
5
|
Author-email: Anton Quelle <anton.quelle@pasqal.com>, Mauro Mendizabal <mauro.mendizabal-pico@pasqal.com>, Stefano Grava <stefano.grava@pasqal.com>, Pablo Le Henaff <pablo.le-henaff@pasqal.com>
|
|
6
6
|
License: PASQAL OPEN-SOURCE SOFTWARE LICENSE AGREEMENT (MIT-derived)
|
|
@@ -22,7 +22,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
22
22
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
23
23
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
24
24
|
Requires-Python: >=3.10
|
|
25
|
-
Requires-Dist: pulser-core==1.
|
|
25
|
+
Requires-Dist: pulser-core==1.3.*
|
|
26
26
|
Requires-Dist: torch==2.5.0
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
|
|
@@ -34,6 +34,8 @@ Description-Content-Type: text/markdown
|
|
|
34
34
|
|
|
35
35
|
**Emu-mps** is a backend for the [Pulser low-level Quantum Programming toolkit](https://pulser.readthedocs.io) that lets you run Quantum Algorithms on a simulated device, using GPU acceleration if available. More in depth, emu-mps is designed to **emu**late the dynamics of programmable arrays of neutral atoms, with matrix product states (**mps**). While benchmarking is incomplete as of this writing, early results suggest that this design makes emu-mps faster and more memory-efficient than previous generations of quantum emulators at running simulations with large numbers of qubits.
|
|
36
36
|
|
|
37
|
+
As of this writing, Emu-MPS is provided for Linux and macOS but will not work under Windows.
|
|
38
|
+
|
|
37
39
|
## Installation
|
|
38
40
|
|
|
39
41
|
**Warning:** installing emu-mps will update pulser-core
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
emu_base/__init__.py,sha256=
|
|
1
|
+
emu_base/__init__.py,sha256=5X57qf5fo0zv8vmeaDbrW9ThsAEIjy5HPsCpQEIL8iI,1130
|
|
2
2
|
emu_base/lindblad_operators.py,sha256=eXkXsLt_fV7jhF31EkxzYFU04rOJV3uWXsl6t1aTAqs,1562
|
|
3
|
-
emu_base/pulser_adapter.py,sha256=
|
|
3
|
+
emu_base/pulser_adapter.py,sha256=vnIiOpjJBXEwMmuWqOdRIlHmkkYnvvPmsSfRNPzBi2k,9118
|
|
4
4
|
emu_base/utils.py,sha256=RM8O0qfPAJfcdqqAojwEEKV7I3ZfVDklnTisTGhUg5k,233
|
|
5
5
|
emu_base/base_classes/__init__.py,sha256=Su6fHtjCyg0fw-7y7e7nbMfDASppNRQs8iGaAOkO3c4,570
|
|
6
6
|
emu_base/base_classes/aggregators.py,sha256=bcvoGfZCkPKv-CI29gTma6HBphGh7bjBq2Ome77eRJM,1840
|
|
7
7
|
emu_base/base_classes/backend.py,sha256=7tnwb9MnRbwRN1_JTqliYftjqExuOE-Rrwz9AU2Pc4c,1645
|
|
8
8
|
emu_base/base_classes/callback.py,sha256=JXah_ZDNM8iyPWy7IOwW481qRFyqVvlSM-0OkjBzV0A,3055
|
|
9
|
-
emu_base/base_classes/config.py,sha256=
|
|
9
|
+
emu_base/base_classes/config.py,sha256=Dg2CwC9sc5HYwszQAJSVjkSd3wuQrv6aEZGYBRnFl48,4098
|
|
10
10
|
emu_base/base_classes/default_callbacks.py,sha256=F44kkuwWdVcvMGZ9vJ2q7ug-_P8IQyJv-SVxSVWHW_w,9940
|
|
11
11
|
emu_base/base_classes/operator.py,sha256=MJjuDUTwJLbaSJzSNCKDWGvmGCGAEIEWISLoPSSzNsU,3501
|
|
12
12
|
emu_base/base_classes/results.py,sha256=7-Mz3jmFy19hd3PIA5idK610mC3b5jOf3EKBmV14Jv4,5569
|
|
@@ -14,6 +14,6 @@ emu_base/base_classes/state.py,sha256=7iIyZmBqqJ6G4SyYZ3kyylWjAqiYIx0aW5B0T74EPZ
|
|
|
14
14
|
emu_base/math/__init__.py,sha256=6BbIytYV5uC-e5jLMtIErkcUl_PvfSNnhmVFY9Il8uQ,97
|
|
15
15
|
emu_base/math/brents_root_finding.py,sha256=AVx6L1Il6rpPJWrLJ7cn6oNmJyZOPRgEaaZaubC9lsU,3711
|
|
16
16
|
emu_base/math/krylov_exp.py,sha256=UCFNeq-j2ukgBsOPC9_Jiv1aqpy88SrslDLiCxIGBwk,3840
|
|
17
|
-
emu_base-1.2.
|
|
18
|
-
emu_base-1.2.
|
|
19
|
-
emu_base-1.2.
|
|
17
|
+
emu_base-1.2.5.dist-info/METADATA,sha256=wD4pmz4VvisVEZmM3Z44CC_fiwB6SMw-O9fFKPHvb7w,5576
|
|
18
|
+
emu_base-1.2.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
19
|
+
emu_base-1.2.5.dist-info/RECORD,,
|
|
File without changes
|