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
Hi @cauachagas, ADCME does not support sparse solvers for complex types directly. Your modification does not work because ADCME lacks a kernel for complex sparse solvers. However, you can make a complex sparse solver from the existing sparse solver for real numbers.
To do this, write your sparse matrix as M = A + i * B, and rhs as u + i * v, the solution is a + i * b, then
(A+iB) (a+ib) = u+iv
The equation is equivalent to
(A*a - B*b) + i * (B*a+A*b) = u + i * v
which is equivalent to
A * a - B * b = u ==> [A -B] [a] = [u]
B * a + A * b = v [B A] [b] = [v]
Using ADCME, you have
M = [A -B
B A]
rhs = [u;v]
sol = M\rhs
sol = sol[1:n] +1im* sol[n+1:2n]
I tried to add to the code
Correct answer
The text was updated successfully, but these errors were encountered: