You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SymPy 1.12 returns an unexpected matrix derivative.
fromsympy.core.symbolimportsymbolsfromsympy.matrices.expressions.matexprimportMatrixSymbolfromsympy.matrices.expressions.traceimportTracem, n, k=symbols("m n k")
A=MatrixSymbol("A", n, m)
U=MatrixSymbol("U", n, k)
V=MatrixSymbol("V", k, m)
defnrm2(e):
returnTrace(e.T*e)
# works
(0.5*nrm2(A-U*V)).diff(U)
# works0.5*nrm2(A-U*V).diff(U) +0.5*nrm2(A).diff(U)
# does not work (returns 0)
(0.5*nrm2(A-U*V) +0.5*nrm2(A)).diff(U)
# does not work (returns 0)
(0.5*nrm2(A-U*V) +0.5*nrm2(U)).diff(U)
The text was updated successfully, but these errors were encountered:
SymPy 1.12 returns an unexpected matrix derivative.
The text was updated successfully, but these errors were encountered: