15. Frequently Asked Questions (FAQ)#
This page collects questions that come up repeatedly on the GitHub Discussions and issues pages, with answers for ALAMODE 2.0. Click a question to show the answer. If your question is not answered here, search the Discussions first, then open a new thread with the ALAMODE version, the compiler and MPI library, the input files, and the error message.
Building, crashes at startup, units and conventions.
Fitting error, cutoffs, supercells, cross-validation, symmetry.
Imaginary modes, LO-TO splitting, 2D materials, band plots.
Convergence, BTE solvers, four-phonon, lifetimes.
SCPH convergence, imaginary modes, renormalized force constants.
Other codes, file conversion, memory, MPI and OpenMP.
15.1. General and installation#
The build fails because spglib (or another library) is not found.
The easiest route is the conda or pixi environment described in Installation, which provides all
dependencies (compilers, MPI, Boost, Eigen, spglib, HDF5, …) in one place; CMake then finds them in
$CONDA_PREFIX automatically. Outside such an environment, or if CMake still cannot find spglib
(e.g. cannot find -lsymspg), give its location explicitly:
$ cmake -DSPGLIB_ROOT=/path/to/spglib -DHDF5_ROOT=/path/to/hdf5 ..
SPGLIB_ROOT is the directory that contains the lib and include directories of spglib.
If the binaries cannot find the shared libraries at run time, add them to the library path:
$ export LD_LIBRARY_PATH=$SPGLIB_ROOT/lib:$HDF5_ROOT/lib:$LD_LIBRARY_PATH
See also issue #130.
The program stops with “Illegal instruction” or crashes in the MPI initialization.
Illegal instruction. A build with
-xHOST(Intel) or-march=native(GCC) uses the instruction set of the machine where it was compiled. Running it on an older CPU, e.g. on other nodes of a cluster, stops with this error. Build on the machine type where the code runs, or use a more generic option.Crash in MPI_Init / MPI_Comm_rank. This usually means that the
mpiruncommand and the MPI library linked to the binary come from different MPI installations (e.g. a system MPI and the conda OpenMPI). Use thempirunof the MPI library used for the build, and check the linked libraries withldd.
anphon spends several seconds at startup before any output when many MPI processes run on one node. Why?
This comes from the OpenMP runtime of the Intel oneAPI 2025 compilers (libiomp5), not from anphon.
When each MPI process enters its first OpenMP parallel region, the runtime reads the hardware topology of
the node through the hwloc library. When dozens of processes do this at the same time, the start of the run
is delayed by a few seconds (about 3–6 seconds with 64 processes on one node), independently of the input.
The OpenMP runtimes of GCC (libgomp), LLVM (libomp), and Intel oneAPI 2023 do not show this delay.
The delay matters only for short runs. If you want to avoid it with the oneAPI 2025 runtime, let hwloc read the topology from a file generated on the compute node at the start of the job script:
$ lstopo-no-graphics --of xml > topo_${JOB_ID}.xml
$ export HWLOC_XMLFILE=${PWD}/topo_${JOB_ID}.xml HWLOC_THISSYSTEM=1
$ mpirun -np 64 anphon input.in > output.log
lstopo-no-graphics is part of hwloc. Generate the file on the node where anphon runs, because a
topology file from a different type of node gives wrong information to the runtime.
Which units and coordinate frames are used?
alm works in Rydberg atomic units: lattice vectors and displacements in bohr, forces in Ry/bohr, and \(n\)-th order force constants in Ry/bohrn. Data in other units can be given with LENGTH_UNIT and FORCE_UNIT, e.g.
LENGTH_UNIT = angstrom; FORCE_UNIT = eV/angstromfor aDFSETin VASP units.extract.pywrites Rydberg atomic units by default.Vectors and tensors in the outputs (force constants in
PREFIX.h5, eigenvectors, group velocities, mean square displacements, thermal conductivity) are given in the Cartesian frame, not along the lattice vectors.Phonon frequencies are given in cm-1.
plotband.py --unitconverts the plotted bands to other units (seeplotband.py -h).Unit conversions use the CODATA 2018 values of the physical constants, in the C++ codes (
include/constants.h) and in the Python tools (tools/alamode_constants.py) alike.
15.2. Force constants with alm#
The fitting error is very large (> 90%). Is it problematic? If so, how can I reduce the error?
A large fitting error can affect the accuracy of the force constants. The most likely cause is non-zero
residual forces in the original supercell structure (before the atoms are displaced). Even when the
structure of the primitive cell is optimized with a relatively strict convergence criterion, the atomic
forces in the supercell generated from it may deviate from zero. To reduce the error associated with the
residual forces, calculate the forces of the undisplaced supercell as well and subtract them with the
--offset option of extract.py. For VASP, for example:
$ extract.py --VASP SPOSCAR0 --offset vasprun0.xml vasprun_harm*.xml > DFSET_harmonic
Here, vasprun0.xml is the output of the VASP calculation for the undisplaced supercell SPOSCAR0.
If the fitting error is still large after subtracting the offset components, please consider the following points:
Give the lattice vectors and fractional coordinates with ~15 significant digits; for example, 1/3 should be 0.333333333333333 rather than 0.33333. Alternatively, let alm symmetrize the structure with SYMMETRIZE_STRUCTURE = 1.
Check that the order of the atoms in the
DFSETfile is the same as in the supercell of alm. This matters when the supercell or the displacements were made by another program.Check that the DFT calculations are properly converged.
Use a smaller displacement magnitude for the harmonic force constants.
How small should the fitting error be?
It depends on the Taylor expansion potential and displacement magnitude you choose.
In a standard harmonic calculation where --mag 0.01 is used in displace.py and all harmonic
interactions are considered (cutoff = None), the fitting error is usually less than 5% (~1–2% in most
cases).
In the calculation of third-order force constants with --mag 0.04, the fitting error should be small
as well. Indeed, in many cases, the fitting errors are much smaller (< 1%) than in the harmonic case.
When the force constants are fitted to snapshots of molecular dynamics or random displacements at finite temperature, the fitting error is larger (often > 10%). In this case, compare the training and validation errors:
Both errors are large: the model is not flexible enough. Increase the cutoff radii or
NORDER.The training error is small but the validation error is much larger: the model is overfitted. Add more training data.
See discussion #258 and discussion #328.
What value should I use for the cutoff radius?
For the harmonic term, we recommend None, which includes all harmonic interactions inside the
supercell. This choice hardly increases the computational cost because the number of displacement
patterns does not change. Also, the harmonic dynamical matrix becomes exact at the commensurate q points
only when None is selected. (Giving a very large cutoff radius has the same effect as giving None.)
For the anharmonic terms, increase the cutoff radii gradually and check the convergence of physical quantities, such as thermal conductivity and free energy, with respect to the cutoff values. In most cases, a cutoff radius of 10 Bohr is a good starting point, but a larger value may be necessary for polar materials. The cutoffs are not chosen automatically.
If alm prints WARNING : Rank deficient, the training data are not enough to determine all
parameters of the model. Reduce the cutoff radii (or NBODY), or add more data,
e.g. the structures suggested by MODE = suggest for the present cutoffs, the same patterns with a
different --mag, or more random displacements.
How do I choose NORDER and NBODY?
NORDER = \(m\) includes the terms up to the \((m+1)\)-th order: NORDER = 2
(up to cubic) is enough for three-phonon thermal conductivity, and NORDER = 3 (up to quartic) is needed
for SCPH and four-phonon scattering. A higher NORDER can be used as a more
flexible model when the fitting error stays large for strongly anharmonic materials or high-temperature
data.
NBODY removes many-body clusters, whose number grows quickly. NORDER = 3; NBODY = 2 3 3
(no four-body quartic terms) is a common choice. Harmonic force constants always involve two atoms, so the
first entry of NBODY is always 2.
How large should the displacements be?
Harmonic force constants: about 0.01 Å (
displace.py --mag 0.01). Very small displacements (e.g. 10-5 Å) make the forces dominated by numerical noise of the DFT calculation.Anharmonic force constants from systematic displacements: 0.03–0.05 Å usually works well, but check how the value affects your results.
Random displacements: use
displace.py --VASP SPOSCAR0 --prim POSCAR --random_normalcoord --evec PREFIX.evec.h5 --temp T(the primitive cell given with--primis required), which samples the displacements from the harmonic phonons at temperatureT(see Running ALAMODE and Si : Anharmonic interatomic force constants (IFCs)).
See discussion #264.
Can I use different supercells for the harmonic and anharmonic force constants?
Yes. Anharmonic interactions are usually shorter ranged than harmonic ones, so the anharmonic force constants are often calculated in a smaller supercell.
In anphon, give the harmonic force constants of the larger supercell with FC2FILE and the anharmonic ones with
FCSFILE(orFC3FILE/FC4FILE).In alm, the file given to FC2FIX must contain harmonic force constants of the same supercell as the present fit. To fix the harmonic part while fitting the anharmonic terms in a small supercell, calculate the harmonic force constants of that small supercell first.
Check the convergence with respect to the supercell size, in particular along short lattice directions: a supercell that is too short in one direction can underestimate the phonon-phonon scattering.
How do I use the elastic net or adaptive LASSO, and how do I choose L1_ALPHA?
Run cross-validation first:
LMODEL = enet(oradaptive-lasso) withCV = 4or so (automaticCV-fold cross-validation), orCV = -1with a separateDFSET_CV(manual).Take the
L1_ALPHAthat minimizes the validation error inPREFIX.cvscore (orPREFIX.cvset). If the minimum is at the smallest alpha, rerun with a smaller CV_MINALPHA.Run the fit with
CV = 0and thatL1_ALPHA. The force-constant files are written only by this run.
The RESIDUAL printed in the log is the training error. A smaller alpha always lowers it, so it cannot
be used to choose alpha. The optimal alpha changes with the model (cutoffs, NORDER, NBODY,
FCSYM_BASIS), with the amount of training data, and with STANDARDIZE, so repeat the
cross-validation when any of them changes. Skipping the cross-validation with a tiny L1_ALPHA is not
recommended because it overfits when the training data are few. DEBIAS_OLS = 1 refits the non-zero
coefficients by least squares.
See LMODEL, CV, BaTiO3 : Anharmonic interatomic force constants (IFCs), and discussion #328.
alm takes very long (or crashes) while generating the constraints.
The most common cause is a structure that is symmetric only approximately, e.g. coordinates given with too few digits (hexagonal cells with \(\sqrt{3}/2\) written as 0.866025). Numerical noise then produces many spurious constraints. Remedies:
Give the lattice vectors and positions with full double precision, or set SYMMETRIZE_STRUCTURE = 1. alm warns when the input deviates from the ideal structure of its space group.
FCSYM_BASIS = Lattice can be more robust for such structures (it cannot be combined with the rotational invariance constraints). The optimal
L1_ALPHAdepends on this choice.
The constraint generation of large models is also expensive by itself. Reduce the cutoff radii or the
many-body terms (NBODY) of the highest orders when it is too slow. alm is parallelized with OpenMP;
check Number of OpenMP threads at the top of the log.
Does alm impose the rotational invariance? The ZA branch of my 2D material is not quadratic.
The space-group symmetry and, by default, the translational invariance (acoustic sum rule) are imposed. The
rotational invariance is imposed with ICONST = 12 (or 13, 14) and
ROTAXIS, e.g. ICONST = 12; ROTAXIS = xyz. These constraints are formulated in the
Cartesian frame, need FCSYM_BASIS = Cartesian (the default), and need a structure symmetric to nearly
machine precision (see SYMMETRIZE_STRUCTURE).
For a 2D material, also make the harmonic supercell large enough in the plane, since the flexural (ZA) mode near \(\Gamma\) is sensitive to the long-range harmonic force constants.
alm finds fewer symmetry operations than expected.
Check the structure: the supercell must contain the right number of atoms of each species, and the coordinates must have enough digits.
SYMMETRIZE_STRUCTURE = 1symmetrizes a slightly distorted input.The tolerance of the symmetry search is TOLERANCE (default 10-3).
PRINTSYM = 1writes the symmetry operations toSYMM_INFO.For magnetic systems, MAGMOM lowers the symmetry according to the magnetic order.
Can I use snapshots of ab initio molecular dynamics?
Yes. The recommended way is to add random displacements to snapshots of the MD trajectory, which reduces the correlation between successive snapshots, then calculate their forces with DFT:
$ displace.py --VASP SPOSCAR0 -md vasprun.xml -e 1001:5000:50 --random --mag 0.04 --prefix disp_random
The -e start:end:interval option selects the snapshots. The MD trajectory itself can also be fitted
after converting it with extract.py, but the resulting force constants are biased toward the MD
temperature. See BaTiO3 : Anharmonic interatomic force constants (IFCs).
The vasprun.xml of a VASP machine-learning MD run has a different structure and may not be readable
by the scripts.
15.3. Harmonic phonons#
The phonon dispersion has imaginary frequencies although the material should be stable.
Check the following points.
The structure: relax the primitive cell with the same calculator (DFT functional or force field) that you use for the forces, and build the supercell from that relaxed cell. Check that alm finds the expected space group.
The residual forces and the fitting error (see the questions above), and the displacement magnitude.
The convergence of the DFT forces (cutoff energy, \(k\) points, SCF threshold).
The supercell size: imaginary modes away from the commensurate \(q\) points can be an artifact of a too small supercell.
Polar materials need the non-analytic correction (
NONANALYTICandBORNINFO).
Imaginary modes make the lifetimes and thermal conductivity unreliable. They can also be real: the structure may be dynamically unstable at the level of theory used, as for high-temperature phases that are stabilized by anharmonicity (see Finite temperature (SCPH and QHA)).
Why are the phonon dispersion curves discontinuous, or why do I get too many branches?
Too many (folded) branches. anphon calculates the phonons of the cell in the
&cellfield. With an HDF5 force-constant file (PREFIX.h5), the field can be omitted, and the primitive cell stored in the file is used. If a conventional cell or a supercell is given, anphon runs on that cell: the branches are folded into its smaller Brillouin zone, the \(k\)-point coordinates refer to its reciprocal lattice, and the cost is higher. Note that the lattice vectors in the&cellfield of alm are those of the supercell.Jumps at the zone boundaries in polar materials. With
NONANALYTIC = 2(mixed-space approach), the dispersion can jump at zone-boundary points that are not commensurate with the supercell.NONANALYTIC = 3(Ewald method) avoids this (see PbTe (non-analytic correction)).Discontinuity at \(\Gamma\). In non-cubic polar crystals, the LO-TO splitting depends on the direction from which \(q\) approaches \(\Gamma\), so the dispersion is discontinuous there. This is physical.
Branches swapped at crossings. The bands are sorted by frequency by default. BCONNECT = 1 connects them by the similarity of the eigenvectors.
Which NONANALYTIC option should I use, and how do I make the BORNINFO file?
NONANALYTIC = 3 (Ewald method) is recommended because it separates the short- and long-range parts
properly. The dielectric tensor and the Born effective charges come from a DFPT calculation, and the file
format is described in Format of BORNINFO. For VASP and Quantum ESPRESSO, extract.py writes
the file:
$ extract.py --VASP POSCAR --get born vasprun.xml > BORNINFO
The Born effective charges must be listed in the order of the atoms of the primitive cell used by anphon, so the primitive cell of the DFPT calculation must be the same. BORNSYM = 1 symmetrizes the Born charges. The non-analytic correction acts on the harmonic force constants only; it is not applied to the cubic and quartic force constants. See the PbTe tutorial for a comparison of the options.
How should I treat 2D materials and slabs?
In alm, PERIODIC turns off the periodic boundary condition along the vacuum direction when the interacting atoms are searched, e.g.
PERIODIC = 1 1 0.The rotational invariance (
ICONST = 12) and a large in-plane harmonic supercell help to obtain the quadratic ZA branch (see above).The thermal conductivity includes the vacuum in the cell volume; see the question in the thermal conductivity section.
How do I get the eigenvectors, animate a mode, or identify the modes at Γ?
PRINTEVEC = 1 writes the eigenvalues and eigenvectors (
PREFIX.evec.h5 by default), in the Cartesian frame.ANIME writes animation files of a mode for visualization programs.
IRREPS assigns the irreducible representations of the modes at \(\Gamma\).
HESSIAN = 1 in alm writes the full force-constant matrix of the supercell (
PREFIX.hessian). It lists the supercell atom and component indices with the force constants only; to build the dynamical matrix at arbitrary \(q\), combine it with the supercell structure and the masses, or simply use anphon (oranphon.Phononin the Python API).
15.4. Thermal conductivity#
How do I converge the thermal conductivity?
q mesh. Increase the mesh of the
&kpointfield (KPMODE = 2) until the thermal conductivity converges. The mesh need not be commensurate with the supercell, but it should not break the lattice symmetry (e.g. avoid10 10 20for a cubic cell). Small non-monotonic changes between neighboring meshes can occur.Brillouin-zone integration. The default is the tetrahedron method (
ISMEAR = -1). The adaptive Gaussian smearing (ISMEAR = 2) chooses the widths automatically; with a fixed width (ISMEAR = 0, 1), check the convergence with respect toEPSILONas well.Force constants. Check the convergence with respect to the cubic cutoff radii and the supercell size.
Which force constants are used, and how do I include four-phonon scattering?
MODE = kappa (formerly MODE = RTA) needs the harmonic and cubic force constants; higher orders in
the file are not used for the three-phonon calculation. Four-phonon scattering is added with
INCLUDE_4PH = 1, which needs quartic force constants. Because it is much more
expensive, the four-phonon rates can be evaluated on a coarser mesh (KMESH_COARSE)
and interpolated. See the BAs tutorial.
Can the BTE be solved beyond the relaxation-time approximation?
Yes. SOLVER in the &kappa field selects the solver: RTA (default),
IBTE (iterative), VBTE (variational), and DBTE (direct, for small meshes). The results of the
iterative solvers are written to PREFIX.kl_iter. See Iterative solution (SOLVER = IBTE) for the theory.
Is isotope or boundary scattering included?
Isotope scattering is included by default (ISOTOPE = 1) with the natural abundances of the elements. Set
ISOTOPE = 0for isotopically pure crystals, or giveISOFACTfor enriched samples.Boundary scattering is added with LEN_BOUNDARY, or afterwards with
analyzer.py --calc kappa --size L --h5 PREFIX.kappa.h5(Lin nm).
How do I get the phonon lifetimes, mean free paths, or the cumulative thermal conductivity?
analyzer.py reads PREFIX.kappa.h5:
$ analyzer.py --calc tau --temp 300 --h5 PREFIX.kappa.h5
$ analyzer.py --calc cumulative --temp 300 --h5 PREFIX.kappa.h5
The first command prints the lifetime (ps), group velocity (m/s), and mean free path (nm) of each mode.
The layout of PREFIX.kappa.h5 is described in Thermal conductivity (PREFIX.kappa.h5), and KAPPA_SPEC = 1 writes
the spectrum of the thermal conductivity. For the linewidth or self-energy of selected modes at arbitrary
\(q\) points or along a band path, use MODE = selfenergy (see the
&selfenergy field).
The thermal conductivity of my 2D material is much smaller than reported values.
The thermal conductivity is divided by the volume of the cell, which includes the vacuum. Multiply it by \(c/d\), where \(c\) is the length of the cell perpendicular to the sheet and \(d\) the thickness of the sheet, and use the same \(d\) when comparing with other works. The thickness \(d\) is a convention that must be stated together with the result (e.g., 3.35 Å, the interlayer distance of graphite, is commonly used for graphene). See discussion #32.
15.5. Finite temperature (SCPH and QHA)#
The SCPH iteration does not converge.
Use a smaller MIXALPHA.
Use a smaller temperature step
DT: withWARMSTART = 1(default), each temperature starts from the solution of the previous one, so a closer starting point helps.LOWER_TEMPsets the direction of the temperature sweep.Check the quartic force constants: inaccurate ones (too small cutoff radii, too few training data) are a common cause. Check how the results change when you add training data.
Imaginary modes remain (or appear) after the SCPH calculation.
The SCPH equation is solved on the \(q\) points of KMESH_INTERPOLATE only; the frequencies elsewhere are interpolated. Imaginary modes are therefore detected only on this mesh, and with
KMESH_INTERPOLATE = 1 1 1only at \(\Gamma\). Imaginary pockets can appear at the interpolated points.Small imaginary pockets near \(\Gamma\) often indicate that the quartic force constants are not accurate enough. Increase the quartic cutoff radius and the number of training data.
Use the same
NONANALYTICoption in the harmonic and SCPH calculations.The phonons can be genuinely unstable at low temperatures, e.g. below a phase transition.
How do I choose KMESH_INTERPOLATE and KMESH_SCPH?
The \(q\) points of KMESH_INTERPOLATE should be commensurate with the supercell of the harmonic
force constants: for a 2x2x2 supercell, use KMESH_INTERPOLATE = 2 2 2 (or 1 1 1, which is less
accurate). anphon can evaluate the harmonic phonons on any mesh, but the anharmonic renormalization is
interpolated from the KMESH_INTERPOLATE points, so converge this mesh and the supercell size
(the range of the force constants) separately. KMESH_SCPH can be denser, but each of its values must be a multiple of the corresponding value of
KMESH_INTERPOLATE. See the SrTiO3 tutorial.
How do I use the SCPH (or QHA) phonons for the thermal conductivity, PDOS, or eigenvectors?
The renormalized harmonic force constants at each temperature are stored in PREFIX.scph.h5
(PREFIX.qha.h5). In a later anphon run (MODE = phonons or kappa), keep FCSFILE pointing
to the original force constants and give
DFC2FILE = PREFIX.scph.h5
FC2_TEMPERATURE = 300
in the &general field. All harmonic properties (bands, DOS, PDOS, eigenvectors) are then those of the
SCPH phonons at 300 K. For MODE = kappa, also set TMIN = TMAX = FC2_TEMPERATURE and repeat the run
for each temperature. The harmonic force constants may come from a larger supercell than the SCPH run.
If the structure was relaxed (RELAX_STR > 0), add RELAXED_STRUCTURE = 1.
Use the same NONANALYTIC (2 and 3 are interchangeable) and BORNINFO as in the SCPH run;
other combinations stop with an error or print a warning. The SCPH frequencies are reproduced exactly
at the \(q\) points of KMESH_INTERPOLATE; elsewhere they are interpolated.
This replaces the former dfc2 workflow. See FC2_TEMPERATURE and
DFC2FILE.
My SCPH run finishes immediately and ignores the new settings.
When PREFIX.scph.h5 exists in the working directory, RESTART_SCPH defaults to 1 and anphon restarts
from the stored solution instead of solving the SCPH equation again. If KMESH_INTERPOLATE,
KMESH_SCPH, or NONANALYTIC differ from the stored run, it stops with an error instead.
Delete (or rename) the file, use a new PREFIX, or set RESTART_SCPH = 0 to recalculate.
(BUBBLE = 4 never restarts automatically.)
What do the BUBBLE options do?
BUBBLE adds the bubble (three-phonon) self-energy on top of the SCPH solution. The
options 1, 2, and 3 differ in the frequency at which the self-energy is evaluated (zero, the SCPH
frequency, or self-consistently the corrected frequency). The correction can lower the frequencies strongly
and even make a stable mode imaginary; it is a frequency correction, not a stability test. BUBBLE = 4
evaluates the curvature of the free energy at \(\Gamma\) of the chosen cell for the stability question;
it runs along a structural optimization and needs RELAX_STR != 0, KMESH_SCPH = KMESH_INTERPOLATE,
and NONANALYTIC = 0, and it cannot be combined with RESTART_SCPH = 1.
For options 1–3, the \(q\) mesh of the bubble sum is set by KMESH_BUBBLE.
The thermal conductivity calculated with the SCPH phonons increases with temperature. Is it wrong?
Not necessarily. When the phonons harden with temperature, the larger frequencies and group velocities can outweigh the increase of the scattering rates. If the SCPH frequencies are lower than the harmonic ones, the opposite happens. See discussion #319.
How do I optimize the crystal structure at finite temperatures?
RELAX_STR (SCPH) and the corresponding tag of the &qha field relax the
atomic positions, or the positions and the cell, at each temperature. Relaxing the cell needs the
coupling between strain and force constants (see Tools for the cell-relaxation inputs (strainifc.py, elastic.py, strainfile.py) and
STRAIN_COUPLING). The relaxed structures are stored in PREFIX.scph.h5
/ PREFIX.qha.h5. See the tutorials BaTiO3 : An SCPH-based structural optimization example and
ZnO : A QHA-based structural optimization example.
15.6. Interfaces, file conversion, and performance#
Can I use a DFT code that displace.py and extract.py do not support?
Yes. displace.py and extract.py support VASP, Quantum ESPRESSO, OpenMX, xTAPP, and LAMMPS, but
alm only needs a DFSET file with the displacements and forces of each structure. Using other codes (ASE calculators, WIEN2k, CRYSTAL, …)
shows how to make it with ASE calculators and what to look out for with codes such as WIEN2k and CRYSTAL.
How do I convert force constants to or from phonopy, phono3py, or ShengBTE?
Use tools/fcconvert.py, which converts harmonic and cubic force constants between ALAMODE, phonopy/phono3py,
and ShengBTE, and quartic force constants between ALAMODE and FourPhonon, in both directions; see Converting force constants (phonopy, phono3py, ShengBTE). alm can also write the cubic and quartic force
constants for ShengBTE and FourPhonon directly with FC3_SHENGBTE and
FC4_SHENGBTE.
When you combine data of different codes, the atoms of the supercells must correspond one to one: atom \(i\) of one code must be atom \(i\) of the other. A mismatch gives imaginary frequencies or a wrong thermal conductivity. See discussion #301.
Can I use harmonic force constants from DFPT (Quantum ESPRESSO)?
Yes. qe2alm converts a Quantum ESPRESSO force-constant file (output of q2r.x) to the ALAMODE XML
format, which anphon reads. It asks for the input and output file names interactively. Conversely,
scph_to_qefc.py writes the SCPH-renormalized harmonic force constants in the Quantum ESPRESSO format.
A DFPT calculation on an \(N\times N\times N\) \(q\) mesh and a finite-displacement calculation in
the \(N\times N\times N\) supercell give almost the same harmonic force constants when the same code
and parameters are used and all harmonic interactions are included (cutoff None).
How do I read the force constants in my own scripts?
PREFIX.h5 is an HDF5 file; its layout is described in Force constants (PREFIX.h5). fcsinfo.py prints a
summary of its contents. The Python package alm (Python API) returns the force constants as
NumPy arrays.
alm stops with std::bad_alloc.
The default dense solver stores the sensing matrix, whose size is about (number of structures) \(\times\) (3 \(\times\) number of atoms) \(\times\) (number of parameters) \(\times\) 8 bytes. Options:
LMODEL = ols: SPARSE = 1 for data in which only a few atoms are displaced (the zero displacements must be exactly zero inDFSET), or USE_CHOLESKY = 1, which builds \(A^{\mathsf T}A\) in chunks (CHUNKSIZE).SPARSE = 1has no effect for the elastic net and adaptive LASSO.LMODEL = enetoradaptive-lasso: L1_SOLVER = fista avoids the dense Gram matrix.Reduce the model: smaller cutoff radii, fewer many-body terms (
NBODY), or fewer structures.
How are alm and anphon parallelized?
alm uses OpenMP only (
OMP_NUM_THREADS); it has no MPI parallelization.anphon uses MPI and OpenMP, which can be combined. For SCPH with many atoms in the primitive cell and few \(k\) points, IALGO = 1 distributes the phonon branches instead of the \(k\) points. V4_REAL_SPACE = 1 avoids storing the quartic coupling tensor, whose memory grows as the fourth power of the number of modes; it runs on one MPI process with many OpenMP threads.