From e903bbad5df73d5fb1dc59c08c6490dcc9d1c255 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Tue, 22 Aug 2023 07:58:00 -0700 Subject: [PATCH 1/8] Do not import numbers header in main code. --- .../algorithms/tests/Test_VectorJacobianProduct.cpp | 1 + pennylane_lightning/core/src/utils/Util.hpp | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pennylane_lightning/core/src/simulators/lightning_qubit/algorithms/tests/Test_VectorJacobianProduct.cpp b/pennylane_lightning/core/src/simulators/lightning_qubit/algorithms/tests/Test_VectorJacobianProduct.cpp index 8af2d4bb7b..e64a1c5014 100644 --- a/pennylane_lightning/core/src/simulators/lightning_qubit/algorithms/tests/Test_VectorJacobianProduct.cpp +++ b/pennylane_lightning/core/src/simulators/lightning_qubit/algorithms/tests/Test_VectorJacobianProduct.cpp @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. #include +#include #include #include #include diff --git a/pennylane_lightning/core/src/utils/Util.hpp b/pennylane_lightning/core/src/utils/Util.hpp index 4eb82aacf4..f4afc4fd8b 100644 --- a/pennylane_lightning/core/src/utils/Util.hpp +++ b/pennylane_lightning/core/src/utils/Util.hpp @@ -20,7 +20,6 @@ #include #include -#include // sqrt2_v #include // transform_reduce #include #include // is_same_v @@ -175,7 +174,7 @@ inline static constexpr auto IMAG() -> ComplexT { * @return constexpr T sqrt(2) */ template inline static constexpr auto SQRT2() -> T { - return std::numbers::sqrt2_v; + return std::sqrt(static_cast(2.0)); } /** @@ -187,7 +186,7 @@ template inline static constexpr auto SQRT2() -> T { */ template