Skip to content

Commit a0da8c8

Browse files
committed
bug: changed berry_flux to berry_curvature
Now we use the correct nomenclature regarding Berry curvature. And we do not have an implementation of Berry-flux (yet). Signed-off-by: Nick Papior <[email protected]>
1 parent e0504ca commit a0da8c8

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

sisl/physics/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
~electron.velocity
6565
~electron.velocity_matrix
6666
~electron.berry_phase
67-
~electron.berry_flux
67+
~electron.berry_curvature
6868
~electron.conductivity
6969
~electron.wavefunction
7070
~electron.spin_moment

sisl/physics/electron.py

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
velocity
2121
velocity_matrix
2222
berry_phase
23-
berry_flux
23+
berry_curvature
2424
conductivity
2525
wavefunction
2626
spin_moment
@@ -82,7 +82,7 @@
8282
__all__ += ['velocity', 'velocity_matrix']
8383
__all__ += ['spin_moment', 'spin_orbital_moment', 'spin_squared']
8484
__all__ += ['inv_eff_mass_tensor']
85-
__all__ += ['berry_phase', 'berry_flux']
85+
__all__ += ['berry_phase', 'berry_curvature']
8686
__all__ += ['conductivity']
8787
__all__ += ['wavefunction']
8888
__all__ += ['CoefficientElectron', 'StateElectron', 'StateCElectron']
@@ -730,21 +730,22 @@ def _velocity_matrix_ortho(state, dHk, degenerate, dtype):
730730
return v * _velocity_const
731731

732732

733-
def berry_flux(state, energy, dHk, dSk=None, degenerate=None, complex=False):
733+
def berry_curvature(state, energy, dHk, dSk=None, degenerate=None, complex=False):
734734
r""" Calculate the Berry curvature matrix for a set of states (using Kubo)
735735
736-
The Berry curvature is calculated using the following expression (:math:`\alpha`, :math:`\beta` corresponding to Cartesian directions):
736+
The Berry curvature is calculated using the following expression
737+
(:math:`\alpha`, :math:`\beta` corresponding to Cartesian directions):
737738
738739
.. math::
739740
740741
\boldsymbol\Omega_{n,\alpha\beta} = - \frac2\hbar^2\Im\sum_{m\neq n}
741742
\frac{v_{nm,\alpha} v_{mn,\beta}}
742743
{[\epsilon_m - \epsilon_n]^2}
743744
744-
Note that one should take the imaginary part of the returned value to retrieve the actual
745-
flux.
745+
Note that this method optionally returns the complex valued equivalent of the above.
746+
I.e. :math:`\Im` is not applied if `complex` is true.
746747
747-
For details see [1]_.
748+
For details see Eq. (11) in [1]_ or Eq. (2.59) in [2]_.
748749
749750
Parameters
750751
----------
@@ -775,14 +776,15 @@ def berry_flux(state, energy, dHk, dSk=None, degenerate=None, complex=False):
775776
References
776777
----------
777778
.. [1] X. Wang, J. R. Yates, I. Souza, D. Vanderbilt, "Ab initio calculation of the anomalous Hall conductivity by Wannier interpolation", PRB, *74*, 195118 (2006)
779+
.. [2] J. K. Asboth, L. Oroslany, A. Palyi, "A Short Course on Topological Insulators", arXiv *1509.02295* (2015).
778780
779781
Returns
780782
-------
781783
numpy.ndarray
782784
Berry flux with final dimension ``(state.shape[0], 3, 3)`` (complex if `complex` is True).
783785
"""
784786
if state.ndim == 1:
785-
return berry_flux(state.reshape(1, -1), energy, dHk, dSk, degenerate, complex).ravel()
787+
return berry_curvature(state.reshape(1, -1), energy, dHk, dSk, degenerate, complex).ravel()
786788

787789
if degenerate is None:
788790
# Fix following routine
@@ -793,17 +795,17 @@ def berry_flux(state, energy, dHk, dSk=None, degenerate=None, complex=False):
793795
v_matrix = _velocity_matrix_ortho(state, dHk, degenerate, dtype)
794796
else:
795797
v_matrix = _velocity_matrix_non_ortho(state, dHk, energy, dSk, degenerate, dtype)
796-
warn('berry_flux calculation for non-orthogonal basis sets are not tested! Do not expect this to be correct!')
798+
warn('berry_curvature calculation for non-orthogonal basis sets are not tested! Do not expect this to be correct!')
797799
if complex:
798-
return _berry_flux(v_matrix, energy, degenerate)
799-
return _berry_flux(v_matrix, energy, degenerate).imag
800+
return _berry_curvature(v_matrix, energy, degenerate)
801+
return _berry_curvature(v_matrix, energy, degenerate).imag
800802

801803

