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.
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.