qadence 1.7.5__tar.gz → 1.7.7__tar.gz
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-1.7.7/.github/ISSUE_TEMPLATE/bug-report.yml +52 -0
- qadence-1.7.7/.github/ISSUE_TEMPLATE/config.yml +5 -0
- qadence-1.7.7/.github/ISSUE_TEMPLATE/new-feature.yml +36 -0
- {qadence-1.7.5 → qadence-1.7.7}/PKG-INFO +4 -4
- {qadence-1.7.5 → qadence-1.7.7}/pyproject.toml +4 -3
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backend.py +0 -27
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/braket/backend.py +0 -10
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/gpsr.py +19 -3
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/horqrux/backend.py +0 -10
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/pulser/backend.py +31 -26
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/pyqtorch/backend.py +0 -10
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/pyqtorch/convert_ops.py +107 -120
- {qadence-1.7.5 → qadence-1.7.7}/qadence/engines/torch/differentiable_expectation.py +9 -2
- {qadence-1.7.5 → qadence-1.7.7}/qadence/mitigations/analog_zne.py +2 -2
- {qadence-1.7.5 → qadence-1.7.7}/qadence/ml_tools/__init__.py +2 -1
- {qadence-1.7.5 → qadence-1.7.7}/qadence/ml_tools/config.py +61 -3
- {qadence-1.7.5 → qadence-1.7.7}/qadence/ml_tools/saveload.py +5 -1
- {qadence-1.7.5 → qadence-1.7.7}/qadence/ml_tools/train_grad.py +2 -7
- {qadence-1.7.5 → qadence-1.7.7}/qadence/ml_tools/train_no_grad.py +2 -6
- {qadence-1.7.5 → qadence-1.7.7}/.coveragerc +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/.github/workflows/build_docs.yml +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/.github/workflows/lint.yml +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/.github/workflows/test_all.yml +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/.github/workflows/test_examples.yml +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/.github/workflows/test_fast.yml +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/.gitignore +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/.pre-commit-config.yaml +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/LICENSE +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/MANIFEST.in +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/README.md +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/mkdocs.yml +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/analog/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/analog/addressing.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/analog/constants.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/analog/device.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/analog/hamiltonian_terms.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/analog/parse_analog.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/api.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/braket/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/braket/config.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/braket/convert_ops.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/horqrux/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/horqrux/config.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/horqrux/convert_ops.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/jax_utils.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/pulser/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/pulser/channels.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/pulser/cloud.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/pulser/config.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/pulser/convert_ops.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/pulser/devices.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/pulser/pulses.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/pulser/waveforms.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/pyqtorch/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/pyqtorch/config.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/backends/utils.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/blocks/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/blocks/abstract.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/blocks/analog.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/blocks/block_to_tensor.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/blocks/composite.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/blocks/embedding.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/blocks/manipulate.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/blocks/matrix.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/blocks/primitive.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/blocks/utils.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/circuit.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/constructors/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/constructors/ansatze.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/constructors/daqc/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/constructors/daqc/daqc.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/constructors/daqc/gen_parser.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/constructors/daqc/utils.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/constructors/feature_maps.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/constructors/hamiltonians.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/constructors/iia.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/constructors/qft.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/constructors/rydberg_feature_maps.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/constructors/rydberg_hea.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/constructors/utils.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/decompose.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/divergences.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/draw/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/draw/assets/dark/measurement.png +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/draw/assets/dark/measurement.svg +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/draw/assets/light/measurement.png +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/draw/assets/light/measurement.svg +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/draw/themes.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/draw/utils.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/draw/vizbackend.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/engines/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/engines/differentiable_backend.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/engines/jax/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/engines/jax/differentiable_backend.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/engines/jax/differentiable_expectation.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/engines/torch/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/engines/torch/differentiable_backend.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/exceptions/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/exceptions/exceptions.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/execution.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/extensions.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/libs.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/log_config.yaml +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/logger.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/measurements/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/measurements/protocols.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/measurements/samples.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/measurements/shadow.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/measurements/tomography.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/measurements/utils.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/mitigations/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/mitigations/protocols.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/mitigations/readout.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/ml_tools/constructors.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/ml_tools/data.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/ml_tools/models.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/ml_tools/optimize_step.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/ml_tools/parameters.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/ml_tools/printing.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/ml_tools/tensors.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/ml_tools/utils.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/model.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/noise/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/noise/protocols.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/noise/readout.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/operations/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/operations/analog.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/operations/control_ops.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/operations/ham_evo.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/operations/parametric.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/operations/primitive.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/overlap.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/parameters.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/protocols.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/py.typed +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/qubit_support.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/register.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/serial_expr_grammar.peg +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/serialization.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/states.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/transpile/__init__.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/transpile/apply_fn.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/transpile/block.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/transpile/circuit.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/transpile/digitalize.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/transpile/flatten.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/transpile/invert.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/transpile/transpile.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/types.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/qadence/utils.py +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/renovate.json +0 -0
- {qadence-1.7.5 → qadence-1.7.7}/setup.py +0 -0
@@ -0,0 +1,52 @@
|
|
1
|
+
name: Bug Report
|
2
|
+
description: Report a bug
|
3
|
+
labels: ["bug"]
|
4
|
+
body:
|
5
|
+
- type: markdown
|
6
|
+
attributes:
|
7
|
+
value: |
|
8
|
+
Please fill out the sections below to help everyone identify and fix the bug
|
9
|
+
- type: textarea
|
10
|
+
id: description
|
11
|
+
attributes:
|
12
|
+
label: Short description
|
13
|
+
placeholder: Describe here
|
14
|
+
validations:
|
15
|
+
required: true
|
16
|
+
- type: textarea
|
17
|
+
id: expected
|
18
|
+
attributes:
|
19
|
+
label: What is the expected result?
|
20
|
+
placeholder: Describe here
|
21
|
+
- type: textarea
|
22
|
+
id: actual
|
23
|
+
attributes:
|
24
|
+
label: What is the actual result?
|
25
|
+
placeholder: Describe here
|
26
|
+
- type: textarea
|
27
|
+
id: code_bug
|
28
|
+
attributes:
|
29
|
+
label: Steps/Code to reproduce
|
30
|
+
placeholder: |
|
31
|
+
from qadence import *
|
32
|
+
validations:
|
33
|
+
required: true
|
34
|
+
- type: textarea
|
35
|
+
id: texterror
|
36
|
+
attributes:
|
37
|
+
label: Tracebacks (optional)
|
38
|
+
- type: textarea
|
39
|
+
id: textenv
|
40
|
+
attributes:
|
41
|
+
label: Environment details (optional)
|
42
|
+
placeholder: Qadence version, Operating system, Python version, PyTorch version
|
43
|
+
- type: dropdown
|
44
|
+
id: assign
|
45
|
+
attributes:
|
46
|
+
label: "Would you like to work on this issue?"
|
47
|
+
options:
|
48
|
+
- "Yes"
|
49
|
+
- type: markdown
|
50
|
+
attributes:
|
51
|
+
value: |
|
52
|
+
Thanks for reporting this issue! We will get back to you as soon as possible.
|
@@ -0,0 +1,36 @@
|
|
1
|
+
name: New feature
|
2
|
+
description: Suggest or request a new feature
|
3
|
+
labels: ["feature"]
|
4
|
+
body:
|
5
|
+
- type: markdown
|
6
|
+
attributes:
|
7
|
+
value: |
|
8
|
+
Please fill out the sections below to properly describe the new feature you are suggesting.
|
9
|
+
- type: textarea
|
10
|
+
id: description
|
11
|
+
attributes:
|
12
|
+
label: Describe the feature
|
13
|
+
placeholder: I want ...
|
14
|
+
validations:
|
15
|
+
required: true
|
16
|
+
- type: textarea
|
17
|
+
id: rationale
|
18
|
+
attributes:
|
19
|
+
label: It should be implemented because
|
20
|
+
placeholder: It will allow ...
|
21
|
+
- type: textarea
|
22
|
+
id: context
|
23
|
+
attributes:
|
24
|
+
label: Additional context
|
25
|
+
placeholder: |
|
26
|
+
Add any other context or screenshots about the feature request here.
|
27
|
+
- type: dropdown
|
28
|
+
id: assign
|
29
|
+
attributes:
|
30
|
+
label: "Would you like to work on this issue?"
|
31
|
+
options:
|
32
|
+
- "Yes"
|
33
|
+
- type: markdown
|
34
|
+
attributes:
|
35
|
+
value: |
|
36
|
+
Thanks for your suggestion! Let's see together if it can be implemented.
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: qadence
|
3
|
-
Version: 1.7.
|
3
|
+
Version: 1.7.7
|
4
4
|
Summary: Pasqal interface for circuit-based quantum computing SDKs
|
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>, Smit Chaudhary <smit.chaudhary@pasqal.com>, Ignacio Fernández Graña <ignacio.fernandez-grana@pasqal.com>, Charles Moussa <charles.moussa@pasqal.com>, Giorgio Tosti Balducci <giorgio.tosti-balducci@pasqal.com>
|
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>, Smit Chaudhary <smit.chaudhary@pasqal.com>, Ignacio Fernández Graña <ignacio.fernandez-grana@pasqal.com>, Charles Moussa <charles.moussa@pasqal.com>, Giorgio Tosti Balducci <giorgio.tosti-balducci@pasqal.com>, Daniele Cucurachi <daniele.cucurachi@pasqal.com>
|
6
6
|
License: Apache 2.0
|
7
7
|
License-File: LICENSE
|
8
8
|
Classifier: License :: OSI Approved :: Apache Software License
|
@@ -22,7 +22,7 @@ Requires-Dist: matplotlib
|
|
22
22
|
Requires-Dist: nevergrad
|
23
23
|
Requires-Dist: numpy
|
24
24
|
Requires-Dist: openfermion
|
25
|
-
Requires-Dist: pyqtorch==1.4.
|
25
|
+
Requires-Dist: pyqtorch==1.4.7
|
26
26
|
Requires-Dist: pyyaml
|
27
27
|
Requires-Dist: rich
|
28
28
|
Requires-Dist: scipy
|
@@ -57,7 +57,7 @@ Requires-Dist: mlflow; extra == 'mlflow'
|
|
57
57
|
Provides-Extra: protocols
|
58
58
|
Requires-Dist: qadence-protocols; extra == 'protocols'
|
59
59
|
Provides-Extra: pulser
|
60
|
-
Requires-Dist: pasqal-cloud==0.11.
|
60
|
+
Requires-Dist: pasqal-cloud==0.11.4; extra == 'pulser'
|
61
61
|
Requires-Dist: pulser-core==0.19.0; extra == 'pulser'
|
62
62
|
Requires-Dist: pulser-simulation==0.19.0; extra == 'pulser'
|
63
63
|
Provides-Extra: visualization
|
@@ -22,10 +22,11 @@ authors = [
|
|
22
22
|
{ name = "Ignacio Fernández Graña", email = "ignacio.fernandez-grana@pasqal.com" },
|
23
23
|
{ name = "Charles Moussa", email = "charles.moussa@pasqal.com" },
|
24
24
|
{ name = "Giorgio Tosti Balducci", email = "giorgio.tosti-balducci@pasqal.com" },
|
25
|
+
{ name = "Daniele Cucurachi", email = "daniele.cucurachi@pasqal.com" },
|
25
26
|
]
|
26
27
|
requires-python = ">=3.9"
|
27
28
|
license = { text = "Apache 2.0" }
|
28
|
-
version = "1.7.
|
29
|
+
version = "1.7.7"
|
29
30
|
classifiers = [
|
30
31
|
"License :: OSI Approved :: Apache Software License",
|
31
32
|
"Programming Language :: Python",
|
@@ -49,7 +50,7 @@ dependencies = [
|
|
49
50
|
"jsonschema",
|
50
51
|
"nevergrad",
|
51
52
|
"scipy",
|
52
|
-
"pyqtorch==1.4.
|
53
|
+
"pyqtorch==1.4.7",
|
53
54
|
"pyyaml",
|
54
55
|
"matplotlib",
|
55
56
|
"Arpeggio==2.0.2",
|
@@ -63,7 +64,7 @@ allow-ambiguous-features = true
|
|
63
64
|
pulser = [
|
64
65
|
"pulser-core==0.19.0",
|
65
66
|
"pulser-simulation==0.19.0",
|
66
|
-
"pasqal-cloud==0.11.
|
67
|
+
"pasqal-cloud==0.11.4",
|
67
68
|
]
|
68
69
|
braket = ["amazon-braket-sdk<1.71.2"]
|
69
70
|
visualization = [
|
@@ -282,33 +282,6 @@ class Backend(ABC):
|
|
282
282
|
"""
|
283
283
|
raise NotImplementedError
|
284
284
|
|
285
|
-
@abstractmethod
|
286
|
-
def run_dm(
|
287
|
-
self,
|
288
|
-
circuit: ConvertedCircuit,
|
289
|
-
noise: Noise,
|
290
|
-
param_values: dict[str, ArrayLike] = {},
|
291
|
-
state: Tensor | None = None,
|
292
|
-
endianness: Endianness = Endianness.BIG,
|
293
|
-
) -> Tensor:
|
294
|
-
"""Run a circuit and return the resulting the density matrix.
|
295
|
-
|
296
|
-
TODO: Temporary method for the purposes of noise model implementation.
|
297
|
-
To be removed in a later refactoring.
|
298
|
-
|
299
|
-
Arguments:
|
300
|
-
circuit: A converted circuit as returned by `backend.circuit`.
|
301
|
-
param_values: _**Already embedded**_ parameters of the circuit. See
|
302
|
-
[`embedding`][qadence.blocks.embedding.embedding] for more info.
|
303
|
-
state: Initial state.
|
304
|
-
endianness: Endianness of the resulting density matrix.
|
305
|
-
|
306
|
-
Returns:
|
307
|
-
A list of Counter objects where each key represents a bitstring
|
308
|
-
and its value the number of times it has been sampled from the given wave function.
|
309
|
-
"""
|
310
|
-
raise NotImplementedError
|
311
|
-
|
312
285
|
@abstractmethod
|
313
286
|
def expectation(
|
314
287
|
self,
|
@@ -131,16 +131,6 @@ class Backend(BackendInterface):
|
|
131
131
|
states = invert_endianness(states)
|
132
132
|
return states
|
133
133
|
|
134
|
-
def run_dm(
|
135
|
-
self,
|
136
|
-
circuit: ConvertedCircuit,
|
137
|
-
noise: Noise,
|
138
|
-
param_values: dict[str, Tensor] = {},
|
139
|
-
state: Tensor | None = None,
|
140
|
-
endianness: Endianness = Endianness.BIG,
|
141
|
-
) -> Tensor:
|
142
|
-
raise NotImplementedError
|
143
|
-
|
144
134
|
def sample(
|
145
135
|
self,
|
146
136
|
circuit: ConvertedCircuit,
|
@@ -10,14 +10,30 @@ from qadence.types import PI
|
|
10
10
|
from qadence.utils import _round_complex
|
11
11
|
|
12
12
|
|
13
|
-
def general_psr(spectrum: Tensor, shift_prefac: float = 0.5) -> Callable:
|
13
|
+
def general_psr(spectrum: Tensor, n_eqs: int | None = None, shift_prefac: float = 0.5) -> Callable:
|
14
|
+
"""Define whether single_gap_psr or multi_gap_psr is used.
|
15
|
+
|
16
|
+
Args:
|
17
|
+
spectrum (Tensor): Spectrum of the operation we apply PSR onto.
|
18
|
+
n_eqs (int | None, optional): Number of equations. Defaults to None.
|
19
|
+
If provided, we keep the n_eqs higher spectral gaps.
|
20
|
+
shift_prefac (float, optional): Shift prefactor. Defaults to 0.5.
|
21
|
+
|
22
|
+
Returns:
|
23
|
+
Callable: single_gap_psr or multi_gap_psr function for
|
24
|
+
concerned operation.
|
25
|
+
"""
|
14
26
|
diffs = _round_complex(spectrum - spectrum.reshape(-1, 1))
|
15
27
|
sorted_unique_spectral_gaps = torch.unique(torch.abs(torch.tril(diffs)))
|
16
28
|
|
17
29
|
# We have to filter out zeros
|
18
30
|
sorted_unique_spectral_gaps = sorted_unique_spectral_gaps[sorted_unique_spectral_gaps > 0]
|
19
|
-
n_eqs =
|
20
|
-
|
31
|
+
n_eqs = (
|
32
|
+
len(sorted_unique_spectral_gaps)
|
33
|
+
if n_eqs is None
|
34
|
+
else min(n_eqs, len(sorted_unique_spectral_gaps))
|
35
|
+
)
|
36
|
+
sorted_unique_spectral_gaps = torch.tensor(list(sorted_unique_spectral_gaps)[:n_eqs])
|
21
37
|
|
22
38
|
if n_eqs == 1:
|
23
39
|
return single_gap_psr
|
@@ -107,16 +107,6 @@ class Backend(BackendInterface):
|
|
107
107
|
state = unhorqify(state)
|
108
108
|
return state
|
109
109
|
|
110
|
-
def run_dm(
|
111
|
-
self,
|
112
|
-
circuit: ConvertedCircuit,
|
113
|
-
noise: Noise,
|
114
|
-
param_values: ParamDictType = {},
|
115
|
-
state: ArrayLike | None = None,
|
116
|
-
endianness: Endianness = Endianness.BIG,
|
117
|
-
) -> ArrayLike:
|
118
|
-
raise NotImplementedError
|
119
|
-
|
120
110
|
def expectation(
|
121
111
|
self,
|
122
112
|
circuit: ConvertedCircuit,
|
@@ -187,6 +187,7 @@ class Backend(BackendInterface):
|
|
187
187
|
param_values: dict[str, Tensor] = {},
|
188
188
|
state: Tensor | None = None,
|
189
189
|
endianness: Endianness = Endianness.BIG,
|
190
|
+
noise: Noise | None = None,
|
190
191
|
) -> Tensor:
|
191
192
|
vals = to_list_of_dicts(param_values)
|
192
193
|
|
@@ -197,37 +198,41 @@ class Backend(BackendInterface):
|
|
197
198
|
"specify any cloud credentials to use the .run() method"
|
198
199
|
)
|
199
200
|
|
200
|
-
|
201
|
-
|
201
|
+
if noise is None:
|
202
|
+
state = state if state is None else _convert_init_state(state)
|
203
|
+
batched_wf = np.zeros((len(vals), 2**circuit.abstract.n_qubits), dtype=np.complex128)
|
202
204
|
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
205
|
+
for i, param_values_el in enumerate(vals):
|
206
|
+
sequence = self.assign_parameters(circuit, param_values_el)
|
207
|
+
pattern = circuit.original.register.device_specs.pattern
|
208
|
+
if pattern is not None:
|
209
|
+
add_addressing_pattern(sequence, pattern)
|
210
|
+
sequence.measure()
|
211
|
+
sim_result = simulate_sequence(sequence, self.config, state, n_shots=None)
|
212
|
+
wf = (
|
213
|
+
sim_result.get_final_state( # type:ignore [union-attr]
|
214
|
+
ignore_global_phase=False, normalize=True
|
215
|
+
)
|
216
|
+
.full()
|
217
|
+
.flatten()
|
213
218
|
)
|
214
|
-
|
215
|
-
.
|
216
|
-
|
217
|
-
# We flip the wavefunction coming out of pulser,
|
218
|
-
# essentially changing logic 0 with logic 1 in the basis states.
|
219
|
-
batched_wf[i] = np.flip(wf)
|
219
|
+
# We flip the wavefunction coming out of pulser,
|
220
|
+
# essentially changing logic 0 with logic 1 in the basis states.
|
221
|
+
batched_wf[i] = np.flip(wf)
|
220
222
|
|
221
|
-
|
223
|
+
batched_wf_torch = torch.from_numpy(batched_wf)
|
222
224
|
|
223
|
-
|
224
|
-
|
225
|
+
if endianness != self.native_endianness:
|
226
|
+
from qadence.transpile import invert_endianness
|
225
227
|
|
226
|
-
|
228
|
+
batched_wf_torch = invert_endianness(batched_wf_torch)
|
227
229
|
|
228
|
-
|
230
|
+
return batched_wf_torch
|
229
231
|
|
230
|
-
|
232
|
+
else:
|
233
|
+
return self._run_noisy(circuit, noise, param_values, state, endianness)
|
234
|
+
|
235
|
+
def _run_noisy(
|
231
236
|
self,
|
232
237
|
circuit: ConvertedCircuit,
|
233
238
|
noise: Noise,
|
@@ -342,12 +347,12 @@ class Backend(BackendInterface):
|
|
342
347
|
res = res if len(res.shape) > 0 else res.reshape(1)
|
343
348
|
return res.real
|
344
349
|
elif noise is not None:
|
345
|
-
dms = self.
|
350
|
+
dms = self.run(
|
346
351
|
circuit=circuit,
|
347
|
-
noise=noise,
|
348
352
|
param_values=param_values,
|
349
353
|
state=state,
|
350
354
|
endianness=endianness,
|
355
|
+
noise=noise,
|
351
356
|
)
|
352
357
|
support = sorted(list(circuit.abstract.register.support))
|
353
358
|
# TODO: There should be a better check for batched density matrices.
|
@@ -106,16 +106,6 @@ class Backend(BackendInterface):
|
|
106
106
|
state = invert_endianness(state) if endianness != self.native_endianness else state
|
107
107
|
return state
|
108
108
|
|
109
|
-
def run_dm(
|
110
|
-
self,
|
111
|
-
circuit: ConvertedCircuit,
|
112
|
-
noise: Noise,
|
113
|
-
param_values: dict[str, Tensor] = {},
|
114
|
-
state: Tensor | None = None,
|
115
|
-
endianness: Endianness = Endianness.BIG,
|
116
|
-
) -> Tensor:
|
117
|
-
raise NotImplementedError
|
118
|
-
|
119
109
|
def _batched_expectation(
|
120
110
|
self,
|
121
111
|
circuit: ConvertedCircuit,
|