diff options
-rw-r--r-- | p-spin.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2,6 +2,7 @@ #include <eigen3/Eigen/Dense> #include <iterator> +#include<type_traits> #include "types.hpp" #include "tensor.hpp" @@ -36,7 +37,7 @@ private: template <int p, int... qs> std::tuple<Scalar, Vector<Scalar>, Matrix<Scalar>, Tensor<Scalar, 3>> hamGradHessHelper(const Vector<Scalar>& z, const Tensor<Scalar, p>& J, const Tensor<Scalar, qs>& ...Js) const { auto [Jz, J3] = hamGradTensorHelper(z, J); - + Vector<Scalar> Jzz = Jz * z; Scalar Jzzz = Jzz.transpose() * z; @@ -66,7 +67,7 @@ public: pSpinModel(const std::tuple<Tensor<Scalar, ps>...>& Js) : Js(Js) {} template <class Generator, typename... T> - pSpinModel<Real>(unsigned N, Generator& r, T... μs) { + pSpinModel(unsigned N, Generator& r, T... μs) requires(std::is_same_v<Scalar, Real>) { Js = std::make_tuple(μs * generateRealPSpinCouplings<Real, ps>(N, r)...); } |