ph: mass-spring models from Quantum ESPRESSO

class elphmod.ph.Model(flfrc=None, apply_asr=False, apply_asr_simple=False, apply_rsr=False, phid=array([[[[[[[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]]]]]]), amass=array([1.]), at=array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]), tau=array([[0., 0., 0.]]), atom_order=['X'])

Mass-spring model for the phonons.

Parameters
flfrcstr

File with interatomic force constants from q2r.x.

apply_asrbool

Apply acoustic sum rule correction to force constants?

apply_asr_simplebool

Apply simple acoustic sum rule correction to force constants? This sets the self force constant to minus the sum of all other force constants.

apply_rsrbool

Apply rotation sum rule correction to force constants?

phidndarray

Force constants if flfrc is omitted.

amassndarray

Atomic masses if flfrc is omitted.

atndarray

Bravais lattice vectors if flfrc is omitted.

taundarray

Positions of basis atoms if flfrc is omitted.

atom_orderlist of str

Ordered list of atoms if flfrc is omitted.

Attributes
Mndarray

Atomic masses.

andarray

Bravais lattice vectors.

rndarray

Positions of basis atoms.

Rndarray

Lattice vectors of Wigner-Seitz supercell.

atom_orderlist of str

Ordered list of atoms.

datandarray

Corresponding self and interatomic force constants.

sizeint

Number of displacement directions/bands.

natint

Number of atoms.

D(q1=0, q2=0, q3=0)

Set up dynamical matrix for arbitrary q point.

elphmod.ph.asr(phid)

Apply simple acoustic sum rule correction to force constants.

elphmod.ph.group(n, size=3)

Create slice of dynamical matrix beloning to n-th atom.

elphmod.ph.interpolate_dynamical_matrices(D, q, nq, fildyn_template, fildyn, flfrc, angle=120, write_fildyn0=True, apply_asr=False, apply_asr_simple=False, apply_rsr=False, qe_prefix='', clean=False)

Interpolate dynamical matrices given for irreducible wedge of q points.

This function still uses the Quantum ESPRESSO executables q2qstar.x and q2r.x. They are called in serial by each MPI process, which leads to problems if they have been compiled for parallel execution. If you want to run this function in parallel, you have two choices:

  1. Configure Quantum ESPRESSO for compilation of serial executables via ./configure --disable-parallel and run make ph. If you do not want to make them available through the environmental variable PATH, you can also set the parameter qe-prefix to '/path/to/serial/q-e/bin/'. The trailing slash is required.

  2. If your MPI implementation supports nested calls to mpirun, you may try to set qe_prefix to 'mpirun -np 1 '. The trailing space is required.

Parameters
Dlist of square arrays

Dynamical matrices for all irreducible q points.

qlist of 2-tuples

Irreducible q points in crystal coordinates with period \(2 \pi\).

nqint

Number of q points per dimension, i.e., size of uniform mesh.

fildyn_templatestr

Complete name of fildyn file from which to take header information.

fildynstr

Prefix for written files with dynamical matrices.

flfrcstr

Name of written file with interatomic force constants.

anglefloat

Angle between Bravais lattice vectors in degrees.

write_fildyn0bool

Write fildyn0 needed by q2r.x? Otherwise the file must be present.

apply_asrbool

Enforce acoustic sum rule by overwriting self force constants?

apply_asr_simplebool

Apply simple acoustic sum rule correction to force constants? This sets the self force constant to minus the sum of all other force constants.

apply_rsrbool

Enforce rotation sum rule by overwriting self force constants?

qe_prefixstr

String to prepend to names of Quantum ESPRESSO executables.

cleanbool

Delete all temporary files afterwards?

Returns
function

Fourier-interpolant (via force constants) for dynamical matrices.

elphmod.ph.polarization(e, path, angle=60)

Characterize as in-plane longitudinal/transverse or out-of-plane.

elphmod.ph.q2r(ph, D_irr, q_irr, nq, angle=60, apply_asr=False, apply_asr_simple=False, apply_rsr=False)

Interpolate dynamical matrices given for irreducible wedge of q points.

This function replaces interpolate_dynamical_matrices, which depends on Quantum ESPRESSO. Currently, it only works for 2D lattices. For the square lattice, the rotation symmetry (90 degrees) is currently disabled!

Parameters
phobject

Mass-spring model.

D_irrlist of square arrays

Dynamical matrices for all irreducible q points.

q_irrlist of 2-tuples

Irreducible q points in crystal coordinates with period \(2 \pi\).

nqint

Number of q points per dimension, i.e., size of uniform mesh.

anglefloat

Angle between mesh axes in degrees.

apply_asrbool

Enforce acoustic sum rule by overwriting self force constants?

apply_asr_simplebool

Apply simple acoustic sum rule correction to force constants? This sets the self force constant to minus the sum of all other force constants.

apply_rsrbool

Enforce rotation sum rule by overwriting self force constants?

elphmod.ph.read_fildyn(fildyn, divide_mass=True)

Read file fildyn as created by Quantum ESPRESSO’s ph.x.

elphmod.ph.read_flfrc(flfrc)

Read file flfrc with force constants generated by q2r.x.

elphmod.ph.read_q(fildyn0)

Read list of irreducible q points from fildyn0.

elphmod.ph.sgnsqrt(w2)

Calculate signed square root.

elphmod.ph.short_range_model(phid, amass, at, tau, eps=1e-07)

Map force constants onto Wigner-Seitz cell and divide by masses.

elphmod.ph.sum_rule_correction(ph, asr=True, rsr=True, eps=1e-15)

Apply sum rule correction to force constants.

Parameters
phobject

Mass-spring model for the phonons.

asrbool

Enforce acoustic sum rule?

rsrbool

Enforce Born-Huang rotation sum rule?

epsfloat

Tolerance and valid denominator.

elphmod.ph.write_fildyn(fildyn, header, qpoints, dynmats, footer, amass, divide_mass=True)

Write file fildyn as created by Quantum ESPRESSO’s ph.x.

elphmod.ph.write_q(fildyn0, q, nq)

Write list of irreducible q points to fildyn0.