summaryrefslogtreecommitdiff
path: root/p-spin.hpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2021-11-05 09:03:36 +0100
committerJaron Kent-Dobias <jaron@kent-dobias.com>2021-11-05 09:03:36 +0100
commit8209ca60b99594f26f3e9b21ccdbc8695526eb93 (patch)
tree73c64505e1f7b976c7e09958f6b0621245b0c589 /p-spin.hpp
parent433bc18e3b9ad16a85777f91c1cc6aa8cc6c7849 (diff)
downloadcode-8209ca60b99594f26f3e9b21ccdbc8695526eb93.tar.gz
code-8209ca60b99594f26f3e9b21ccdbc8695526eb93.tar.bz2
code-8209ca60b99594f26f3e9b21ccdbc8695526eb93.zip
Work on Stokes lines, and new method involving parametric fits.
Diffstat (limited to 'p-spin.hpp')
-rw-r--r--p-spin.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/p-spin.hpp b/p-spin.hpp
index b2bdf07..e5cd195 100644
--- a/p-spin.hpp
+++ b/p-spin.hpp
@@ -89,3 +89,18 @@ std::tuple<Real, Vector<Scalar>> WdW(const Tensor<Scalar, p>& J, const Vector<Sc
return {W, dW};
}
+
+template <class Scalar>
+Matrix<Scalar> dzDot(const Vector<Scalar>& z, const Vector<Scalar>& dH) {
+ Real z² = z.squaredNorm();
+ return (dH.conjugate() - (dH.dot(z) / z²) * z.conjugate()) * z.adjoint() / z²;
+}
+
+template <class Scalar>
+Matrix<Scalar> dzDotConjugate(const Vector<Scalar>& z, const Vector<Scalar>& dH, const Matrix<Scalar>& ddH) {
+ Real z² = z.squaredNorm();
+ return -ddH + (ddH * z.conjugate()) * z.transpose() / z²
+ + (z.dot(dH) / z²) * (
+ Matrix<Scalar>::Identity(ddH.rows(), ddH.cols()) - z.conjugate() * z.transpose() / z²
+ );
+}