PAOFLOW.basis_gen.driver#
High-level basis generator: pseudopotential -> radial shells, in memory or as BASIS_PS/<elem>/<shell>.dat files.
generate_basis_shells() is the in-memory core (one radial function per requested shell,
or per j for spin-orbit pseudopotentials), used by the projections() generator route of
PAOFLOW.projection.radial_shell_basis; generate_basis_for_pseudo() writes the same
functions to disk for the table route (paoflow-genbasis-ps). Both accept a UPF file (QE) or
a POTCAR dataset (VASP, PAOFLOW.inputs.read_potcar).
Classes#
One radial function of the generator. |
Functions#
|
Radial functions of the requested shells of one pseudopotential, in memory. |
|
Pseudize the requested shells of a pseudopotential and write them to disk. |
|
Run |
Module Contents#
- class PAOFLOW.basis_gen.driver.GeneratedShell[source]#
One radial function of the generator.
- Variables:
label (str) – Shell label (
'3D').l (int) – Angular momentum.
j (float or None) – Total angular momentum of a j-resolved function (fully relativistic pseudopotentials),
Nonefor a scalar one (also the degeneracy-weighted j-average written as the scalar file of a spin-orbit pseudopotential).r (ndarray) – Uniform mesh (bohr).
wfc (ndarray) –
u(r) = r R(r), normalised asPAOFLOW.basis_gen.radial.pseudize_shell().energy (float) – Solver eigenvalue (Hartree),
nanfor a stored pseudo-orbital.filename (str) – Name of the table file of this function (
'3D.dat','3D_j3.dat').
- PAOFLOW.basis_gen.driver.generate_basis_shells(pseudo, shells, r_box=None, n_points=2000, prefer_pswfc=True)[source]#
Radial functions of the requested shells of one pseudopotential, in memory.
- Parameters:
pseudo (UPF, PotcarDataset or str) – The pseudopotential (a parsed object, or the path of a UPF file / POTCAR).
r_box (float, optional) – Confining box radius (bohr). Defaults to
min(r[-1], 10)of the radial mesh.n_points (int) – Solver mesh size (interior points = n_points - 1).
prefer_pswfc (bool) – Return the shells the pseudopotential carries as pseudo-orbitals as stored (
pseudize_shell());Falsesolves every shell.
- Returns:
generated (list of GeneratedShell) – In the order of
shells; a shell of a fully relativistic pseudopotential withl > 0gives three entries (j = l - 1/2,j = l + 1/2and their degeneracy-weighted average withj = None).skipped (list of tuple) –
(label, reason)of the shells that could not be generated (below the lowest pseudo-atom level, no physical state, or a frozen-core shell), each also reported with aRuntimeWarning.
Notes
Every function of a pseudopotential is returned on the same uniform mesh, which the position-dipole tables require. The channel solutions are cached across the shells of one call (one generalized eigenproblem per
(l, j)channel).
- PAOFLOW.basis_gen.driver.generate_basis_for_pseudo(upf_path, out_dir, shells=None, preset='extended', r_box=None, n_points=2000, overwrite=True, verbose=False, prefer_pswfc=True)[source]#
Pseudize the requested shells of a pseudopotential and write them to disk.
- Parameters:
upf_path (str, UPF or PotcarDataset) – Path to the UPF file or POTCAR (or a parsed dataset).
out_dir (str) – Output root (per-element subdirectory
out_dir/<elem>/is created automatically).shells (list of str, optional) – Explicit shell labels (e.g.
['3S', '3P', '3D']). Defaults to thepresetaugmentation rules.preset ({'minimal', 'standard', 'extended'}) – Used when
shellsisNone.r_box (float, optional) – Confining box radius (Bohr). Defaults to
min(upf.r[-1], 10).n_points (int) – Solver mesh size (interior points = n_points - 1).
overwrite (bool) – If False, existing files are skipped.
verbose (bool) – Print one line per generated shell.
prefer_pswfc (bool) – Stored pseudo-orbitals for the shells that have one (default);
Falsesolves every shell.
- Returns:
written – Paths of the files written.
- Return type:
- PAOFLOW.basis_gen.driver.generate_basis_for_directory(pseudo_dir, out_dir, preset='extended', r_box=None, n_points=2000, overwrite=True, verbose=False, prefer_pswfc=True)[source]#
Run
generate_basis_for_pseudo()over every pseudopotential inpseudo_dir.UPF files and POTCARs (a
POTCARof the directory, possibly concatenated, and the<name>/POTCARof a PAW library) are processed; every dataset of a concatenated POTCAR gives one element directory.Returns a dict
{element_symbol: [written_paths]}.