Skip to content

Commit 0addcee

Browse files
committed
Pass lo_to_split to DiagonalizeSupercell in QSpaceLanczos
The q-space eigenmodes were computed without LO-TO splitting correction because DiagonalizeSupercell was called without the lo_to_split parameter. Add lo_to_split as an explicit parameter (default None) and forward it to both the parent class and the q-space DiagonalizeSupercell call.
1 parent 2a60851 commit 0addcee

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Modules/QSpaceLanczos.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,17 @@ class QSpaceLanczos(DL.Lanczos):
116116
Only Wigner formalism is supported. Requires Julia extension.
117117
"""
118118

119-
def __init__(self, ensemble, **kwargs):
119+
def __init__(self, ensemble, lo_to_split=None, **kwargs):
120120
"""Initialize the Q-Space Lanczos.
121121
122122
Parameters
123123
----------
124124
ensemble : sscha.Ensemble.Ensemble
125125
The SSCHA ensemble.
126+
lo_to_split : string, ndarray, or None
127+
LO-TO splitting mode. If None (default), LO-TO splitting correction
128+
is neglected. If "random", a random direction is used. If an ndarray,
129+
it specifies the q-direction for the LO-TO splitting correction.
126130
**kwargs
127131
Additional keyword arguments passed to the parent Lanczos class.
128132
"""
@@ -131,7 +135,7 @@ def __init__(self, ensemble, **kwargs):
131135
kwargs['use_wigner'] = True
132136

133137
self.ensemble = ensemble
134-
super().__init__(ensemble, unwrap_symmetries=False, **kwargs)
138+
super().__init__(ensemble, unwrap_symmetries=False, lo_to_split=lo_to_split, **kwargs)
135139

136140
if not __JULIA_EXT__:
137141
raise ImportError(
@@ -150,7 +154,8 @@ def __init__(self, ensemble, **kwargs):
150154
self.__total_attributes__.extend(qspace_attrs)
151155

152156
# == 1. Get q-space eigenmodes ==
153-
ws_sc, pols_sc, w_q, pols_q = self.dyn.DiagonalizeSupercell(return_qmodes=True)
157+
ws_sc, pols_sc, w_q, pols_q = self.dyn.DiagonalizeSupercell(
158+
return_qmodes=True, lo_to_split=lo_to_split)
154159

155160
self.q_points = np.array(self.dyn.q_tot) # (n_q, 3)
156161
self.n_q = len(self.q_points)

0 commit comments

Comments
 (0)