From ed739815cceab0bce720166878c828dbbdcf8feb Mon Sep 17 00:00:00 2001 From: Ali Asadi <10773383+maliasadi@users.noreply.github.com> Date: Tue, 28 May 2024 11:05:16 -0400 Subject: [PATCH 1/7] Update Measurements.probs --- .github/CHANGELOG.md | 4 + .../measurements/MeasurementsKokkos.hpp | 94 ++++++++++--------- .../measurements/MeasurementsLQubit.hpp | 82 ++++++++-------- 3 files changed, 99 insertions(+), 81 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 7f3a70fc96..e680dc23c2 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -45,6 +45,10 @@ * Changed the name of `lightning.tensor` to `default.tensor` with the `quimb` backend. [(#719)](https://github.com/PennyLaneAI/pennylane-lightning/pull/719) +* Dispatch the C++ `Measurements.probs(wires)` method in Lightning-Qubit and Lighnting-Kokkos to `Measurements.probs()` when requesting the probabilities for all wires. + This will trigger a more optimized implementation for calculating the probabilities of the whole system. + [(#)]() + ### Documentation ### Bug fixes diff --git a/pennylane_lightning/core/src/simulators/lightning_kokkos/measurements/MeasurementsKokkos.hpp b/pennylane_lightning/core/src/simulators/lightning_kokkos/measurements/MeasurementsKokkos.hpp index 20f538df9a..f7b6132e95 100644 --- a/pennylane_lightning/core/src/simulators/lightning_kokkos/measurements/MeasurementsKokkos.hpp +++ b/pennylane_lightning/core/src/simulators/lightning_kokkos/measurements/MeasurementsKokkos.hpp @@ -80,11 +80,12 @@ class Measurements final * observables. * * @tparam functor_t Expectation value functor class for Kokkos dispatcher. - * @tparam nqubits Number of wires. + * @tparam num_wires Number of wires. * @param wires Wires to apply the observable to. */ template