Skip to content
Snippets Groups Projects
Commit 84971514 authored by Kostas Vilkelis's avatar Kostas Vilkelis :flamingo:
Browse files

rm unused ks argument

parent 79c7a3a9
No related branches found
No related tags found
1 merge request!6Documentation
Pipeline #179526 passed
This commit is part of merge request !6. Comments created here will be created in the context of that merge request.
...@@ -6,7 +6,7 @@ from pymf.tb.tb import tb_type ...@@ -6,7 +6,7 @@ from pymf.tb.tb import tb_type
ks_type = Optional[np.ndarray] 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. """Evaluate a tight-binding dictionary on a k-space grid.
Parameters Parameters
...@@ -16,9 +16,6 @@ def tb_to_khamvector(tb: tb_type, nk: int, ks: ks_type = None) -> np.ndarray: ...@@ -16,9 +16,6 @@ def tb_to_khamvector(tb: tb_type, nk: int, ks: ks_type = None) -> np.ndarray:
nk : nk :
Number of k-points in a grid to sample the Brillouin zone along each dimension. 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. 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 Returns
------- -------
...@@ -27,9 +24,8 @@ def tb_to_khamvector(tb: tb_type, nk: int, ks: ks_type = None) -> np.ndarray: ...@@ -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. Has shape (nk, nk, ..., ndof, ndof), where ndof is number of internal degrees of freedom.
""" """
ndim = len(list(tb)[0]) ndim = len(list(tb)[0])
if ks is None: ks = np.linspace(-np.pi, np.pi, nk, endpoint=False)
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.concatenate((ks[nk // 2 :], ks[: nk // 2]), axis=0) # shift for ifft
kgrid = np.meshgrid(*([ks] * ndim), indexing="ij") kgrid = np.meshgrid(*([ks] * ndim), indexing="ij")
num_keys = len(list(tb.keys())) num_keys = len(list(tb.keys()))
......
...@@ -78,6 +78,6 @@ def calculate_fermi_energy(tb: tb_type, filling: float, nk: int = 100): ...@@ -78,6 +78,6 @@ def calculate_fermi_energy(tb: tb_type, filling: float, nk: int = 100):
: :
Fermi energy. Fermi energy.
""" """
kham = tb_to_khamvector(tb, nk, ks=None) kham = tb_to_khamvector(tb, nk)
vals = np.linalg.eigvalsh(kham) vals = np.linalg.eigvalsh(kham)
return fermi_on_grid(vals, filling) return fermi_on_grid(vals, filling)
...@@ -27,7 +27,7 @@ def compute_gap(tb, fermi_energy=0, nk=100): ...@@ -27,7 +27,7 @@ def compute_gap(tb, fermi_energy=0, nk=100):
gap : float gap : float
Indirect gap. Indirect gap.
""" """
kham = tb_to_khamvector(tb, nk, ks=None) kham = tb_to_khamvector(tb, nk)
vals = np.linalg.eigvalsh(kham) vals = np.linalg.eigvalsh(kham)
emax = np.max(vals[vals <= fermi_energy]) emax = np.max(vals[vals <= fermi_energy])
......
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