diff --git a/pymf/tb/transforms.py b/pymf/tb/transforms.py index 3a0e99011dfebb7e2546b35d65d6aa9a82bf788f..374526dce3c4c2b0087aff09e3dc471b1153051b 100644 --- a/pymf/tb/transforms.py +++ b/pymf/tb/transforms.py @@ -6,7 +6,7 @@ from pymf.tb.tb import tb_type ks_type = Optional[np.ndarray] -def tb_to_khamvector(tb: tb_type, nk: int, ks: ks_type = None) -> np.ndarray: +def tb_to_khamvector(tb: tb_type, nk: int) -> np.ndarray: """Evaluate a tight-binding dictionary on a k-space grid. Parameters @@ -16,9 +16,6 @@ def tb_to_khamvector(tb: tb_type, nk: int, ks: ks_type = None) -> np.ndarray: nk : Number of k-points in a grid to sample the Brillouin zone along each dimension. If the system is 0-dimensional (finite), this parameter is ignored. - ks : - Set of points along which to evalaute the k-point grid. Repeated for all dimensions. - If not provided, a linear grid is used based on nk. Returns ------- @@ -27,9 +24,8 @@ def tb_to_khamvector(tb: tb_type, nk: int, ks: ks_type = None) -> np.ndarray: Has shape (nk, nk, ..., ndof, ndof), where ndof is number of internal degrees of freedom. """ ndim = len(list(tb)[0]) - if ks is None: - ks = np.linspace(-np.pi, np.pi, nk, endpoint=False) - ks = np.concatenate((ks[nk // 2 :], ks[: nk // 2]), axis=0) # shift for ifft + ks = np.linspace(-np.pi, np.pi, nk, endpoint=False) + ks = np.concatenate((ks[nk // 2 :], ks[: nk // 2]), axis=0) # shift for ifft kgrid = np.meshgrid(*([ks] * ndim), indexing="ij") num_keys = len(list(tb.keys())) diff --git a/pymf/tb/utils.py b/pymf/tb/utils.py index a8d22dda9fe412713298664e3cb18850099dd6dd..e8e80b864bd64ae35c30afdb573b917e4d4b2c46 100644 --- a/pymf/tb/utils.py +++ b/pymf/tb/utils.py @@ -78,6 +78,6 @@ def calculate_fermi_energy(tb: tb_type, filling: float, nk: int = 100): : Fermi energy. """ - kham = tb_to_khamvector(tb, nk, ks=None) + kham = tb_to_khamvector(tb, nk) vals = np.linalg.eigvalsh(kham) return fermi_on_grid(vals, filling) diff --git a/pymf/tests/test_graphene.py b/pymf/tests/test_graphene.py index 8657f7d36f16c9bea7c4cea804c61f832b8f27d8..e28f30f273988802f5bfbef3475ee0174952ef4c 100644 --- a/pymf/tests/test_graphene.py +++ b/pymf/tests/test_graphene.py @@ -27,7 +27,7 @@ def compute_gap(tb, fermi_energy=0, nk=100): gap : float Indirect gap. """ - kham = tb_to_khamvector(tb, nk, ks=None) + kham = tb_to_khamvector(tb, nk) vals = np.linalg.eigvalsh(kham) emax = np.max(vals[vals <= fermi_energy])