From 1de7dbe81a7388e4ed430c5d9876818373563a39 Mon Sep 17 00:00:00 2001 From: Abe Coull <85974725+math411@users.noreply.github.com> Date: Mon, 8 Apr 2024 13:52:17 -0700 Subject: [PATCH 1/7] fix: backwards compatiblity for local detuning (#942) --- .../braket/ahs/test_analog_hamiltonian_simulation.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/unit_tests/braket/ahs/test_analog_hamiltonian_simulation.py b/test/unit_tests/braket/ahs/test_analog_hamiltonian_simulation.py index bdc3e92f2..aeb969869 100644 --- a/test/unit_tests/braket/ahs/test_analog_hamiltonian_simulation.py +++ b/test/unit_tests/braket/ahs/test_analog_hamiltonian_simulation.py @@ -177,7 +177,12 @@ def test_discretize(register, driving_field, shifting_field): "values": ["-125664000.0", "-125664000.0", "125664000.0", "125664000.0"], }, } - assert discretized_json["hamiltonian"]["shiftingFields"][0]["magnitude"] == { + local_detuning = ( + discretized_json["hamiltonian"]["shiftingFields"][0]["magnitude"] + if "shiftingFields" in discretized_json["hamiltonian"].keys() + else discretized_json["hamiltonian"]["localDetuning"][0]["magnitude"] + ) + assert local_detuning == { "pattern": ["0.50", "1.00", "0.50", "0.50", "0.50", "0.50"], "time_series": { "times": ["0E-9", "0.000003000"], From e17918bfbb9217c2d5d2f6687cfd8beeba2c431e Mon Sep 17 00:00:00 2001 From: ci Date: Mon, 8 Apr 2024 21:42:01 +0000 Subject: [PATCH 2/7] prepare release v1.76.2 --- CHANGELOG.md | 6 ++++++ src/braket/_sdk/_version.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e125c940c..d1aa55863 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v1.76.2 (2024-04-08) + +### Bug Fixes and Other Changes + + * backwards compatiblity for local detuning + ## v1.76.1 (2024-04-08) ### Bug Fixes and Other Changes diff --git a/src/braket/_sdk/_version.py b/src/braket/_sdk/_version.py index 5919ee261..15c11b7c4 100644 --- a/src/braket/_sdk/_version.py +++ b/src/braket/_sdk/_version.py @@ -15,4 +15,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "1.76.2.dev0" +__version__ = "1.76.2" From 5b21c12121341ba3c42b94ef15251e0bee192498 Mon Sep 17 00:00:00 2001 From: ci Date: Mon, 8 Apr 2024 21:42:01 +0000 Subject: [PATCH 3/7] update development version to v1.76.3.dev0 --- src/braket/_sdk/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/braket/_sdk/_version.py b/src/braket/_sdk/_version.py index 15c11b7c4..8692940be 100644 --- a/src/braket/_sdk/_version.py +++ b/src/braket/_sdk/_version.py @@ -15,4 +15,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "1.76.2" +__version__ = "1.76.3.dev0" From 64a25363580ed159fe716955fda4aaebdbc06609 Mon Sep 17 00:00:00 2001 From: Li Li <60371004+tachikoma-li@users.noreply.github.com> Date: Wed, 10 Apr 2024 02:09:24 +1000 Subject: [PATCH 4/7] fix: Replace pkg_resources with importlib.metadata (#935) --- doc/conf.py | 5 ++--- setup.py | 2 +- src/braket/devices/local_simulator.py | 12 +++++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 2a8193e55..a2548fc65 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -1,12 +1,11 @@ """Sphinx configuration.""" import datetime - -import pkg_resources +from importlib.metadata import version # Sphinx configuration below. project = "amazon-braket-sdk" -version = pkg_resources.require(project)[0].version +version = version(project) release = version copyright = "{}, Amazon.com".format(datetime.datetime.now().year) diff --git a/setup.py b/setup.py index 6c0a9e984..34d220161 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,6 @@ "amazon-braket-schemas>=1.21.0", "amazon-braket-default-simulator>=1.21.2", "oqpy~=0.3.5", - "setuptools", "backoff", "boltons", "boto3>=1.28.53", @@ -41,6 +40,7 @@ "openpulse", "openqasm3", "sympy", + "backports.entry-points-selectable", ], extras_require={ "test": [ diff --git a/src/braket/devices/local_simulator.py b/src/braket/devices/local_simulator.py index faee13fdf..69fcfdaff 100644 --- a/src/braket/devices/local_simulator.py +++ b/src/braket/devices/local_simulator.py @@ -13,14 +13,13 @@ from __future__ import annotations +import sys from functools import singledispatchmethod from itertools import repeat from multiprocessing import Pool from os import cpu_count from typing import Any, Optional, Union -import pkg_resources - from braket.ahs.analog_hamiltonian_simulation import AnalogHamiltonianSimulation from braket.annealing.problem import Problem from braket.circuits import Circuit @@ -39,9 +38,12 @@ from braket.tasks.local_quantum_task import LocalQuantumTask from braket.tasks.local_quantum_task_batch import LocalQuantumTaskBatch -_simulator_devices = { - entry.name: entry for entry in pkg_resources.iter_entry_points("braket.simulators") -} +if sys.version_info.minor == 9: + from backports.entry_points_selectable import entry_points +else: + from importlib.metadata import entry_points + +_simulator_devices = {entry.name: entry for entry in entry_points(group="braket.simulators")} class LocalSimulator(Device): From c68722302aec90d0caa2242dec9e0997afb8246d Mon Sep 17 00:00:00 2001 From: Ryan Shaffer <3620100+rmshaffer@users.noreply.github.com> Date: Tue, 9 Apr 2024 12:43:03 -0400 Subject: [PATCH 5/7] doc: Improve gphase unitary matrix definition in docstring (#944) * Improve gphase unitary matrix definition in docstring * Remove extra whitespace --------- Co-authored-by: Abe Coull <85974725+math411@users.noreply.github.com> --- src/braket/circuits/gates.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/braket/circuits/gates.py b/src/braket/circuits/gates.py index b93b2dfa7..3bfb16731 100644 --- a/src/braket/circuits/gates.py +++ b/src/braket/circuits/gates.py @@ -220,7 +220,9 @@ class GPhase(AngledGate): Unitary matrix: - .. math:: \mathtt{gphase}(\gamma) = e^(i \gamma) I_1. + .. math:: \mathtt{gphase}(\gamma) = e^{i \gamma} I = \begin{bmatrix} + e^{i \gamma} & 0 \\ + 0 & e^{i \gamma} \end{bmatrix}. Args: angle (Union[FreeParameterExpression, float]): angle in radians. @@ -277,7 +279,9 @@ def gphase( Unitary matrix: - .. math:: \mathtt{gphase}(\gamma) = e^(i \gamma) I_1. + .. math:: \mathtt{gphase}(\gamma) = e^{i \gamma} I = \begin{bmatrix} + e^{i \gamma} & 0 \\ + 0 & e^{i \gamma} \end{bmatrix}. Args: angle (Union[FreeParameterExpression, float]): Phase in radians. From bc8e56a79a500ef1bf046999e90a3f204a0d6d64 Mon Sep 17 00:00:00 2001 From: ci Date: Tue, 9 Apr 2024 17:52:29 +0000 Subject: [PATCH 6/7] prepare release v1.76.3 --- CHANGELOG.md | 10 ++++++++++ src/braket/_sdk/_version.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1aa55863..c97490e5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## v1.76.3 (2024-04-09) + +### Bug Fixes and Other Changes + + * Replace pkg_resources with importlib.metadata + +### Documentation Changes + + * Improve gphase unitary matrix definition in docstring + ## v1.76.2 (2024-04-08) ### Bug Fixes and Other Changes diff --git a/src/braket/_sdk/_version.py b/src/braket/_sdk/_version.py index 8692940be..51f057a07 100644 --- a/src/braket/_sdk/_version.py +++ b/src/braket/_sdk/_version.py @@ -15,4 +15,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "1.76.3.dev0" +__version__ = "1.76.3" From 3ea6899074c68f788ee2d4271e415ba592dd793c Mon Sep 17 00:00:00 2001 From: ci Date: Tue, 9 Apr 2024 17:52:29 +0000 Subject: [PATCH 7/7] update development version to v1.76.4.dev0 --- src/braket/_sdk/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/braket/_sdk/_version.py b/src/braket/_sdk/_version.py index 51f057a07..e9af02fbc 100644 --- a/src/braket/_sdk/_version.py +++ b/src/braket/_sdk/_version.py @@ -15,4 +15,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "1.76.3" +__version__ = "1.76.4.dev0"