Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure inline templated func hit with arith types only #936

Merged
merged 11 commits into from
Oct 8, 2024
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@

### Bug fixes

* Add concept restriction to ensure `ConstMult` inline function only hit with arithmetic-values times complex values. Fixes build failures with the test suite when enabling OpenMP, and disabling BLAS and Python under clang.
[(#936)](https://github.com/PennyLaneAI/pennylane-lightning/pull/936)

* Bug fix for `applyMatrix` in `lightning.tensor`. Matrix operator data is not stored in the `cuGateCache` object to support `TensorProd` obs with multiple `Hermitian` obs.
[(#932)](https://github.com/PennyLaneAI/pennylane-lightning/pull/932)

Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.39.0-dev40"
__version__ = "0.39.0-dev41"
2 changes: 2 additions & 0 deletions pennylane_lightning/core/src/utils/Util.hpp
mlxd marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <set>
#include <type_traits> // is_same_v
#include <vector>
mlxd marked this conversation as resolved.
Show resolved Hide resolved
#include <concepts> // integral, floating_point

#include "Error.hpp"
#include "TypeTraits.hpp" // remove_complex_t
Expand All @@ -41,6 +42,7 @@ namespace Pennylane::Util {
* @return constexpr std::complex<T>
*/
template <class T, class U = T>
requires std::integral<U> || std::floating_point<U>
maliasadi marked this conversation as resolved.
Show resolved Hide resolved
inline static constexpr auto ConstMult(U a, std::complex<T> b)
-> std::complex<T> {
return {a * b.real(), a * b.imag()};
Expand Down
Loading