taichi-dev / taichi

Productive, portable, and performant GPU programming in Python.
https://taichi-lang.org
Apache License 2.0
25.05k stars 2.26k forks source link

some bugs about "func sym_eig2x2" #8499

Open xiaolinmu opened 3 months ago

xiaolinmu commented 3 months ago

In func sym_eig2x2, lambda1 and lambda2 should be modified, i.e., lambda1 = (tr + ti.sqrt(ti.abs(gap))) 0.5, lambda2 = (tr - ti.sqrt(ti.abs(gap))) 0.5;In " all(A1 == ti.Matrix.zero(dt, 2, 2)) and all(A1 == ti.Matrix.zero(dt, 2, 2))", the second A1 should be A2; In the following v1 and v2 , normalized() may be singular value, like Matrix, [[1,0],[0,0]], it should be rewrited.

xiaolinmu commented 3 months ago

In func, "ops" can be used to replace "ti", because in my own code, i use "ti" to replace "ops".