Skip to content
Snippets Groups Projects
Commit 7f532132 authored by Anton Akhmerov's avatar Anton Akhmerov Committed by Christoph Groth
Browse files

use reality of h and t in modes

parent 6467f81c
No related branches found
No related tags found
No related merge requests found
......@@ -71,6 +71,11 @@ def setup_linsys(h_onslice, h_hop, tol=1e6, algorithm=None):
# False if h_hop is purely imaginary
raise ValueError("Inter-slice hopping is exactly zero.")
# If both h and t are real, it may be possible to use the real eigenproblem.
if (not np.any(h_hop.imag)) and (not np.any(h_onslice.imag)):
h_hop = h_hop.real
h_onslice = h_onslice.real
eps = np.finfo(np.common_type(h_onslice, h_hop)).eps * tol
# First check if the hopping matrix has singular values close to 0.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment