From 4eff5f0d7995896309abd48b6b1cbd66da38b0da Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 10 May 2024 19:43:54 +0000 Subject: [PATCH 1/8] Update LQ's mcm workflow. --- .../lightning_qubit/lightning_qubit.py | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pennylane_lightning/lightning_qubit/lightning_qubit.py b/pennylane_lightning/lightning_qubit/lightning_qubit.py index 6fe1f307a..0e42773aa 100644 --- a/pennylane_lightning/lightning_qubit/lightning_qubit.py +++ b/pennylane_lightning/lightning_qubit/lightning_qubit.py @@ -78,11 +78,23 @@ def simulate(circuit: QuantumScript, state: LightningStateVector, mcmc: dict = N state.reset_state() has_mcm = any(isinstance(op, MidMeasureMP) for op in circuit.operations) if circuit.shots and has_mcm: - mid_measurements = {} - final_state = state.get_final_state(circuit, mid_measurements=mid_measurements) - return LightningMeasurements(final_state, **mcmc).measure_final_state( - circuit, mid_measurements=mid_measurements + results = [] + aux_circ = qml.tape.QuantumScript( + circuit.operations, + circuit.measurements, + shots=[1], + trainable_params=circuit.trainable_params, ) + for _ in range(circuit.shots.total_shots): + state.reset_state() + mid_measurements = {} + final_state = state.get_final_state(aux_circ, mid_measurements=mid_measurements) + results.append( + LightningMeasurements(final_state, **mcmc).measure_final_state( + aux_circ, mid_measurements=mid_measurements + ) + ) + return tuple(results) final_state = state.get_final_state(circuit) return LightningMeasurements(final_state, **mcmc).measure_final_state(circuit) From f880fe9b22412b9c39f7801241e82700589f5e10 Mon Sep 17 00:00:00 2001 From: ringo-but-quantum Date: Fri, 10 May 2024 19:44:41 +0000 Subject: [PATCH 2/8] Auto update version from '0.37.0-dev6' to '0.37.0-dev7' --- pennylane_lightning/core/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 2ce6abc8c..b1bdc4a57 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.37.0-dev6" +__version__ = "0.37.0-dev7" From 974102c2ca3e44475690fcdc4f4e146c5320619b Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 10 May 2024 19:46:13 +0000 Subject: [PATCH 3/8] Update changelog --- .github/CHANGELOG.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index ab7eab807..577d0af2a 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -4,19 +4,22 @@ ### Breaking changes +* `dynamic_one_shot` uses shot-vectors in the auxiliary tape to tell the device how many times to repeat the tape. Lightning-Qubit is updated accordingly. + [(#724)](https://github.com/PennyLaneAI/pennylane-lightning/pull/724) + * `dynamic_one_shot` deals with post-selection during the post-processing phase, so Lightning-Qubit does not return `None`-valued measurements for mismatching samples anymore. [(#720)](https://github.com/PennyLaneAI/pennylane-lightning/pull/720) - + ### Improvements * The various OpenMP configurations of Lightning-Qubit are tested in parallel on different Github Actions runners. [(#712)](https://github.com/PennyLaneAI/pennylane-lightning/pull/712) - + * Update Linux wheels to use manylinux_2_28 images. [(#667)](https://github.com/PennyLaneAI/pennylane-lightning/pull/667) * Add support for `qml.expval` and `qml.var` in the `lightning.tensor` device for the `quimb` interface and the MPS method. - [(#686)](https://github.com/PennyLaneAI/pennylane-lightning/pull/686) + [(#686)](https://github.com/PennyLaneAI/pennylane-lightning/pull/686) * Changed the name of `lightning.tensor` to `default.tensor` with the `quimb` backend. [(#719)](https://github.com/PennyLaneAI/pennylane-lightning/pull/719) From 228046bfcefcd48abf6ce1e6a09ab363ad8c70f7 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 10 May 2024 19:52:50 +0000 Subject: [PATCH 4/8] trigger ci From 03dffae2175be6b00ecb6b96c53c1df6b586f16d Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 10 May 2024 19:52:59 +0000 Subject: [PATCH 5/8] trigger ci From a39a7c5d5194143b92869c7563e5914de16c32fe Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 10 May 2024 19:58:18 +0000 Subject: [PATCH 6/8] Fix paths-ignore for python tests. --- .github/workflows/tests_lgpu_python.yml | 2 +- .github/workflows/tests_lgpumpi_python.yml | 2 +- .github/workflows/tests_lkcpu_python.yml | 2 +- .github/workflows/tests_lkcuda_python.yml | 2 +- .github/workflows/tests_lqcpu_python.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests_lgpu_python.yml b/.github/workflows/tests_lgpu_python.yml index 5ab6975fd..b12da9448 100644 --- a/.github/workflows/tests_lgpu_python.yml +++ b/.github/workflows/tests_lgpu_python.yml @@ -13,7 +13,7 @@ on: release: pull_request: paths-ignore: - - .github + - .github/** - '!.github/workflows/tests_lgpu_python.yml' - pennylane_lightning/core/_version.py - pennylane_lightning/core/src/simulators/lightning_kokkos/** diff --git a/.github/workflows/tests_lgpumpi_python.yml b/.github/workflows/tests_lgpumpi_python.yml index 3b3cecdec..ff6c24f8d 100644 --- a/.github/workflows/tests_lgpumpi_python.yml +++ b/.github/workflows/tests_lgpumpi_python.yml @@ -16,7 +16,7 @@ on: - main pull_request: paths-ignore: - - .github + - .github/** - '!.github/workflows/tests_lgpumpi_python.yml' - pennylane_lightning/core/_version.py - pennylane_lightning/core/src/simulators/lightning_kokkos/** diff --git a/.github/workflows/tests_lkcpu_python.yml b/.github/workflows/tests_lkcpu_python.yml index 340e4e5c9..e1af827db 100644 --- a/.github/workflows/tests_lkcpu_python.yml +++ b/.github/workflows/tests_lkcpu_python.yml @@ -12,7 +12,7 @@ on: description: The version of PennyLane to use. Valid values are either 'release' (most recent release candidate), 'stable' (most recent git-tag) or 'latest' (most recent commit from master) pull_request: paths-ignore: - - .github + - .github/** - '!.github/workflows/tests_lkcpu_python.yml' - pennylane_lightning/core/_version.py - pennylane_lightning/core/src/simulators/lightning_gpu/** diff --git a/.github/workflows/tests_lkcuda_python.yml b/.github/workflows/tests_lkcuda_python.yml index 878a1051e..d15c2a90b 100644 --- a/.github/workflows/tests_lkcuda_python.yml +++ b/.github/workflows/tests_lkcuda_python.yml @@ -12,7 +12,7 @@ on: description: The version of PennyLane to use. Valid values are either 'release' (most recent release candidate), 'stable' (most recent git-tag) or 'latest' (most recent commit from master) pull_request: paths-ignore: - - .github + - .github/** - '!.github/workflows/tests_lkcuda_python.yml' - pennylane_lightning/core/_version.py - pennylane_lightning/core/src/simulators/lightning_gpu/** diff --git a/.github/workflows/tests_lqcpu_python.yml b/.github/workflows/tests_lqcpu_python.yml index 7124b3f0d..bdbc29eb7 100644 --- a/.github/workflows/tests_lqcpu_python.yml +++ b/.github/workflows/tests_lqcpu_python.yml @@ -12,7 +12,7 @@ on: description: The version of PennyLane to use. Valid values are either 'release' (most recent release candidate), 'stable' (most recent git-tag) or 'latest' (most recent commit from master) pull_request: paths-ignore: - - .github + - .github/** - '!.github/workflows/tests_lqcpu_python.yml' - pennylane_lightning/core/_version.py - pennylane_lightning/core/src/simulators/lightning_gpu/** From 7ea317c55e3735273f1fc5570d623296fecac504 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Fri, 10 May 2024 16:27:12 -0400 Subject: [PATCH 7/8] Update .github/CHANGELOG.md --- .github/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 282bc4753..8cefd2647 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -21,7 +21,7 @@ * The various OpenMP configurations of Lightning-Qubit are tested in parallel on different Github Actions runners. [(#712)](https://github.com/PennyLaneAI/pennylane-lightning/pull/712) -* Update Linux wheels to use manylinux_2_28 images. +* Update Linux wheels to use `manylinux_2_28` images. [(#667)](https://github.com/PennyLaneAI/pennylane-lightning/pull/667) * Add support for `qml.expval` and `qml.var` in the `lightning.tensor` device for the `quimb` interface and the MPS method. From 703f38d8b8d614893e20d85e663bfdc711fd67cd Mon Sep 17 00:00:00 2001 From: ringo-but-quantum Date: Fri, 10 May 2024 20:32:20 +0000 Subject: [PATCH 8/8] Auto update version from '0.37.0-dev7' to '0.37.0-dev8' --- pennylane_lightning/core/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index b1bdc4a57..2f920cb93 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.37.0-dev7" +__version__ = "0.37.0-dev8"