PAOFLOW.elphon.dfpt_io#
Readers for the ph.x outputs that feed the native coarse electron-phonon vertex.
The DFPT coupling source of PAOFLOW.elphon.dfpt_vertex needs, per irreducible q:
the induced self-consistent potential dvscf (one record per displacement pattern on
the dense FFT grid), the displacement patterns u (patterns.N.xml) and the
dynamical matrix (dyn file). Two directory layouts are recognised:
the
pp.pycollection of EPW:<dir>/<prefix>.dvscf_qN,<prefix>.dyn_qNand<prefix>.phsave/patterns.N.xml;the raw
ph.xrun:<dir>/_ph0/<prefix>.dvscf1(first q),_ph0/<prefix>.q_N/<prefix>.dvscf1,_ph0/<prefix>.phsave/patterns.N.xmland<dir>/<prefix>.dynN(fildynwritten in the run directory).
The crystal space group and the plane-wave setup come from the nscf data-file-schema.xml.
Attributes#
Classes#
Paths of the |
|
Crystal space-group operations of the scf/nscf run, in QE's conventions. |
Functions#
|
Find the |
|
Displacement patterns of one irreducible q ( |
|
Induced self-consistent potential of |
|
Irreducible q-points of the |
|
Dielectric tensor and Born effective charges stored with the Gamma dynamical matrix. |
|
Crystal symmetries from |
|
Plane-wave and spin setup of the nscf run ( |
Module Contents#
- class PAOFLOW.elphon.dfpt_io.DFPTFiles[source]#
Paths of the
ph.xoutputs of one q-grid run.- Variables:
prefix (str) –
prefixof the QE run.layout ({'pp', 'ph'}) –
pp.pycollection or rawph.xrun directory.dvscf (tuple of str) –
dvscffile of every irreducible q (ph.xorder).patterns (tuple of str) –
patterns.N.xmlof every irreducible q.dyn (tuple of str) – Dynamical-matrix file of every irreducible q.
dyn0 (str or None) –
<prefix>.dyn0(q-grid header) when present.
- PAOFLOW.elphon.dfpt_io.locate_dfpt_files(dfpt_dir, prefix=None)[source]#
Find the
dvscf, pattern and dynamical-matrix files of aph.xq-grid run.- Parameters:
- Returns:
The files of every irreducible q in
ph.xorder.- Return type:
- Raises:
FileNotFoundError – When neither layout is found or a q is incomplete.
- PAOFLOW.elphon.dfpt_io.read_patterns(path)[source]#
Displacement patterns of one irreducible q (
patterns.N.xmlofph.x).- Parameters:
path (str) – The
patterns.N.xmlfile.- Returns:
u(3 nat, 3 nat)complex, columnnu= patternnuin the global mode order (Cartesian index3 kappa + alphaalong the rows);npert(perturbations per irreducible representation);nirr;minus_q(MINUS_Q_SYM);nat.- Return type:
Notes
The
dvscfrecordnuis the response to the patternu[:, nu]; the Cartesian responses follow fromdV_c = sum_nu conj(u[c, nu]) dV_nu(uunitary).
- PAOFLOW.elphon.dfpt_io.read_dvscf(path, fft_grid, nmodes, nspin_mag=1)[source]#
Induced self-consistent potential of
ph.x(fildvscf), all patterns of one q.- Parameters:
- Returns:
Lattice-periodic part of the Hartree + exchange-correlation response (Ry) to the displacement pattern
u[:, nu]with modulationexp(i q . R); the bare ionic term is not included. Index[.., i, j, k]is the grid pointi/nr1, j/nr2, k/nr3.- Return type:
ndarray, shape
(nmodes, nspin_mag, nr1, nr2, nr3), complex- Raises:
ValueError – When the file size is not
nmodesrecords ofnr1 nr2 nr3 nspin_magcomplex numbers.
- PAOFLOW.elphon.dfpt_io.read_irreducible_q(files, bg)[source]#
Irreducible q-points of the
ph.xrun (crystal coordinates), from the dyn files.- Parameters:
files (DFPTFiles) – From
locate_dfpt_files().bg (ndarray, shape
(3, 3)) – Reciprocal lattice vectors (rows,2 pi / alat).
- Returns:
The first q of every dyn file (the irreducible representative; the star follows it).
- Return type:
ndarray, shape
(nq_irr, 3)
- PAOFLOW.elphon.dfpt_io.read_long_range_tensors(files)[source]#
Dielectric tensor and Born effective charges stored with the Gamma dynamical matrix.
- Parameters:
files (DFPTFiles) – From
locate_dfpt_files().- Returns:
epsilon (ndarray
(3, 3)or None)born_charges (ndarray
(nat, 3, 3)or None) –Nonewhenph.xran withoutepsil.
- class PAOFLOW.elphon.dfpt_io.SpaceGroup[source]#
Crystal space-group operations of the scf/nscf run, in QE’s conventions.
- Variables:
rotations (ndarray, shape
(nsym, 3, 3), int) – RotationRacting on crystal coordinates of positions: the operation mapsx -> R x - t(QE stores the fractional translation with this sign).translations (ndarray, shape
(nsym, 3)) – Fractional translationst(crystal coordinates).equivalent_atoms (ndarray, shape
(nsym, nat), int) –equivalent_atoms[isym, kappa]is the atom onto whichkappais mapped (QEirt, 0-based).time_reversal (ndarray, shape
(nsym,), bool) – Operations combined with time reversal (magnetic runs only).
- rotations: numpy.typing.NDArray[numpy.int_][source]#
- equivalent_atoms: numpy.typing.NDArray[numpy.int_][source]#
- PAOFLOW.elphon.dfpt_io.read_space_group(save_dir, check=True)[source]#
Crystal symmetries from
data-file-schema.xml(thecrystal_symmetryentries).- Parameters:
- Return type:
- Raises:
ValueError – If an operation does not map the atoms as declared (convention mismatch).
- PAOFLOW.elphon.dfpt_io.read_nscf_plane_wave_setup(save_dir)[source]#
Plane-wave and spin setup of the nscf run (
data-file-schema.xml).- Parameters:
save_dir (str) – QE
outdir/prefix.savedirectory.- Returns:
ecutwfc_ry,ecutrho_ry,fft_gridandfft_smooth(dense and smooth grids),nspin,lsda,noncolin,spinorbit,npol,nbnd,nelec,alat(bohr),atandbg(rows, alat and 2 pi/alat),omega(bohr^3),tau_alat(nat, 3),atom_species(species name of every atom),pseudo_files(species -> UPF file name),species_order.- Return type: