thomasahle / tensorgrad

Tensor Network Library with Autograd
GNU Affero General Public License v3.0
41 stars 2 forks source link

Add support for determinants #1

Open thomasahle opened 1 month ago

thomasahle commented 1 month ago

It would be nice to be able to solve tasks like this: https://math.stackexchange.com/questions/4709572/what-is-the-hessian-of-x-mapsto-log-det-left-at-a-rt-operatornamediag?noredirect=1&lq=1

thomasahle commented 1 month ago

Should be easy after adding determinant and matrix inverse functions. Then use these derivative rules:

∂(det(X)) = det(X)Tr(X⁻¹ ∂X)
∂(X⁻¹) = −X⁻¹ (∂X) X⁻¹

These functions would also serve as good examples of functions that are applied along two axes instead of the current functions, which are applied along just one.