qadence 1.6.1__py3-none-any.whl → 1.6.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.
- qadence/ml_tools/saveload.py +1 -4
- qadence/parameters.py +1 -1
- qadence/states.py +7 -8
- {qadence-1.6.1.dist-info → qadence-1.6.2.dist-info}/METADATA +2 -2
- {qadence-1.6.1.dist-info → qadence-1.6.2.dist-info}/RECORD +7 -7
- {qadence-1.6.1.dist-info → qadence-1.6.2.dist-info}/WHEEL +0 -0
- {qadence-1.6.1.dist-info → qadence-1.6.2.dist-info}/licenses/LICENSE +0 -0
qadence/ml_tools/saveload.py
CHANGED
@@ -120,10 +120,7 @@ def load_model(
|
|
120
120
|
except Exception as e:
|
121
121
|
msg = f"Unable to load state dict due to {e}.\
|
122
122
|
No corresponding pre-trained model found. Returning the un-trained model."
|
123
|
-
|
124
|
-
|
125
|
-
warnings.warn(msg, UserWarning)
|
126
|
-
logger.warn(msg)
|
123
|
+
logger.warning(msg)
|
127
124
|
return model, iteration
|
128
125
|
|
129
126
|
|
qadence/parameters.py
CHANGED
@@ -16,7 +16,7 @@ from torch import Tensor, heaviside, no_grad, rand, tensor
|
|
16
16
|
from qadence.types import DifferentiableExpression, Engine, TNumber
|
17
17
|
|
18
18
|
# Modules to be automatically added to the qadence namespace
|
19
|
-
__all__ = ["FeatureParameter", "Parameter", "VariationalParameter"]
|
19
|
+
__all__ = ["FeatureParameter", "Parameter", "VariationalParameter", "ParamMap"]
|
20
20
|
|
21
21
|
logger = getLogger(__name__)
|
22
22
|
|
qadence/states.py
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
import random
|
4
|
-
import warnings
|
5
4
|
from functools import singledispatch
|
6
5
|
from typing import List
|
7
6
|
|
8
7
|
import torch
|
9
|
-
from
|
8
|
+
from numpy.typing import ArrayLike
|
10
9
|
from torch import Tensor, concat
|
11
10
|
from torch.distributions import Categorical, Distribution
|
12
11
|
|
13
12
|
from qadence.blocks import ChainBlock, KronBlock, PrimitiveBlock, chain, kron
|
14
13
|
from qadence.circuit import QuantumCircuit
|
15
14
|
from qadence.execution import run
|
15
|
+
from qadence.logger import get_script_logger
|
16
16
|
from qadence.operations import CNOT, RX, RY, RZ, H, I, X
|
17
17
|
from qadence.types import PI, BackendName, Endianness, StateGeneratorType
|
18
18
|
from qadence.utils import basis_to_int
|
@@ -45,6 +45,7 @@ DTYPE = torch.cdouble
|
|
45
45
|
|
46
46
|
parametric_single_qubit_gates: List = [RX, RY, RZ]
|
47
47
|
|
48
|
+
logger = get_script_logger(__name__)
|
48
49
|
# PRIVATE
|
49
50
|
|
50
51
|
|
@@ -189,7 +190,7 @@ def product_state(
|
|
189
190
|
bitstring: str,
|
190
191
|
batch_size: int = 1,
|
191
192
|
endianness: Endianness = Endianness.BIG,
|
192
|
-
backend:
|
193
|
+
backend: BackendName = BackendName.PYQTORCH,
|
193
194
|
) -> ArrayLike:
|
194
195
|
"""
|
195
196
|
Creates a product state from a bitstring.
|
@@ -197,7 +198,7 @@ def product_state(
|
|
197
198
|
Arguments:
|
198
199
|
bitstring (str): A bitstring.
|
199
200
|
batch_size (int) : Batch size.
|
200
|
-
backend (
|
201
|
+
backend (BackendName): The backend to use. Default is "pyqtorch".
|
201
202
|
|
202
203
|
Returns:
|
203
204
|
A torch.Tensor.
|
@@ -211,11 +212,9 @@ def product_state(
|
|
211
212
|
```
|
212
213
|
"""
|
213
214
|
if batch_size:
|
214
|
-
|
215
|
+
logger.debug(
|
215
216
|
"The input `batch_size` is going to be deprecated. "
|
216
|
-
"For now, default batch_size is set to 1."
|
217
|
-
DeprecationWarning,
|
218
|
-
stacklevel=2,
|
217
|
+
"For now, default batch_size is set to 1."
|
219
218
|
)
|
220
219
|
return run(product_block(bitstring), backend=backend, endianness=endianness)
|
221
220
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: qadence
|
3
|
-
Version: 1.6.
|
3
|
+
Version: 1.6.2
|
4
4
|
Summary: Pasqal interface for circuit-based quantum computing SDKs
|
5
5
|
Author-email: Aleksander Wennersteen <aleksander.wennersteen@pasqal.com>, Gert-Jan Both <gert-jan.both@pasqal.com>, Niklas Heim <niklas.heim@pasqal.com>, Mario Dagrada <mario.dagrada@pasqal.com>, Vincent Elfving <vincent.elfving@pasqal.com>, Dominik Seitz <dominik.seitz@pasqal.com>, Roland Guichard <roland.guichard@pasqal.com>, "Joao P. Moutinho" <joao.moutinho@pasqal.com>, Vytautas Abramavicius <vytautas.abramavicius@pasqal.com>, Gergana Velikova <gergana.velikova@pasqal.com>, Eduardo Maschio <eduardo.maschio@pasqal.com>
|
6
6
|
License: Apache 2.0
|
@@ -53,7 +53,7 @@ Requires-Dist: qadence-libs; extra == 'libs'
|
|
53
53
|
Provides-Extra: protocols
|
54
54
|
Requires-Dist: qadence-protocols; extra == 'protocols'
|
55
55
|
Provides-Extra: pulser
|
56
|
-
Requires-Dist: pasqal-cloud==0.
|
56
|
+
Requires-Dist: pasqal-cloud==0.10.1; extra == 'pulser'
|
57
57
|
Requires-Dist: pulser-core==0.18.1; extra == 'pulser'
|
58
58
|
Requires-Dist: pulser-simulation==0.18.1; extra == 'pulser'
|
59
59
|
Provides-Extra: visualization
|
@@ -10,14 +10,14 @@ qadence/libs.py,sha256=HetkKO8TCTlVCViQdVQJvxwBekrhd-y_iMox4UJMY1M,410
|
|
10
10
|
qadence/log_config.yaml,sha256=WwSpxqMSXgPJ7wO_wh46UnFzXdgX9NVA4MbN3TcJFyE,485
|
11
11
|
qadence/logger.py,sha256=Hb76pK3VyQjVjJb4_NqFlOJgjYJVa8t7DHJFlzOM86M,407
|
12
12
|
qadence/overlap.py,sha256=VHEXfsqcn7aax1-f_iJ8Fe5Eoz4AcceQbwgqipifgzY,17104
|
13
|
-
qadence/parameters.py,sha256=
|
13
|
+
qadence/parameters.py,sha256=WdHCcLJ8tyRfBdaLAo89GwJboj6wLdfhdHdqPDLLAhM,12337
|
14
14
|
qadence/protocols.py,sha256=bcYTxSjgMPV-a-D6yv90jCpnGik8myzaNpFv9z1gzJ0,442
|
15
15
|
qadence/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
qadence/qubit_support.py,sha256=Nkn1Q01RVViTcggSIom7EFKdWpAuM4TMGwBZ5feCUxA,2120
|
17
17
|
qadence/register.py,sha256=cBMzwZ7GWZ5ieuFt0bpproEI6a2ncNwfjj7ic379zyg,10276
|
18
18
|
qadence/serial_expr_grammar.peg,sha256=z5ytL7do9kO8o4h-V5GrsDuLdso0KsRcMuIYURFfmAY,328
|
19
19
|
qadence/serialization.py,sha256=0UdcDQP2tJOtygVQI258G3MgnDiZJmBY4o15w0G-O0Y,15686
|
20
|
-
qadence/states.py,sha256=
|
20
|
+
qadence/states.py,sha256=5QIOBBYs8e2uLFiMa8iMYZ-MvWIFEqkZAjNYx0SyYPI,14843
|
21
21
|
qadence/types.py,sha256=wsxZNik5d8xdw46Dp1xRHpVS1-mSM-kMl2J_W64UhgA,9732
|
22
22
|
qadence/utils.py,sha256=mTDI54uXsFXrKKFshmXFzDdoaeLMLlqA1MR2G061TSc,10092
|
23
23
|
qadence/analog/__init__.py,sha256=BCyS9R4KUjzUXN0Ax3b0eMo8ZAuSkGoJQVtZ4_pvAFs,279
|
@@ -111,7 +111,7 @@ qadence/ml_tools/models.py,sha256=lELcq__wfGsurUm2UOgYkOzdBDwu66Nik9ySoAjDKnY,12
|
|
111
111
|
qadence/ml_tools/optimize_step.py,sha256=ATXWmAqybJVK3QmAaDqVXB5mxjTo2MIi_e0a5WSPFpc,1800
|
112
112
|
qadence/ml_tools/parameters.py,sha256=gew2Kq_5-RgRpaTvs8eauVhgo0sTqqDQEV6WHFEiLGM,1301
|
113
113
|
qadence/ml_tools/printing.py,sha256=YK2zc9SOc5wiLnMxm3Q1gSwPAVW9Vy2Pcnjg9gP0aKU,694
|
114
|
-
qadence/ml_tools/saveload.py,sha256=
|
114
|
+
qadence/ml_tools/saveload.py,sha256=_5ni1sUohbtpGAcCRynh4j1dXkMXDpvgoDN-Jby2miQ,5041
|
115
115
|
qadence/ml_tools/tensors.py,sha256=xZ9ZRzOqEaMgLUGWQf1najDmL6iLuN1ojCGVFs1Tm94,1337
|
116
116
|
qadence/ml_tools/train_grad.py,sha256=6ZFFd7wGKFFqz3wpVkSD_xFjQPJ4IgIpA0IjYanohcs,9507
|
117
117
|
qadence/ml_tools/train_no_grad.py,sha256=PrOfPwu6C-YqfFxnRkbeyOQzqSyjRrx4AZZd6C-1xRw,4705
|
@@ -136,7 +136,7 @@ qadence/transpile/digitalize.py,sha256=iWRwYAYQsD2INHj0HNbGJriv_3fRCuBW1nDBrwtKS
|
|
136
136
|
qadence/transpile/flatten.py,sha256=EdhSG5WyF56nbnxINNLqrHgY84MRM1YFjT3fR4aph5Q,3427
|
137
137
|
qadence/transpile/invert.py,sha256=KAefHTG2AWr39aengVhXrzCtJPhrZC-ZnL6vYvmbnY0,4867
|
138
138
|
qadence/transpile/transpile.py,sha256=6MRRkk1OS279L1fwUQjazA6qlfpbd-T_EJMKT8hAhOU,2721
|
139
|
-
qadence-1.6.
|
140
|
-
qadence-1.6.
|
141
|
-
qadence-1.6.
|
142
|
-
qadence-1.6.
|
139
|
+
qadence-1.6.2.dist-info/METADATA,sha256=8vr_cvIxfMOFrYUEiQpTUDRyA3CeOJQ3_YpV1kCFatA,9169
|
140
|
+
qadence-1.6.2.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
|
141
|
+
qadence-1.6.2.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
142
|
+
qadence-1.6.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|