gvectors

exception irrep.gvectors.NotSymmetryError[source]

Pass if we attemp to apply to a k-vector a symmetry that does not belong to its little-group.

irrep.gvectors.calc_gvectors(K, RecLattice, Ecut, nplane=inf, Ecut1=-1, thresh=0.001, spinor=True, nplanemax=10000, v=0)[source]

Generates G-vectors taking part in the plane-wave expansion of wave-functions in a particular k-point. Optionally, a cutoff Ecut1 is applied to get rid of large G-vectors.

Parameters:
  • K (array) – Direct coordinates of the k-point.

  • RecLattice (array, shape=(3,3)) – Each row contains the cartesian coordinates of a basis vector forming the unit-cell in reciprocal space.

  • Ecut (float) – Plane-wave cutoff (in eV) used in the DFT calulation. Always read from DFT files.

  • nplane (int, default=np.inf) – Number of plane-waves in the expansion of wave-functions (read from DFT files). Only significant for VASP.

  • Ecut1 (float, default=Ecut) – Plane-wave cutoff (in eV) to consider in the expansion of wave-functions.

  • thresh (float, default=1e-3) – Threshold for defining the g-vectors with the same energy.

  • spinor (bool, default=True) – True if wave functions are spinors, False if they are scalars. It will be read from DFT files. Mandatory for vasp.

  • nplanemax (int, default=10000) – Sets the maximun number of iterations when calculating vectors.

Returns:

igall – Every column corresponds to a plane-wave of energy smaller than Ecut. The number of rows is 6: the first 3 contain direct coordinates of the plane-wave, the fourth row stores indices needed to short plane-waves based on energy (ascending order). Fitfth (sixth) row contains the index of the first (last) plane-wave with the same energy as the plane-wave of the current column.

Return type:

array

irrep.gvectors.sortIG(ik, kg, kpt, CG, RecLattice, Ecut0, Ecut, spinor)[source]

Apply plane-wave cutoff specified in CLI to the expansion of wave-functions and sort the coefficients and plane-waves in ascending order in energy.

Parameters:
  • ik (int) – Index of the k-point.

  • kg (array) – Each row contains the integer coefficients of a reciprocal lattice vector taking part in the plane-wave expansion of wave-functions at the current k-point.

  • kpt (array, shape=(3,)) – Direct coordinates of the k-point.

  • CG (array) – CG[i,j] contains the complex coefficient corresponding to \(j^{th}\) plane-wave in the expansion of \(i^{th}\) wave-function.

  • RecLattice (array, shape=(3,3)) – Each row contains the cartesian coordinates of a basis vector forming the unit-cell in reciprocal space.

  • Ecut (float) – Plane-wave cutoff (in eV) to consider in the expansion of wave-functions. Will be set equal to Ecut0 if input parameter Ecut was not set or the value of this is negative or larger than Ecut0.

  • Ecut0 (float) – Plane-wave cutoff (in eV) used for DFT calulations. Always read from DFT files. Insignificant if code`=`wannier90.

  • spinor (bool) – True if wave-functions are spinors, False if they are scalars.

Returns:

  • CG (array) – Contains the coefficients (same row-column formatting as argument CG) of the expansion of wave-functions corresponding to plane-waves of energy smaller than Ecut. Columns (plane-waves) are shorted based on their energy, from smaller to larger.

  • igall (array) – Every column corresponds to a plane-wave of energy smaller than Ecut. The number of rows is 6: the first 3 contain direct coordinates of the plane-wave, the fourth row stores indices needed to short plane-waves based on energy (ascending order). Fitfth (sixth) row contains the index of the first (last) plane-wave with the same energy as the plane-wave of the current column.

irrep.gvectors.symm_eigenvalues(K, RecLattice, WF, igall, A, S, T, spinor)[source]

Calculate the traces of a symmetry operation for the wave-functions in a particular k-point.

