From 8209ca60b99594f26f3e9b21ccdbc8695526eb93 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 5 Nov 2021 09:03:36 +0100 Subject: Work on Stokes lines, and new method involving parametric fits. --- p-spin.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'p-spin.hpp') 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> WdW(const Tensor& J, const Vector +Matrix dzDot(const Vector& z, const Vector& dH) { + Real z² = z.squaredNorm(); + return (dH.conjugate() - (dH.dot(z) / z²) * z.conjugate()) * z.adjoint() / z²; +} + +template +Matrix dzDotConjugate(const Vector& z, const Vector& dH, const Matrix& ddH) { + Real z² = z.squaredNorm(); + return -ddH + (ddH * z.conjugate()) * z.transpose() / z² + + (z.dot(dH) / z²) * ( + Matrix::Identity(ddH.rows(), ddH.cols()) - z.conjugate() * z.transpose() / z² + ); +} -- cgit v1.2.3-70-g09d2