aiida-phonopy
The official AiiDA plugin for Phonopy
General information
Registry checks
Plugins provided
Entry points
-
phonopy.phonopy
class:aiida_phonopy.calculations.phonopy:PhonopyCalculationBase `CalcJob` implementation for Phonopy post-processing.
Input Required Valid types Description parameterstrue DictPhonopy 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 codefalse AbstractCode, NoneTypeThe `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_constantsfalse ForceConstantsData, NoneTypeForce constants of the input structure. metadatafalse monitorsfalse DictAdd monitoring functions that can inspect output files while the job is running and decide to prematurely terminate the job. phonopy_datafalse PhonopyData, NoneTypeThe preprocess output info of a previous ForceConstantsWorkChain. remote_folderfalse RemoteData, NoneTypeRemote 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. settingsfalse Dict, NoneTypeSettings for phonopy calculation. Output Required Valid types Description remote_foldertrue RemoteDataInput files necessary to run the process will be stored in this folder node. retrievedtrue FolderDataFiles 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_representationsfalse DictIrreducible representation output. modulationfalse DictModulation information. output_force_constantsfalse ArrayDataCalculated force constants. output_parametersfalse DictSum up info of phonopy calculation. phonon_bandsfalse BandsDataCalculated phonon band structure. projected_phonon_dosfalse XyDataCalculated projected DOS. qpointsfalse BandsDataCalculated qpoints. qpoints_meshfalse BandsDataCalculated qpoint mesh. remote_stashfalse RemoteStashDataContents of the `stash.source_list` option are stored in this remote folder after job completion. thermal_displacement_matricesfalse DictCalculated thermal displacements matrices. thermal_displacementsfalse DictCalculated thermal displacements. thermal_propertiesfalse XyDataCalculated thermal properties. total_phonon_dosfalse XyDataCalculated total DOS. Exit status Message 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.
-
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
-
phonopy.phonopy
aiida_phonopy.parsers.phonopy:PhonopyParser
-
phonopy.ase
class:aiida_phonopy.workflows.ase:PhonopyAseWorkChainWorkflow 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.
Input Required Valid types Description pythonjobtrue Datasettingstrue Settings for how to run the workflow. clean_workdirfalse BoolIf `True`, work directories of all called calculation will be cleaned at the end of execution. displacement_generatorfalse Dict, NoneTypeInfo for displacements generation. The following flags are allowed: distance is_plusminus is_diagonal is_trigonal number_of_snapshots random_seed temperature cutoff_frequency fc_optionsfalse Dict, NoneTypeOptions for force constants calculation (optional). The following flags are allowed: calculate_full_force_constants fc_calculator fc_calculator_options is_symmetryfalse Bool, NoneTypeWhether using or not the space group symmetries. metadatafalse nac_parametersfalse ArrayData, NoneTypeNon-analytical parameters. phonopyfalse DataInputs for the `PhonopyCalculation` that willbe used to calculate the inter-atomic force constants, or for post-processing. preprocess_datafalse PhonopyData, PreProcessData, NoneTypeThe preprocess data for frozen phonon calcualtion. primitive_matrixfalse List, NoneTypeThe matrix used to generate the primitive cell from the input structure in the List format. Allowed shapes are 3x1 and 3x3 lists. structurefalse StructureData, NoneTypeThe structure at equilibrium volume. supercell_matrixfalse List, NoneTypeThe matrix used to generate the supercell from the input structure in the List format. Allowed shapes are 3x1 and 3x3 lists. symmetry_tolerancefalse Float, NoneTypeSymmetry tolerance for space group analysis on the input structure. Output Required Valid types Description supercells_forcestrue ArrayDataThe forces acting on the atoms of each supercell. force_constantsfalse ForceConstantsDataThe matrix of force constants computed with finite displacements. output_phonopyfalse phonopy_datafalse PhonopyDataThe phonopy data with supercells displacements, forces and (optionally)nac parameters to use in the post-processing calculation. supercellsfalse StructureDataThe supercells with displacements. supercells_energiesfalse FloatThe total energy of each supercell. Exit status Message 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:PhonopyWorkChainAbstract 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`
Input Required Valid types Description settingstrue Settings for how to run the workflow. clean_workdirfalse BoolIf `True`, work directories of all called calculation will be cleaned at the end of execution. displacement_generatorfalse Dict, NoneTypeInfo for displacements generation. The following flags are allowed: distance is_plusminus is_diagonal is_trigonal number_of_snapshots random_seed temperature cutoff_frequency fc_optionsfalse Dict, NoneTypeOptions for force constants calculation (optional). The following flags are allowed: calculate_full_force_constants fc_calculator fc_calculator_options is_symmetryfalse Bool, NoneTypeWhether using or not the space group symmetries. metadatafalse nac_parametersfalse ArrayData, NoneTypeNon-analytical parameters. phonopyfalse DataInputs for the `PhonopyCalculation` that willbe used to calculate the inter-atomic force constants, or for post-processing. preprocess_datafalse PhonopyData, PreProcessData, NoneTypeThe preprocess data for frozen phonon calcualtion. primitive_matrixfalse List, NoneTypeThe matrix used to generate the primitive cell from the input structure in the List format. Allowed shapes are 3x1 and 3x3 lists. structurefalse StructureData, NoneTypeThe structure at equilibrium volume. supercell_matrixfalse List, NoneTypeThe matrix used to generate the supercell from the input structure in the List format. Allowed shapes are 3x1 and 3x3 lists. symmetry_tolerancefalse Float, NoneTypeSymmetry tolerance for space group analysis on the input structure. Output Required Valid types Description supercells_forcestrue ArrayDataThe forces acting on the atoms of each supercell. force_constantsfalse ForceConstantsDataThe matrix of force constants computed with finite displacements. output_phonopyfalse phonopy_datafalse PhonopyDataThe phonopy data with supercells displacements, forces and (optionally)nac parameters to use in the post-processing calculation. supercellsfalse StructureDataThe supercells with displacements. supercells_energiesfalse FloatThe total energy of each supercell. Exit status Message 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.