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
hm System with non-orthogonal basis
Implemented handling of non-orthonal basis by z2pack.hm.System.
Added _hamilton_orthogonal property (bool) which is True is the
Hamiltonian is orthogonal and False ortherwise
Added basis_overlaps to store the function to call for the overlap
matrix at each k
The orthogonalization of the Hamiltonian is performed by a Lowdin
transformation at each k.
Co-authored-by: Nils Wittemeier <[email protected]>
Co-authored-by: Dominik Gresch <[email protected]>
Copy file name to clipboardExpand all lines: z2pack/hm.py
+27Lines changed: 27 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,9 @@ class System(EigenstateSystem):
35
35
:param hermitian_tol: Maximum absolute value in the difference between the Hamiltonian and its hermitian conjugate. Use ``hermitian_tol=None`` to deactivate the test entirely.
36
36
:type hermitian_tol: float
37
37
38
+
:param basis_overlap: A function taking the wavevector ``k`` (``list`` of length 3) as an input and returning the overlap matrix between the basis vectors w.r.t which the Hamiltonian is defined. If no value is given, the basis is assumed to be orthonormal.
39
+
:type basis_overlap: collections.abc.Callable
40
+
38
41
:param convention: The convention used for the Hamiltonian, following the `pythtb formalism <http://www.physics.rutgers.edu/pythtb/_downloads/pythtb-formalism.pdf>`_. Convention 1 means that the eigenvalues of :math:`\mathcal{H}(\mathbf{k})` are wave vectors :math:`\left|\psi_{n\mathbf{k}}\right>`. With convention 2, they are the cell-periodic Bloch functions :math:`\left|u_{n\mathbf{k}}\right>`.
39
42
:type convention: int
40
43
@@ -49,17 +52,20 @@ def __init__(
49
52
pos=None,
50
53
bands=None,
51
54
hermitian_tol=1e-6,
55
+
basis_overlap=None,
52
56
convention=2,
53
57
check_periodic=False
54
58
):
55
59
self._hamilton=hamilton
56
60
self._hermitian_tol=hermitian_tol
61
+
self._basis_overlap=basis_overlap
57
62
self._convention=int(convention)
58
63
ifself._conventionnotin {1, 2}:
59
64
raiseValueError(
60
65
"Invalid value '{}' for 'convention', must be either 1 or 2.".
61
66
format(self._convention)
62
67
)
68
+
self._hamilton_orthogonal=basis_overlapisNone
63
69
64
70
ifcheck_periodic:
65
71
k_values=itertools.product([0, 1], repeat=dim)
@@ -73,6 +79,14 @@ def __init__(
73
79
)
74
80
75
81
size=len(self._hamilton([0] *dim)) # assuming to be square...
82
+
ifnotself._hamilton_orthogonal:
83
+
size_S=len(self._basis_overlap([0] *dim)) # assuming to be square...
84
+
ifsize_S!=size:
85
+
raiseValueError(
86
+
'The dimensions of overlap matrix ({0}) and Hamilontonian ({1}) do not match.'.
87
+
format(size_S, size)
88
+
)
89
+
76
90
# add one atom for each orbital in the hamiltonian
77
91
ifposisNone:
78
92
self._pos= [np.zeros(dim) for_inrange(size)]
@@ -106,6 +120,19 @@ def get_eig(self, kpt):
106
120
'The Hamiltonian you used is not hermitian, with the maximum difference between the Hamiltonian and its adjoint being {0}. Use the ``hamilton_tol`` input parameter (in the ``tb.Hamilton`` constructor; currently {1}) to set the sensitivity of this test or turn it off completely (``hamilton_tol=None``).'
'The overlap you used is not hermitian, with the maximum difference between the overlap matrix and its adjoint being {0}. Use the ``hermitian_tol`` input parameter (currently {1}) to set the sensitivity of this test or turn it off completely (``hermitian_tol=None``).'.
0 commit comments