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
343 stars 11 forks source link

Hessian Matrix formula is wrong #12

Closed dedekindcut closed 1 year ago

dedekindcut commented 1 year 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 1 year ago

13

Leedehai commented 1 year ago

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