diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 0bfeac7b9a..a6f5c5c726 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -15,6 +15,9 @@ ### Improvements +* Lightning-Kokkos' functors are rewritten as functions wrapping around generic gate and generator functors templated over a coefficient interaction function. This reduces boilerplate while clarifying how the various kernels differ from one another. + [(#640)](https://github.com/PennyLaneAI/pennylane-lightning/pull/640) + * Update C++ and Python GitHub actions names to include the matrix info. [(#717)](https://github.com/PennyLaneAI/pennylane-lightning/pull/717) diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index b98eea33f0..511db7ada4 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-dev11" +__version__ = "0.37.0-dev12" diff --git a/pennylane_lightning/core/src/gates/Gates.hpp b/pennylane_lightning/core/src/gates/Gates.hpp index 695fe34b0a..32728deca9 100644 --- a/pennylane_lightning/core/src/gates/Gates.hpp +++ b/pennylane_lightning/core/src/gates/Gates.hpp @@ -1,37 +1,36 @@ // Copyright 2018-2023 Xanadu Quantum Technologies Inc. - // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at - // http://www.apache.org/licenses/LICENSE-2.0 - // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. - #pragma once - #include #include #include +#include "GateOperation.hpp" #include "Util.hpp" /// @cond DEV namespace { using namespace Pennylane::Util; +using namespace Pennylane::Gates; } // namespace /// @endcond namespace Pennylane::Gates { + /** * @brief Create a matrix representation of the PauliX gate data in row-major * format. * - * @tparam ComplexT Required precision of gate (`float` or `double`). + * @tparam ComplexT Complex class. + * @tparam T Required precision of gate (`float` or `double`). * @return constexpr std::vector> Return constant expression * of PauliX data. */ @@ -45,7 +44,8 @@ static constexpr auto getIdentity() -> std::vector> { * @brief Create a matrix representation of the PauliX gate data in row-major * format. * - * @tparam ComplexT Required precision of gate (`float` or `double`). + * @tparam ComplexT Complex class. + * @tparam T Required precision of gate (`float` or `double`). * @return constexpr std::vector> Return constant expression * of PauliX data. */ @@ -59,7 +59,8 @@ static constexpr auto getPauliX() -> std::vector> { * @brief Create a matrix representation of the PauliY gate data in row-major * format. * - * @tparam ComplexT Required precision of gate (`float` or `double`). + * @tparam ComplexT Complex class. + * @tparam T Required precision of gate (`float` or `double`). * @return constexpr std::vector> Return constant expression * of PauliY data. */ @@ -73,7 +74,8 @@ static constexpr auto getPauliY() -> std::vector> { * @brief Create a matrix representation of the PauliZ gate data in row-major * format. * - * @tparam ComplexT Required precision of gate (`float` or `double`). + * @tparam ComplexT Complex class. + * @tparam T Required precision of gate (`float` or `double`). * @return constexpr std::vector> Return constant expression * of PauliZ data. */ @@ -87,7 +89,8 @@ static constexpr auto getPauliZ() -> std::vector> { * @brief Create a matrix representation of the Hadamard gate data in row-major * format. * - * @tparam ComplexT Required precision of gate (`float` or `double`). + * @tparam ComplexT Complex class. + * @tparam T Required precision of gate (`float` or `double`). * @return constexpr std::vector> Return constant expression * of Hadamard data. */ @@ -100,35 +103,41 @@ static constexpr auto getHadamard() -> std::vector> { /** * @brief Create a matrix representation of the S gate data in row-major format. * - * @tparam ComplexT Required precision of gate (`float` or `double`). + * @tparam ComplexT Complex class. + * @tparam T Required precision of gate (`float` or `double`). * @return constexpr std::vector> Return constant expression * of S gate data. */ template