Parameters:
  • K (array, shape=(3,)) – Direct coordinates of the k-point.

  • RecLattice (array, shape=(3,3)) – Each row contains the cartesian coordinates of a basis vector forming the unit-cell in reciprocal space.

  • WF (array) – WF[i,j] contains the coefficient corresponding to \(j^{th}\) plane-wave in the expansion of the wave-function in \(i^{th}\) band. It contains only plane-waves of energy smaller than Ecut.

  • igall (array) – Returned by __sortIG. Every column corresponds to a plane-wave of energy smaller than Ecut. The number of rows is 6: the first 3 contain direct coordinates of the plane-wave, the fourth row stores indices needed to short plane-waves based on energy (ascending order). Fitfth (sixth) row contains the index of the first (last) plane-wave with the same energy as the plane-wave of the current column.

  • A (array, shape=(3,3)) – Matrix describing the tranformation of basis vectors of the unit cell under the symmetry operation.

  • S (array, shape=(2,2)) – Matrix describing how spinors transform under the symmetry.

  • T (array, shape=(3,)) – Translational part of the symmetry operation, in terms of the basis vectors of the unit cell.

  • spinor (bool) – True if wave-functions are spinors, False if they are scalars.

Returns:

Each element is the trace of the symmetry operation in a wave-function.

Return type:

array

irrep.gvectors.symm_matrix(K, RecLattice, WF, igall, A, S, T, spinor)[source]

Computes the matrix S_mn = <Psi_m|{A|T}|Psi_n>

Parameters:
  • K (array, shape=(3,)) – Direct coordinates of the k-point.

  • RecLattice (array, shape=(3,3)) – Each row contains the cartesian coordinates of a basis vector forming the unit-cell in reciprocal space.

  • WF (array) – WF[i,j] contains the coefficient corresponding to \(j^{th}\) plane-wave in the expansion of the wave-function in \(i^{th}\) band. It contains only plane-waves if energy smaller than Ecut.

  • igall (array) – Returned by __sortIG. Every column corresponds to a plane-wave of energy smaller than Ecut. The number of rows is 6: the first 3 contain direct coordinates of the plane-wave, the fourth row stores indices needed to short plane-waves based on energy (ascending order). Fitfth (sixth) row contains the index of the first (last) plane-wave with the same energy as the plane-wave of the current column.

  • A (array, shape=(3,3)) – Matrix describing the tranformation of basis vectors of the unit cell under the symmetry operation.

  • S (array, shape=(2,2)) – Matrix describing how spinors transform under the symmetry.

  • T (array, shape=(3,)) – Translational part of the symmetry operation, in terms of the basis vectors of the unit cell.

  • spinor (bool) – True if wave functions are spinors, False if they are scalars.

Returns:

Matrix of the symmetry operation in the basis of eigenstates of the Bloch Hamiltonian \(H(k)\).

Return type:

array

irrep.gvectors.transformed_g(kpt, ig, RecLattice, A)[source]

Determines how the transformation matrix A reorders the reciprocal lattice vectors taking part in the plane-wave expansion of wave-functions.

Parameters:
  • kpt (array, shape=(3,)) – Direct coordinates of the k-point.

  • ig (array) – Every column corresponds to a plane-wave of energy smaller than Ecut. The number of rows is 6: the first 3 contain direct coordinates of the plane-wave, the fourth row stores indices needed to short plane-waves based on energy (ascending order). Fitfth (sixth) row contains the index of the first (last) groups of plane-waves of identical energy.

  • RecLattice (array, shape=(3,3)) – Each row contains the cartesian coordinates of a basis vector forming the unit-cell in reciprocal space.

  • A (array, shape=(3,3)) – Matrix describing the tranformation of basis vectors of the unit cell under the symmetry operation.

Returns:

rotindrotind[i]`=`j if A`*`ig[:,i]`==`ig[:,j].

Return type:

array