summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--p-spin.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/p-spin.hpp b/p-spin.hpp
index dee6273..267ab91 100644
--- a/p-spin.hpp
+++ b/p-spin.hpp
@@ -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)...);
}