Leedehai / typst-physics

physica: vectors, fields, differentials, derivatives, Dirac brakets, tensors, and more. See examples in the manual PDF.
https://github.com/Leedehai/typst-physics
MIT License
312 stars 8 forks source link

Hessian Matrix formula is wrong #12

Closed dedekindcut closed 10 months ago

dedekindcut commented 10 months ago

From the manual:

Screenshot 2023-10-24 at 10 07 27 PM

The Hessian is the matrix of second order partial derivatives, so for 3x3 matrices and higher the matrix should still consist of $\dfrac{\partial^2}{\partial x_i \partial x_j}$. Currently for 3x3 hmat generates a matrix with elements such as $\dfrac{\partial^3}{\partial x \partial z}$, which is incorrect. The superscript in the numerator should always be 2 no matter the dimension.

From the wikipedia page:

Screenshot 2023-10-24 at 10 11 46 PM

Thanks for all your hard work on this package! It's now a must have for me when using Typst.

dedekindcut commented 10 months ago

13

Leedehai commented 10 months ago

Fixed by that PR https://github.com/Leedehai/typst-physics/pull/13. Thanks!