Skip to content

Commit

Permalink
Fix definition of _H to return 2H
Browse files Browse the repository at this point in the history
  • Loading branch information
javicarron committed Feb 20, 2024
1 parent 4da7743 commit 1fba36e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pynkowski/data/so3data.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,15 @@ def _V3(self, us, dus, verbose=True):

@staticmethod
def _H(first_der_t, second_der_t, psi):
"""Compute the mean curvature of the field at a given angle.
"""Compute the mean curvature (times 2) of the field at a given angle.
"""
first_der_t = first_der_t(psi)
second_der_t = second_der_t(psi)
hess = np.array([[second_der_t[0], second_der_t[3], second_der_t[4]],
[second_der_t[3], second_der_t[1], second_der_t[5]],
[second_der_t[4], second_der_t[5], second_der_t[2]]])
norm_grad = first_der_t / np.sqrt(np.sum(first_der_t**2., axis=0))
return np.einsum('j...,jk...,k... -> ...', norm_grad, hess, norm_grad) - np.trace(hess, axis1=0, axis2=1)
return 2.* (np.einsum('j...,jk...,k... -> ...', norm_grad, hess, norm_grad) - np.trace(hess, axis1=0, axis2=1))

@staticmethod
def _K(first_der_t, second_der_t, psi):
Expand Down

0 comments on commit 1fba36e

Please sign in to comment.