Skip to content

Schema for Phonon calculation

The schema to configure the input file for phonon calculation.

Schema:

### Schema for Phonon calculation workflow using ALFF
### IMPORTANT: Do not use a structure with `triangular cell` in phononpy, because it cannot generate right k-path. Must transform ford and back between triangular and parallelepiped cell.

stages:                    ### ANCHOR: Define stages to run
  type: list
  required: True
  allowed:
    - make_structure              # build the atomic structures
    - relax_initial_structure     # relax initial structures
    - scale_and_relax             # scale and relax the structures. This step is just for further development (experimental), to compute phonons at different volumes by scaling the initial structure.
    - compute_force               # compute the force
    - compute_phonon              # post_process by phonopy



structure:                  ### ANCHOR: Define atomic structure
  type: dict
  required: True
  schema:
    from_extxyz:            # list-of-paths to the EXTXYZ files to be used as the initial structure. If provided, the structure will be read from the file, and the other structure parameters will be ignored.
      type: list

    from_scratch:           # build the structure from scratch. See [Schema for building structure](https://thangckt.github.io/alff_doc/schema/manual_schema_ase_build/)
      type: dict

    use_supercell_size:     # replicate structures with the size of supercell. This is useful to avoid the PBC effect when using classical forcefields. Default: False
      type: boolean
      default: False



calculator:                 # choices: 'lammps', 'gpaw', 'ase'. Calculator to calculate atomic forces. Default: 'lammps'
  type: string
  allowed: ['lammps', 'gpaw', 'ase']
  default: 'lammps'



calc_args:                  ### SECTION Parameters of calculators
  type: dict
  required: True
  schema:
    gpaw:                   ### ANCHOR: GPAW calculator. Accept all GPAW parameters: https://gpaw.readthedocs.io/documentation/basic.html
      type: dict            ### Accept all parameters as in [ASE schema](https://thangckt.github.io/alff_doc/schema/config_ase/) `calc_args.gpaw`, and additional perameters as below
      allow_unknown: True

    dftd3:                  ### ANCHOR: DFT-D3 calculator for Van der Waals correction
      type: dict
      schema:
        damping:            # use DFT-D3 damping. Default is "d3zero" (zero-damping). Choices: "d3bj","d3zero","d3bjm","d3zerom","d3op".
          type: string

                            ### ANCHOR: Define ASE's calculator by two ways: using 'pyfile' or 'pyscript'.
    py_file:                # python file that defines ASE's calculator. Python script must return the variable `calc`.
      type: string

    py_script:              # list[str] of python-code to directly define ASE's calculator. Python script must return the variable `calc`. Example:
      type: list

    lammps:                 ### ANCHOR: LAMMPS parameters
      type: dict
      schema:
        pair_style:         # list of LAMMPS pair_style. e.g., ["tersoff"]
          type: list
        pair_coeff:         # list of LAMMPS pair_coeff. Must use form "../potential_file" to use potential files in parent dir. E.g., ["* * ../SiC.tersoff C Si"].
          type: list
        auto_pair_coeff:    # This option to generate `pair_coeff` automatically if `pair_coeff` is not provided. Then, pair_coeff will be generate in this form ["* * ../file_potential1 Si C", "* * ../file_potential2 O H"]. Default is False.
          type: boolean
          default: False
        file_potentials:    # list of potential files (relative to run_dir). E.g., ["SiC.tersoff"]
          type: list



optimize:                   ### ANCHOR: Parameters to run optimization the structure
  type: dict
  schema:
    gpaw_opt:               # GPAW optimization parameters.
      type: dict
      allow_unknown: True
      schema:
        fmax:               # force convergence criteria. Default is 0.05 eV/Ang
          type: float
          default: 0.05
        max_steps:          # maximum number of optimization steps. Default is 10000
          type: integer
          default: 10000
        # all other parameters as in ASE schema.optimize https://thangckt.github.io/alff_doc/schema/manual_schema_ase_run/#schema

    lammps_opt:             ### LAMMPS optimization parameters.
      type: dict
      allow_unknown: True
      schema:
        min_style:          # minimization style supported by LAMMPS. Choices: 'cg', 'sd', 'fire',... Default is 'cg'
          type: string
        etol:               # energy convergence criteria. Default is 1.0e-9 eV
          type: float
        ftol:               # force convergence criteria. Default is 1.0e-9 eV/Ang
          type: float
        # all other parameters as in LAMMPS schema.optimize https://thangckt.github.io/alff_doc/schema/manual_schema_lammps/



phonon:                     ### ANCHOR: phonon calculation
  type: dict
  schema:
    supercell_matrix:       # 1x3 array, e.g., [2, 2, 2]. The supercell matrix
      type: list
      required: True
    displacement:           # small displacement in Angstrom, e.g., 0.03. The displacement is used to generate the supercells with displacements.
      type: float
      required: True
    phonopy_arg:            # Accept all the phonopy parameters
      type: dict
          # Example:
            # is_symmetry: True            # use symmetry
            # symprec: 1e-5                # symmetry precision
            # nac: False                   # non-analytical correction

    compute:                # properties to compute from the phonon calculation
      type: dict
      required: True
      schema:
        mesh:               # Set sampling mesh (set_mesh) in reciprocal space, e.g., [20, 20, 20].
          type: list
        band_structure:     # phonon band structure
          type: dict
          schema:
            path_str:       # k-path for band structure. Choices: 'custom_string', 'auto', None. If not set (None), k-path is genrated using `ase`. If set 'auto', k-path is generated using `seekpath`.
              type: string
              default: 'auto'  # 'GXU,KGLWX' or 'auto' or None
              allowed: ['custom_string', 'auto', None]
            npoints:        # number of k-points
              type: integer
              default: 50
        dos:                # phonon density of states
          type: boolean
        pdos:               # phonon projected density of states
          type: boolean
        thermal_properties: # phonon thermal properties
          type: dict
          schema:
            t_min:          # minimum temperature
              type: float
            t_max:          # maximum temperature
              type: float
            t_step:         # temperature step
              type: float

