All plugins

aiida-phonopy

The official AiiDA plugin for Phonopy

status stable AiiDA >=2.8,<3.0

General information

Install pip install aiida-phonopy
Python import import aiida_phonopy
Latest version 1.8.0
Released 2026-07-21

Registry checks

All checks passed

Plugins provided

Calculations 1 Parsers 1 Data 4 Workflows 2

Entry points

CalcJobs and calculation functions aiida.calculations
  • phonopy.phonopy

    class: aiida_phonopy.calculations.phonopy:PhonopyCalculation

    Base `CalcJob` implementation for Phonopy post-processing.

    InputRequiredValid typesDescription
    parameters true Dict Phonopy parameters (`setting tags`) for post processing. The following tags, along their type, are allowed: PRIMITIVE_AXES PRIMITIVE_AXIS EIGENVECTORS BAND BAND_PATHS BAND_POINTS BAND_LABELS BAND_CONNECTION BAND_INDICES MESH MP MESH_NUMBERS MP_SHIFT GAMMA_CENTER WRITE_MESH DOS DOS_RANGE FMIN FMAX FPITCH PDOS PROJECTION_DIRECTION XYZ_DIRECTION SIGMA DEBYE_MODEL MOMEMT MOMENT_ORDER TPROP TMIN TMAX TSTEP PRETEND_REAL CUTOFF_FREQUENCY TDISP TDISPMAT TDISPMAT_CIF QPOINTS WRITEDM NAC_METHOD Q_DIRECTION GROUP_VELOCITY GV_DELTA_Q SYMMETRY_TOLERANCE SYMMETRY MESH_SYMMETRY FC_SYMMETRY FULL_FORCE_CONSTANTS WRITE_FORCE_CONSTANTS ANIME_TYPE ANIME MODULATION IRREPS SHOW_IRREPS LITTLE_COGROUP
    code false AbstractCode, NoneType The `Code` to use for this job. This input is required, unless the `remote_folder` input is specified, which means an existing job is being imported and no code will actually be run.
    force_constants false ForceConstantsData, NoneType Force constants of the input structure.
    metadata false
    monitors false Dict Add monitoring functions that can inspect output files while the job is running and decide to prematurely terminate the job.
    phonopy_data false PhonopyData, NoneType The preprocess output info of a previous ForceConstantsWorkChain.
    remote_folder false RemoteData, NoneType Remote directory containing the results of an already completed calculation job without AiiDA. The inputs should be passed to the `CalcJob` as normal but instead of launching the actual job, the engine will recreate the input files and then proceed straight to the retrieve step where the files of this `RemoteData` will be retrieved as if it had been actually launched through AiiDA. If a parser is defined in the inputs, the results are parsed and attached as output nodes as usual.
    settings false Dict, NoneType Settings for phonopy calculation.
    OutputRequiredValid typesDescription
    remote_folder true RemoteData Input files necessary to run the process will be stored in this folder node.
    retrieved true FolderData Files that are retrieved by the daemon will be stored in this node. By default the stdout and stderr of the scheduler will be added, but one can add more by specifying them in `CalcInfo.retrieve_list`.
    irreducible_representations false Dict Irreducible representation output.
    modulation false Dict Modulation information.
    output_force_constants false ArrayData Calculated force constants.
    output_parameters false Dict Sum up info of phonopy calculation.
    phonon_bands false BandsData Calculated phonon band structure.
    projected_phonon_dos false XyData Calculated projected DOS.
    qpoints false BandsData Calculated qpoints.
    qpoints_mesh false BandsData Calculated qpoint mesh.
    remote_stash false RemoteStashData Contents of the `stash.source_list` option are stored in this remote folder after job completion.
    thermal_displacement_matrices false Dict Calculated thermal displacements matrices.
    thermal_displacements false Dict Calculated thermal displacements.
    thermal_properties false XyData Calculated thermal properties.
    total_phonon_dos false XyData Calculated total DOS.
    Exit statusMessage
    1 The process has failed with an unspecified error.
    2 The process failed with legacy failure mode.
    10 The process returned an invalid output.
    11 The process did not register a required output.
    100 The process did not have the required `retrieved` output.
    110 The job ran out of memory.
    120 The job ran out of walltime.
    131 The specified account is invalid.
    140 The node running the job failed.
    150 {message}
    160 {message}
    301 The retrieved temporary folder could not be accessed.
    302 The retrieved folder did not contain the required stdout output file.
    303 The retrieved folder did not contain the required phonopy file.
    304 The retrieved folder did not contain one or more expected output files.
    305 No run mode has been selected.
    310 The stdout output file could not be read.
    311 The stdout output file could not be parsed.
    312 The stdout output file was incomplete probably because the calculation got interrupted.
    320 The loading of yaml file got an unexpected error.
    321 The file loading via numpy got an unexpected error.
    350 The parser raised an unexpected exception.
    400 The parser was not able to parse one or more files.