802804
# This reverses the velocity unit (squared since Berry curvature is v.v)
803-
_berry_flux_const = constant.hbar('eV ps') ** 2
805+
_berry_curvature_const = 1 / _velocity_const ** 2
804806

805807

806-
def _berry_flux(v_M, energy, degenerate):
808+
def _berry_curvature(v_M, energy, degenerate):
807809
r""" Calculate Berry curvature for a given velocity matrix """
808810

809811
# All matrix elements along the 3 directions
@@ -832,7 +834,7 @@ def _berry_flux(v_M, energy, degenerate):
832834
fac = - 2 / (energy[idx] - energy[n]) ** 2
833835
sigma[n, :, :] = einsum('i,ij,il->jl', fac, v_M[idx, n], v_M[n, idx])
834836

835-
return sigma * _berry_flux_const
837+
return sigma * _berry_curvature_const
836838

837839

838840
def conductivity(bz, distribution='fermi-dirac', method='ahc', complex=False):
@@ -860,7 +862,7 @@ def conductivity(bz, distribution='fermi-dirac', method='ahc', complex=False):
860862
861863
See Also
862864
--------
863-
berry_flux: method used to calculate the Berry-flux for calculating the conductivity
865+
berry_curvature: method used to calculate the Berry-flux for calculating the conductivity
864866
"""
865867
from .hamiltonian import Hamiltonian
866868
# Currently we require the conductivity calculation to *only* accept Hamiltonians
@@ -874,7 +876,7 @@ def conductivity(bz, distribution='fermi-dirac', method='ahc', complex=False):
874876
if method == 'ahc':
875877
def _ahc(es):
876878
occ = distribution(es.eig)
877-
bc = es.berry_flux(complex=complex)
879+
bc = es.berry_curvature(complex=complex)
878880
return einsum('i,ijl->jl', occ, bc)
879881

880882
cond = - bz.asaverage().eigenstate(wrap=_ahc) / constant.hbar('eV ps')
@@ -1884,16 +1886,16 @@ def velocity_matrix(self, eps=1e-4):
18841886
raise SislError(self.__class__.__name__ + '.velocity_matrix requires the parent to have a spin associated.')
18851887
return velocity_matrix(self.state, self.parent.dHk(**opt), self.c, dSk, degenerate=deg)
18861888

1887-
def berry_flux(self, complex=False, eps=1e-4):
1889+
def berry_curvature(self, complex=False, eps=1e-4):
18881890
r""" Calculate Berry curvature for the states
18891891
1890-
This routine calls `~sisl.physics.electron.berry_flux` with appropriate arguments
1892+
This routine calls `~sisl.physics.electron.berry_curvature` with appropriate arguments
18911893
and returns the Berry curvature for the states.
18921894
18931895
Note that the coefficients associated with the `StateCElectron` *must* correspond
18941896
to the energies of the states.
18951897
1896-
See `~sisl.physics.electron.berry_flux` for details.
1898+
See `~sisl.physics.electron.berry_curvature` for details.
18971899
18981900
Parameters
18991901
----------
@@ -1918,8 +1920,8 @@ def berry_flux(self, complex=False, eps=1e-4):
19181920
opt['spin'] = self.info.get('spin', None)
19191921
deg = self.degenerate(eps)
19201922
except:
1921-
raise SislError(self.__class__.__name__ + '.berry_flux requires the parent to have a spin associated.')
1922-
return berry_flux(self.state, self.c, self.parent.dHk(**opt), dSk, degenerate=deg, complex=complex)
1923+
raise SislError(self.__class__.__name__ + '.berry_curvature requires the parent to have a spin associated.')
1924+
return berry_curvature(self.state, self.c, self.parent.dHk(**opt), dSk, degenerate=deg, complex=complex)
19231925

19241926
def inv_eff_mass_tensor(self, as_matrix=False, eps=1e-3):
19251927
r""" Calculate inverse effective mass tensor for the states

sisl/physics/tests/test_hamiltonian.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,15 +641,15 @@ def test_berry_phase_method_fail(self):
641641
bz = BrillouinZone(H, K)
642642
berry_phase(bz, method='unknown')
643643

644-
def test_berry_flux(self, setup):
644+
def test_berry_curvature(self, setup):
645645
R, param = [0.1, 1.5], [1., 0.1]
646646
g = setup.g.tile(2, 0).tile(2, 1).tile(2, 2)
647647
H = Hamiltonian(g)
648648
H.construct((R, param))
649649

650650
k = [0.1] * 3
651-
ie1 = H.eigenstate(k, gauge='R').berry_flux()
652-
ie2 = H.eigenstate(k, gauge='r').berry_flux()
651+
ie1 = H.eigenstate(k, gauge='R').berry_curvature()
652+
ie2 = H.eigenstate(k, gauge='r').berry_curvature()
653653
assert np.allclose(ie1, ie2)
654654

655655
def test_conductivity(self, setup):

0 commit comments

Comments
 (0)