velph init template#
The velph init command is used to prepare the velph.toml file. If no custom
template is specified, the default settings of velph init are used. To specify
a custom template, use the following command:
% velph init CELL_FILENAME PROJECT_FOLDER --template-toml velph-tmpl.toml [OPTIONS]
The velph-tmpl.toml file (which can have any file name) is written in the same
format as velph.toml. A template can have the sections [init], [phelel],
[phonopy], [phono3py], [vasp] and [scheduler], and every key in them is
optional. velph init uses the settings of the template instead of its default
settings, key by key, so a template needs only the settings that differ from the
default settings.
A template can also have settings that velph.toml cannot have, such as the
[init] section, which gives the defaults of the command-line options of
velph init. See Settings that only a template has for the list.
Making a template from an existing velph.toml#
velph init writes [velph], [symmetry], [unitcell] and [primitive_cell]
in velph.toml, and a template cannot have them. To use an existing
velph.toml as a template, remove these four sections. With the other sections
left as they are, velph init writes the same settings for the same crystal
structure.
The k-point blocks of such a template give mesh, and its [phelel],
[phonopy] and [phono3py] give the supercell. velph init uses them as they
are, also for another crystal structure. To have velph init compute the meshes
for the new structure, remove the k-point blocks or write kspacing in them
instead of mesh. To change the supercell, give it on the command line, for
example with --dim.
[init]#
[init]
codes = ["phelel", "phonopy"]
kspacing = 0.2
kspacing_dense = 0.1
max_num_atoms = 120
The keys of [init] correspond to command-line options of velph init. A value
given on the command line overrides the one in [init]. To view the available
options and their defaults, use:
% velph init --help
The help of each option shows its key and type in parentheses, for example
(kspacing: float, default=0.1). The keys are listed below.
Key |
Type |
Default |
|
|---|---|---|---|
|
list[str] |
|
|
|
float |
(see below) |
|
|
str |
|
|
|
str |
|
|
|
bool |
|
|
|
bool |
|
|
|
float |
|
|
|
float |
|
|
|
str |
(none) |
|
|
int |
(none) |
|
|
bool |
|
|
|
bool or |
|
|
|
str |
|
|
|
list[int] (3) |
(none) |
|
|
list[int] (9) or list[list[int]] (3x3) |
(none) |
|
|
bool |
|
|
|
float |
|
|
|
bool |
|
|
Notes:
codeschooses the codes whose sections are written invelph.toml. A section of the template for a code that is not incodesis not used, andvelph initprints, for example,[phonopy] of the template is ignored: "phonopy" is not in codes.Without
amplitude,velph initwrites 0.03 in[phelel]and[phono3py]and 0.01 in[phonopy]. These are the default displacement distances of phono3py and phonopy for VASP.amplitude,diagonal,plusminus,nosymand the supercell keys in[init]are used for all the codes incodes.cell_for_nacandcell_for_relaxaccept"primitive"or"unitcell".primitive_cell_choiceaccepts"standardized"or"reduced".These values are compared in lower case, so
"Primitive"is accepted. Any other value, such as"primitive_cell", is an error.max_num_atomsdetermines the supercell dimension and must be used together withsymmetrize_cell.max_num_atoms,supercell_dimension(three integers), andsupercell_matrix(nine integers or a 3x3 matrix) are three ways to give the supercell. Give only one of them in[init]. When two or more of them are given,velph initstops with an error.When the command line gives the supercell, for example with
--dim, the supercell keys in[init]are not used. See Order of precedence.
The file-handling options of
velph init(--force,--template-toml,--toml-filename) are command-line only and have no[init]key.
Order of precedence#
The same setting can be given in more than one place. For example, the
displacement amplitude can be given by --amplitude on the command line, by
amplitude in [init], and by amplitude in [phelel] of the template.
velph init takes the value from the first of the following places that gives
it:
a command-line option of
velph init[init]of the templatethe other sections of the template, such as
[phelel]the default value
This order applies to the settings in the table below.
Setting |
Command line |
|
Template section |
|---|---|---|---|
amplitude |
|
|
|
diagonal |
|
|
|
plusminus |
|
|
|
nosym |
|
|
|
supercell |
|
|
|
cell |
|
|
|
A value from the command line or from [init] is used for all of [phelel],
[phonopy], and [phono3py]. A value in a template section is used only for
that section. For example, amplitude = 0.02 in [phonopy] of the template
sets the amplitude of [phonopy], and [phelel] gets the default value 0.03.
With amplitude = 0.05 in [init] of the same template, all three sections get
0.05.
A template made from an existing velph.toml has amplitude, diagonal,
plusminus, nosym, and the supercell in [phelel]. These values are used when
the command line and [init] do not give them. To change one of them for a new
project, give it on the command line, for example --amplitude 0.02, and the
template can be used as it is.
The supercell is one setting that can be given in three ways: by the number of
atoms (max_num_atoms), by three integers (supercell_dimension), or by nine
integers (supercell_matrix). In each place, give only one of them. When two or
more of them are given in the same place, velph init stops with an error. When
the command line gives one of them, none of the three in [init] is used. For
example, with max_num_atoms = 120 in [init] and --dim 3 3 3 on the command
line, the supercell is 3x3x3.
The k-point meshes follow another order. A k-point block of the template that
gives mesh or kspacing takes priority over --kspacing and
--kspacing-dense, and over kspacing and kspacing_dense in [init]. These
options and keys are used for the k-point blocks that the template does not
give. See velph init for an example.
INCAR tags follow different rules, which are described in the next section.
[vasp.incar] and incar_unset#
In a template, the [vasp.incar] section holds the INCAR tags shared by the
input sets, such as the plane-wave cutoff and the parallelization tags:
[vasp.incar]
encut = 400
ncore = 4
gga = "PS"
velph init adds these tags to the INCAR tags of each input set that does not
give them, and writes the result in [vasp.<input set>.incar] of velph.toml.
A tag given in [vasp.<input set>.incar], by the template or by the default
settings, takes priority over the same tag of [vasp.incar].
A tag listed in incar_unset of an input set is not added to that input set:
[vasp.nac]
incar_unset = ["npar", "ncore"]
The default settings of velph init list tags in incar_unset of nac and
ph_bands (see INCAR settings). incar_unset of an input set in
the template replaces that of the default settings. For example,
incar_unset = ["ismear", "sigma"] in [vasp.ph_bands] of the template makes
velph init add ediff, lreal, lwave and lcharg of [vasp.incar] to
ph_bands, which the default incar_unset of ph_bands lists.
[vasp.incar] and incar_unset are used only by velph init, so velph.toml
cannot have them. See INCAR settings for the INCAR tags of each
input set in velph.toml.
Templates of velph 0.14#
In a template of velph 0.14, the defaults of the command-line options were given
in [init.options], and an INCAR tag set to an empty table {} was not added to
the input set. velph init stops with an error for such a template, and the
error lists the changes that concern the file. To use the template:
Rename
[init.options]to[init], andphelel_nosymin it tonosym.nosym,amplitude,diagonal,plusminusand the supercell keys in[init]are used for all the codes incodes.Remove the tags set to
{}, and list them inincar_unsetof the input set instead.
See Changes in velph 0.15 for all the changes from velph 0.14.