Data node types aiida.data
  • phonopy.force_constants

    aiida_phonopy.data.force_constants:ForceConstantsData
  • phonopy.phonopy

    aiida_phonopy.data.phonopy:PhonopyData
  • phonopy.preprocess

    aiida_phonopy.data.preprocess:PreProcessData
  • phonopy.raw

    aiida_phonopy.data.raw:RawData
CalcJob parsers aiida.parsers
  • phonopy.phonopy

    aiida_phonopy.parsers.phonopy:PhonopyParser
WorkChains and work functions aiida.workflows
  • phonopy.ase

    class: aiida_phonopy.workflows.ase:PhonopyAseWorkChain

    Workflow for automated frozen phonons calculations using Phonopy and any ASE calculator. Phonopy is used to produce structures with displacements, while the forces are calculated with any calculator that can be interfaced with ASE. The submission of the calculation using ASE are handled via aiida-pythonjob.

    InputRequiredValid typesDescription
    pythonjob true Data
    settings true Settings for how to run the workflow.
    clean_workdir false Bool If `True`, work directories of all called calculation will be cleaned at the end of execution.
    displacement_generator false Dict, NoneType Info for displacements generation. The following flags are allowed: distance is_plusminus is_diagonal is_trigonal number_of_snapshots random_seed temperature cutoff_frequency
    fc_options false Dict, NoneType Options for force constants calculation (optional). The following flags are allowed: calculate_full_force_constants fc_calculator fc_calculator_options
    is_symmetry false Bool, NoneType Whether using or not the space group symmetries.
    metadata false
    nac_parameters false ArrayData, NoneType Non-analytical parameters.
    phonopy false Data Inputs for the `PhonopyCalculation` that willbe used to calculate the inter-atomic force constants, or for post-processing.
    preprocess_data false PhonopyData, PreProcessData, NoneType The preprocess data for frozen phonon calcualtion.
    primitive_matrix false List, NoneType The matrix used to generate the primitive cell from the input structure in the List format. Allowed shapes are 3x1 and 3x3 lists.
    structure false StructureData, NoneType The structure at equilibrium volume.
    supercell_matrix false List, NoneType The matrix used to generate the supercell from the input structure in the List format. Allowed shapes are 3x1 and 3x3 lists.
    symmetry_tolerance false Float, NoneType Symmetry tolerance for space group analysis on the input structure.
    OutputRequiredValid typesDescription
    supercells_forces true ArrayData The forces acting on the atoms of each supercell.
    force_constants false ForceConstantsData The matrix of force constants computed with finite displacements.
    output_phonopy false
    phonopy_data false PhonopyData The phonopy data with supercells displacements, forces and (optionally)nac parameters to use in the post-processing calculation.
    supercells false StructureData The supercells with displacements.
    supercells_energies false Float The total energy of each supercell.
    Exit statusMessage
    1 The process has failed with an unspecified error.
    2 The process failed with legacy failure mode.
    10 The process returned an invalid output.
    11 The process did not register a required output.
    400 At least one sub processe did not finish successfully.
    401 The PhonopyCalculation did not finish successfully.
  • phonopy.phonopy

    class: aiida_phonopy.workflows.phonopy:PhonopyWorkChain

    Abstract workflow for automated frozen phonons. Phonopy is used to produce structures with displacements, while the forces are calculated with a quantum engine of choice. This workchain is meant to be used as a base for other specific force calculato plugin workchains, or as an example on how to set a possible workchain/workflow. For this reason, the outline of this class is not defined, while it provides the inputs and a `setup` method, which can be used in a specific workflow outline. Ideally, the workflow would look like: 1. Setup the preprocess data. This is already provided in this class. It setups a `PreProcessData` node, from where supercell, primitive cell and supercells with displacements can be easily extracted using the methods of the nodes. This node can be taken from `self.ctx.preprocess_data`, and used during the outline of the workflow. 2. Run supercells using the selected quantum engine/force calculator code. In specific code implementations, a force calculation on supercells needs to be run. To get these supercells, one need simply to run: ```self.ctx.preprocess_data.calcfunctions.get_supercells_with_displacements()``` This will return a dictionary with all the supercells as StructureData to run for the phonon calculation. The keys of this dictionary are of the type `supercell_{number}`, where `number` is an integer. These numbers are essentials since the `phonopy` force sets is generated following these numbers, in order to make sure to refer to the correct displacement. Thus, it is required to keep track of them. Moreover,a calculation over the pristine supercell structure should be run before hand as reference. This structure can instead be gotten via: ```self.ctx.preprocess_data.calcfunctions.get_supercell()``` This will return a StructureData without any label. For an example of implementation, refer to aiidateam/aiida-common-worfklows. * Note: some type of force calculation needs to map some variables from the unitcell to the supercell (and in certain case even the primitive cell), e.g. the atomic spin in VASP. Since this is code dependent, you will need to map these parameters before launching the force calculation of a certain supercell with displacement. This information can be gotten via: ```self.ctx.preprocess_data.get_cells_mappings()``` Moreover, consider that cells in phonopy will always (re)fold the atoms in order to have positive coordinates. 3. Inspect all runs and expose the forces and energies (not mandatory) outputs. * Suggested: when the calculation on each supercell has finished (correctly) expose the output forces (and energies) in the dynamical `supercells_forces(energies)` namespace(s). Provide each supercell forces as an `ArrayData` with the forces stored as `forces` (e.g. if your code plugin stores the forces in `TrajectoryData`, extract them with a `calcfunction`). Expose each `ArrayData` choosing a **common prefix**, while as **suffix use _{number}**, with `{number}` referring to the correspective supercell label suffix (that you are supposed to keep track somewhere, e.g. in the label of the code calculation/workchain). Now you can gather all the information in one data noe, i.e. in a `PhonopyData` node. To do so, you can simple run: ```self.ctx.preprocess_data.calcfunctions.generate_phonopy_data(**self.outputs.supercells_forces)``` and then expose it as output in the `output_phonopy_data` namespace. * Alternatively: instead of exposing the supercell forces as outputs, you can directly gather all the forces in a dictionary and run directly to the `generate_phonopy_data` method using this dictionary (always using the double *). See the implementation in aiidateam/aiida-common-workflows for an example. 4. (optional) Run the non-analytical constants on the primitive cell. Non-analytical constants should be run for polar insulators. These require usually a linear response code or a finite difference approach (e.g. using the electric enthalpy). Since this is usually the most expensive part, you should run them on the primitive cell. To get it, use: ```self.ctx.preprocess_data.calcfunctions.get_primitive_cell()``` If you compute also these, collect the dielectric tensor and the effectic born charges in an ArrayData, with the arraynames `dielectric` and `born_charges` (in Cartesian coordinates!). Then, gather all the information of nac and forces in a unique `PhonopyData` via: ``` self.ctx.preprocess_data.calcfunctions.generate_phonopy_data( nac_parameters=nac_paramters, **self.outputs.supercells_forces ) ``` and expose the output. * Note: we require in the input for generating the full phonopy data, to give the nac in the primitive cell. The primitive cell of phonopy will just rotate the lattice vectors, thus mantaining the Cartasian coordinate system. It can happen, though, that the unitcell is not the primitive cell of the system, meaning that the primitive cell will contain less atoms. We expect in input the nac computed on this number of atoms. If you want, for some reason, compute the nac on the unitcell, you will need to get the reduced nac. To do so, you can consider using a built-in function in phonopy, namely: :py:func:`phonopy.structure.symmetry.elaborate_borns_and_epsilon`

    InputRequiredValid typesDescription
    settings true Settings for how to run the workflow.
    clean_workdir false Bool If `True`, work directories of all called calculation will be cleaned at the end of execution.
    displacement_generator false Dict, NoneType Info for displacements generation. The following flags are allowed: distance is_plusminus is_diagonal is_trigonal number_of_snapshots random_seed temperature cutoff_frequency
    fc_options false Dict, NoneType Options for force constants calculation (optional). The following flags are allowed: calculate_full_force_constants fc_calculator fc_calculator_options
    is_symmetry false Bool, NoneType Whether using or not the space group symmetries.
    metadata false
    nac_parameters false ArrayData, NoneType Non-analytical parameters.
    phonopy false Data Inputs for the `PhonopyCalculation` that willbe used to calculate the inter-atomic force constants, or for post-processing.
    preprocess_data false PhonopyData, PreProcessData, NoneType The preprocess data for frozen phonon calcualtion.
    primitive_matrix false List, NoneType The matrix used to generate the primitive cell from the input structure in the List format. Allowed shapes are 3x1 and 3x3 lists.
    structure false StructureData, NoneType The structure at equilibrium volume.
    supercell_matrix false List, NoneType The matrix used to generate the supercell from the input structure in the List format. Allowed shapes are 3x1 and 3x3 lists.
    symmetry_tolerance false Float, NoneType Symmetry tolerance for space group analysis on the input structure.
    OutputRequiredValid typesDescription
    supercells_forces true ArrayData The forces acting on the atoms of each supercell.
    force_constants false ForceConstantsData The matrix of force constants computed with finite displacements.
    output_phonopy false
    phonopy_data false PhonopyData The phonopy data with supercells displacements, forces and (optionally)nac parameters to use in the post-processing calculation.
    supercells false StructureData The supercells with displacements.
    supercells_energies false Float The total energy of each supercell.
    Exit statusMessage
    1 The process has failed with an unspecified error.
    2 The process failed with legacy failure mode.
    10 The process returned an invalid output.
    11 The process did not register a required output.
    400 At least one sub processe did not finish successfully.
    401 The PhonopyCalculation did not finish successfully.