normcons#
Norm Conserving Pseudopotential for Plane Waves.
- jrystal.pseudopotential.normcons._energy_nonlocal(pw_coefficients: Complex[Array, 'spin kpt band x y z'], potential_nl_sqrt: Complex[Array, 'kpt atom beta x y z phi'], nonlocal_d_matrix: Float[Array, 'j j'], vol: Float, occupation: Float[Array, 'spin kpt band'] | None = None) Float [source]#
Compute the nonlocal pseudopotential energy.
Note
This function is for seperating the \(\sqrt{V_{nl}}\) part that may not be tracable by jax.
- Parameters:
pw_coefficients (Complex[Array, "spin kpt band x y z"]) – The plane wave coefficients.
potential_nl_sqrt (Complex[Array, "kpt atom beta x y z phi"]) – The square root of the nonlocal pseudopotential.
nonlocal_d_matrix (Float[Array, "j j"]) – The diagonal matrix of the beta functions.
vol (Float) – The volume of the unit cell.
occupation (Optional[OccupationArray]) – The occupation of the states.
- Returns:
The nonlocal pseudopotential energy.
- Return type:
Float
- jrystal.pseudopotential.normcons._hamiltonian_matrix(coefficient: Complex[Array, 'spin kpoint band *ndim'], hamiltonian_density_grid: Float[Array, 'x y z'], potential_local_grid_reciprocal: Float[Array, 'r'], potential_nonlocal_grid_sqrt: Complex[Array, 'kpt atom beta x y z phi'], g_vector_grid: Float[Array, 'x y z 3'], kpts: Float[Array, 'num_k 3'], nonlocal_d_matrix: List[Float[Array, 'beta beta']], vol: Float, xc: str = 'lda', kohn_sham: bool = False)[source]#
Compute the nonlocal pseudopotential hamiltonian.
- Parameters:
coefficient (Complex[Array, “spin kpt band *ndim”]) – The plane wave coefficients.
hamiltonian_density_grid (ScalarGrid[Float, 3]) – The hamiltonian density grid.
potential_local_grid_reciprocal (Float[Array, "nr"]) – The local potential grid in reciprocal space.
potential_nonlocal_grid_sqrt (Complex[Array, "kpt atom beta x y z phi"]) – The square root of the nonlocal pseudopotential.
g_vector_grid (VectorGrid[Float, 3]) – The grid of the reciprocal vectors.
kpts (Float[Array, "num_k d"]) – The grid of the k-points.
- jrystal.pseudopotential.normcons._hamiltonian_nonlocal(pw_coefficients: Complex[Array, 'spin kpt band x y z'], potential_nl_sqrt: Complex[Array, 'kpt atom beta x y z phi'], nonlocal_d_matrix: Float[Array, 'j j'], vol: Float) Complex[Array, 'spin kpt band band'] [source]#
Compute the nonlocal pseudopotential hamiltonian.
Note
This function is for seperating the \(\sqrt{V_{nl}}\) part that may not be tracable by jax.
- Parameters:
pw_coefficients (Complex[Array, "spin kpt band x y z"]) – The plane wave coefficients.
potential_nl_sqrt (Complex[Array, "kpt atom beta x y z phi"]) – The square root of the nonlocal pseudopotential.
nonlocal_d_matrix (Float[Array, "j j"]) – The diagonal matrix of the beta functions.
vol (Float) – The volume of the unit cell.
- Returns:
The nonlocal pseudopotential hamiltonian.
- Return type:
Complex[Array, “spin kpt band band”]
- jrystal.pseudopotential.normcons._potential_nonlocal_square_root(position: Float[Array, 'atom 3'], g_vector_grid: Float[Array, 'x y z 3'], kpts: Float[Array, 'kpt 3'], r_grid: List[Float[Array, 'r']], nonlocal_beta_grid: List[Float[Array, 'beta r']], nonlocal_angular_momentum: List[List[int]]) Complex[Array, 'kpt atom beta x y z phi'] [source]#
Compute the square root of the nonlocal pseudopotential.
The Nonlocal pseudopotential hamiltonian is defined by:
\[< C | V_\text{nl}(G, G') | C >\]where \(V_\text{nl} = F D F^\dagger\), where \(F\) can be obtained from this function, and \(D\) is the diagonal matrix of the beta functions. This function returns \(F\).
- Parameters:
position (Float[Array, "atom 3"]) – The positions of the atoms.
g_vector_grid (Float[Array, "x y z 3"]) – The grid of the reciprocal vectors.
kpts (Float[Array, "kpt 3"]) – The grid of the k-points.
r_grid (List[Float[Array, "r"]]) – The grid of the real space.
nonlocal_beta_grid (List[Float[Array, "beta r"]]) – The grid of the beta functions.
nonlocal_angular_momentum (List[List[int]]) – The angular momentum of the beta functions.
- Returns:
The square root of the nonlocal pseudopotential.
- Return type:
Complex[Array, “kpt atom beta x y z phi”]
- jrystal.pseudopotential.normcons.energy_nonlocal(pw_coefficients: Complex[Array, 'spin kpt band x y z'], positions: Float[Array, 'atom 3'], g_vector_grid: Float[Array, 'x y z 3'], k_vec: Float[Array, 'kpt 3'], r_grid: Float[Array, 'r'], nonlocal_beta_grid: Float[Array, 'beta r'], nonlocal_angular_momentum: List[int], nonlocal_d_matrix: Float[Array, 'j j'], vol: Float, occupation: Float[Array, 'spin kpt band'] | None = None) Float [source]#
Compute the nonlocal pseudopotential energy.
- Parameters:
pw_coefficients (Complex[Array, "spin kpt band x y z"]) – The plane wave coefficients.
positions (Float[Array, "atom 3"]) – The positions of the atoms.
g_vector_grid (Float[Array, "x y z 3"]) – The grid of the reciprocal vectors.
k_vec (Float[Array, "kpt 3"]) – The grid of the k-points.
r_grid (Float[Array, "r"]) – The grid of the real space.
nonlocal_beta_grid (Float[Array, "beta r"]) – The grid of the beta functions.
- Returns:
The nonlocal pseudopotential energy.
- Return type:
Float
- jrystal.pseudopotential.normcons.hamiltonian_trace(coefficient: Complex[Array, 'spin kpt band x y z'], hamiltonian_density_grid: Float[Array, 'x y z'], r_vector_grid: Float[Array, 'x y z 3'], g_vector_grid: Float[Array, 'x y z 3'], kpts: Float[Array, 'kpt 3'], positions: Float[Array, 'atom 3'], r_grid: Int[Array, 'r'], local_potential_grid: Float[Array, 'r'], local_potential_charge: Int[Array, 'atom'], nonlocal_beta_grid: List[Float[Array, 'beta r']], nonlocal_d_matrix: List[Float[Array, 'beta beta']], nonlocal_angular_momentum: List[List[int]], vol: Float)[source]#
Compute the trace of the hamiltonian.
- Parameters:
coefficient (Complex[Array, "spin kpt band x y z"]) – The plane wave coefficients.
hamiltonian_density_grid (ScalarGrid[Float, 3]) – The hamiltonian density grid.
r_vector_grid (Float[Array, "x y z 3"]) – The grid of the real space.
g_vector_grid (Float[Array, "x y z 3"]) – The grid of the reciprocal vectors.
kpts (Float[Array, "kpt 3"]) – The grid of the k-points.
positions (Float[Array, "atom 3"]) – The positions of the atoms.
r_grid (Int[Array, "r"]) – The grid of the real space.
local_potential_grid (Float[Array, "r"]) – The local potential grid.
local_potential_charge (Int[Array, "atom"]) – The local potential charge.
nonlocal_beta_grid (List[Float[Array, "beta r"]]) – The grid of the beta functions.
nonlocal_d_matrix (List[Float[Array, "beta beta"]]) – The diagonal matrix of the beta functions.
nonlocal_angular_momentum (List[List[int]]) – The angular momentum of the beta functions.
vol (Float) – The volume of the unit cell.
- Returns:
The trace of the hamiltonian.
- Return type:
Float