Cluster Setup

set_up_clusters_and_dft() generates all non-equivalent clusters with the supercell program, creates the folder structure and prepares the DFT input files. See Step 1 for a minimal call.

Output

This step produces:

  • All non-equivalent clusters
  • The directory structure S*/S*_i*_w*/, where S* denotes the number of substituted atoms, i* the consecutive cluster index and w* the degeneracy of the corresponding cluster. The i and w indices are generated by the supercell program; if the supercell program is called once per distribution of the substituted atoms (see Several Permutable Sites), i is renumbered continuously over all distributions of one S*. Each cluster folder holds its CIF file and, unless create_dft_folders=False (e.g. for an ML-only run), the three subfolders vc-relax/, bands/, and phonons/.
  • clusters_template.dat in out_dir, the folder that holds the S* folders: one row per cluster (ID, n_j, Nat, x, g_j) with the energy missing, and the compound, the number of sites and the number of permutable sites n in the header. Every route (DFT, ML, EDDP) reads its cluster setup from this file, so keep it when you delete a run folder. For a tree set up before this file existed, it is written once from DFT/clusters.dat, or from a scan of the cluster CIFs with n taken from the highest S* folder.
  • DFT/clusters.dat, a copy of the template that the DFT energies are filled into, only if create_dft_folders=True or one of qe_par, aims_par, vasp_par is given. DFT is the DFT run folder; it may be renamed. EGQCA takes the folder of its datafile as the run folder (volume.dat is read and written there) and looks up the cluster folders in datafile.parent.parent, so a run folder must sit directly in out_dir.
  • geometry.in and control.in for each cluster if aims_par is provided
  • vc-relax.in for each cluster if qe_par is provided
  • POSCAR, POTCAR, INCAR, and KPOINTS for each cluster if vasp_par is provided
  • There is also the option to create the input files for band-structure and phonon calculations for each cluster using create_bands_in() and create_phonons_in(). More details are provided in DFT Input Files.

Several Permutable Sites

If the unit cell has more than one permutable site, all configurations over these sites are created. How the atoms are permuted is set with substitution_mode:

  • "independent" substitutes each site independently, so every distribution of the substituted atoms over the sites is included.
  • "coupled" substitutes one unit on every original site at a time, e.g. (AB)→(CC), and falls back to all distributions if the sites have different multiplicities.
  • "auto" (default) uses "independent" if all original atoms are of the same element and "coupled" otherwise.

CIF Files Only

With cif_only=True the cluster CIF files are written flat into out_dir, together with logs/log.out; neither the folder structure nor clusters_template.dat nor any DFT input is created.

Updating DFT Inputs

update_DFT_in() rewrites the relaxation inputs of an existing folder tree with new parameters. It also works on a tree set up without DFT (e.g. for an ML-only run): it creates the vc-relax/, bands/ and phonons/ folders and the DFT run folder DFT/clusters.dat as a copy of clusters_template.dat, if that file does not exist yet. An existing clusters.dat is never changed. With dft_folder_name="DFT_PBE" the run file goes into another folder, e.g. for a second DFT setup or a renamed DFT folder.