Complex warning: casting complex values to real discards the imaginary part
Python error complex warning: casting complex values to real discards the imaginary part
Why numpy computes complex eigenvalues?
linalg.eig This function is calculated in the form of complex number. When the algorithm converges, the imaginary part may not be fully converged to 0, but it is very small. When calculating, the real part can be taken directly.