Example config 1:

### Example configuration file for phonon calculation using GPAW

stages:
  - make_structure              # build initial atomic structures
  - relax_initial_structure     # relax initial structures
  - scale_and_relax             # scale and relax the structures.
  - compute_force               # compute the force
  - compute_phonon              # post_process by phonopy


structure:  # atomic structure information
  from_scratch:                 # build the structure from scratch
    structure_type: "bulk"      # bulk, molecule, surface,
    chem_formula: "Si"          # chemical formula/element. e.g., "H2O", "Mg2O2", "Mg",
    pbc: [1, 1, 1]
    ase_build_arg:
      crystalstructure: "diamond"
      a: 5.43


calculator: "gpaw"        # choices: 'lammps', 'gpaw'. Calculator to calculate atomic forces. Default: 'lammps'


calc_args:
  gpaw:               # accept GPAW parameters
    mode:
      name: 'pw'          # use PlaneWave method energy cutoff in eV
      ecut: 500
    xc: "PBE"             # exchange-correlation functional
    kpts: {"density": 6, "gamma": False}  # if not set `kpts`, then only Gamma-point is used


optimize:                     # parameter to minimize the structure by MD (relax_type: 'min')
  gpaw_opt:               # parameter to optimize the structure by DFT/MS (relax_type: 'opt')
    fmax: 0.02            # force convergence criteria


phonon:                       # phonon calculation
  supercell_matrix: [4, 4, 4]   # 1x3 array
  displacement: 0.03            # small displacement in Angstrom
  phonopy_arg:                  # Accept all the phonopy parameters
    is_symmetry: True           # use symmetry
    symprec: 1.0e-3             # symmetry precision
  #   nac: False                # non-analytical correction

  compute:                      # properties need to compute from the phonon calculation
    mesh: [20, 20, 20]          # Set sampling mesh (set_mesh) in reciprocal space
    band_structure:             # phonon band structure
      path_str: 'auto'          # 'GXU,KGLWX' or 'auto' or None   # k-path for band structure. Choices: input_str, 'auto', None. If not set (None), k-path is genrated using `ase`. If set 'auto', k-path is generated using `seekpath`.
      npoints: 50               # number of k-points
    dos: True                   # phonon density of states
    pdos: True                  # phonon projected density of states
    thermal_properties:         # phonon thermal properties
      t_min: 0.0                # minimum temperature
      t_max: 1000.0             # maximum temperature
      t_step: 10.0              # temperature step

Example config 2:

### Example configuration file for phonon calculation using LAMMPS

stages:
  - make_structure              # build initial atomic structures
  - relax_initial_structure     # relax initial structures
  - scale_and_relax             # scale and relax the structures.
  - compute_force               # compute the force
  - compute_phonon              # post_process by phonopy


structure:  # atomic structure information
  from_scratch:                 # build the structure from scratch
    structure_type: "bulk"      # bulk, molecule, surface,
    chem_formula: "Si"          # chemical formula/element. e.g., "H2O", "Mg2O2", "Mg",
    pbc: [1, 1, 1]
    ase_build_arg:
      crystalstructure: "diamond"
      a: 5.43
  # use_supercell_size: True


calculator: "lammps"            # choices: 'lammps', 'gpaw'. Calculator to calculate atomic forces. Default: 'lammps'


calc_args:
  lammps:                       # accept LAMMPS parameters
    pair_style: ["tersoff"]     # LAMMPS pair_style
    # pair_coeff: ["* * ../SiC.tersoff Si C"]  # LAMMPS pair_coeff
    auto_pair_coeff: True  # generate `pair_coeff` automatically if not provided.
    file_potentials: ["SiC.tersoff"]  # path to the potential file


optimize:                     # parameter to minimize the structure by MD (relax_type: 'min')
  lammps_opt:                   # LAMMPS optimization parameters.
    ftol: 1.0e-12               # force convergence criteria
    etol: 0                     # energy convergence criteria
    # dmax: 0.001               # maximum distance for line search to move (distance units). Default: 0.01


phonon:                       # phonon calculation
  supercell_matrix: [4, 4, 4]   # 1x3 array
  displacement: 0.03            # small displacement in Angstrom
  phonopy_arg:                  # Accept all the phonopy parameters
    is_symmetry: True           # use symmetry
    symprec: 1.0e-3             # symmetry precision
  #   nac: False                # non-analytical correction

  compute:                      # properties need to compute from the phonon calculation
    mesh: [20, 20, 20]          # Set sampling mesh (set_mesh) in reciprocal space
    band_structure:             # phonon band structure
      path_str: 'auto'          # 'GXU,KGLWX' or 'auto' or None   # k-path for band structure. Choices: input_str, 'auto', None. If not set (None), k-path is genrated using `ase`. If set 'auto', k-path is generated using `seekpath`.
      npoints: 50               # number of k-points
    dos: True                   # phonon density of states
    pdos: True                  # phonon projected density of states
    thermal_properties:         # phonon thermal properties
      t_min: 0.0                # minimum temperature
      t_max: 1000.0             # maximum temperature
      t_step: 10.0              # temperature step