PAOFLOW.inputs.file_io#
Functions#
|
Parse structural information from a Quantum ESPRESSO output file. |
|
Read relaxed atomic positions (and optionally cell parameters) from a QE output file. |
|
Parse structural information and Namelist blocks from a Quantum ESPRESSO input file. |
|
Write a Quantum ESPRESSO input file from Namelist blocks and card data. |
|
Generate a PAOFLOW Python driver script for an ACBN0 calculation. |
Module Contents#
- PAOFLOW.inputs.file_io.struct_from_outputfile_QE(fname)[source]#
Parse structural information from a Quantum ESPRESSO output file.
- Parameters:
fname (str) – Path to the QE
.outfile.- Returns:
Structure dictionary with keys:
'lattice': np.ndarray, shape(3, 3)— lattice vectors in Bohr.'abc': np.ndarray, shape(nat, 3)— fractional atomic coordinates.'species': list of str — atomic species labels.'lunit': str — length unit ('bohr').'aunit': str — atomic position unit ('alat').
- Return type:
- Raises:
FileNotFoundError – If
fnamedoes not exist.
- PAOFLOW.inputs.file_io.read_relaxed_coordinates_QE(fname)[source]#
Read relaxed atomic positions (and optionally cell parameters) from a QE output file.
- Parameters:
fname (str) – Path to the QE
.out(relaxation) file.- Returns:
Updated structure dictionary (from
struct_from_outputfile_QE()) with two additional keys:'lattice': np.ndarray, shape(nsteps+1, 3, 3)— lattice vectors at each ionic step (index 0 is the initial structure).'abc': np.ndarray, shape(nsteps+1, nat, 3)— fractional atomic positions at each ionic step.
- Return type:
- Raises:
Exception – If no atomic positions or cell coordinates are found in the file.
- PAOFLOW.inputs.file_io.struct_from_inputfile_QE(fname)[source]#
Parse structural information and Namelist blocks from a Quantum ESPRESSO input file.
- Parameters:
fname (str) – Path to the QE input file (e.g.
.scf.in).- Returns:
blocks (dict) – Nested dictionary mapping Namelist names (lower-case) to
{keyword: value}dictionaries.cards (dict) – Dictionary mapping card names (e.g.
'ATOMIC_POSITIONS','ATOMIC_SPECIES','K_POINTS','CELL_PARAMETERS','HUBBARD') to lists of raw text lines.
Notes
Currently only control Namelist blocks are parsed; inline comments are stripped. The
HUBBARDcard accepts an arbitrary number of entries (U,V,J, …), terminated by the next card or end of file.
- PAOFLOW.inputs.file_io.create_atomic_inputfile(calculation, blocks, cards)[source]#
Write a Quantum ESPRESSO input file from Namelist blocks and card data.
- Parameters:
calculation (str) – Base name of the output file; the file is written to
{calculation}.in.blocks (dict) – Nested dictionary of Namelist blocks as returned by
struct_from_inputfile_QE().cards (dict) – Dictionary of card data as returned by
struct_from_inputfile_QE(). The'ATOMIC_SPECIES'card, if present, is written first and then removed from the dict before writing the remaining cards.
- Returns:
Writes a file
{calculation}.into the current directory.- Return type:
None
- PAOFLOW.inputs.file_io.create_acbn0_inputfile(savedir, pthr, outputdir, expand_wedge=False, use_local_basis=False, basispath=None, configuration='standard')[source]#
Generate a PAOFLOW Python driver script for an ACBN0 calculation.
- Parameters:
savedir (str) – Path to the QE
.savedirectory (relative to the PAOFLOW workpath), e.g../tmp/Si.save.pthr (float) – Projectability threshold passed to
paoflow.projectability().outputdir (str) – Output directory passed to the
PAOFLOWconstructor.expand_wedge (bool, optional) – Forwarded to
paoflow.pao_hamiltonian.False(default) assumes QE produced the full BZ (nosym=.true., noinv=.true.);Trueexpands the symmetry-reduced wedge to the full grid.use_local_basis (bool, optional) – When
Truethe projections are computed internally by PAOFLOW (PAOFLOW.PAOFLOW.PAOFLOW.projections()) instead of readingatomic_proj.xmlfromprojwfc.x. The local projection orthonormalises the atomic orbitals, so the wavefunction overlap is set to the identity before the +U Hamiltonian is built, and the PAO basis metadata is dumped to<outputdir>/pao_basis.datfor the Hubbard-manifold selection inACBN0.run_acbn0().basispath (str, optional) – Directory with the per-element radial basis files; forwarded to
projectionswhenuse_local_basisisTrueandconfigurationis'standard'/'extended'.configuration (str or dict, optional) – Projection-basis preset (
'minimal','standard'or'extended') or an explicit{element: [shell_labels]}mapping forwarded toprojections. A dict builds the all-electron basis frombasispath(internal=True).
- Returns:
Writes the script
acbn0.pyto the current directory.- Return type:
None