From 606ba1a5145d721a98cb29933ff6ee89a96709d8 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Sun, 11 Jun 2023 21:23:36 +0200
Subject: [PATCH] normalize matrix code

---
 Resample/Flux/MatrixFlux.cpp                 | 2 +-
 Resample/Specular/TransitionMagneticTanh.cpp | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Resample/Flux/MatrixFlux.cpp b/Resample/Flux/MatrixFlux.cpp
index 0eb7db48c77..3573c2ab73c 100644
--- a/Resample/Flux/MatrixFlux.cpp
+++ b/Resample/Flux/MatrixFlux.cpp
@@ -34,7 +34,7 @@ SpinMatrix PhaseRotationMatrix(const R3& B_direction, const Spinor& diagonal)
 
     if (std::abs(e.mag() - 1.) < eps) {
         const double factor1 = 2. * (1. + e.z());
-        SpinMatrix Q(1. + e.z(), I * e.y() - e.x(), e.x() + I * e.y(), e.z() + 1.);
+        SpinMatrix Q(1. + e.z(), -e.x() + I * e.y(), e.x() + I * e.y(), e.z() + 1.);
         return Q * M * Q.adjoint() / factor1;
     }
     ASSERT(e.mag() < eps); // remaining case: no field
diff --git a/Resample/Specular/TransitionMagneticTanh.cpp b/Resample/Specular/TransitionMagneticTanh.cpp
index accac248d1f..35ede8cf31f 100644
--- a/Resample/Specular/TransitionMagneticTanh.cpp
+++ b/Resample/Specular/TransitionMagneticTanh.cpp
@@ -27,12 +27,12 @@ SpinMatrix computeRoughnessMatrix(const MatrixFlux& coeff, double sigma, bool in
     if (sigma < 10 * std::numeric_limits<double>::epsilon())
         return SpinMatrix::One();
 
-    const double sigeff = std::pow((pi / 2), 1.5) * sigma;
+    const double sigeff = std::pow(pi / 2, 1.5) * sigma;
     const R3& b = coeff.field();
 
     if (std::abs(b.mag() - 1.) < std::numeric_limits<double>::epsilon() * 10.) {
         const double factor1 = 2. * (1. + b.z());
-        SpinMatrix Q((1. + b.z()), (I * b.y() - b.x()), (b.x() + I * b.y()), (b.z() + 1.));
+        SpinMatrix Q(1. + b.z(), -b.x() + I * b.y(), b.x() + I * b.y(), b.z() + 1.);
 
         complex_t l1 = std::sqrt(Math::tanhc(sigeff * coeff.k_eigen_dn()));
         complex_t l2 = std::sqrt(Math::tanhc(sigeff * coeff.k_eigen_up()));
-- 
GitLab