prep
Utility functions for dealing with Atoms.
prep_next_run ¶
Prepares the Atoms object for a new run by stripping off the calculator and assigning a unique ID.
Parameters:
-
atoms
(Atoms
) –Atoms object
-
move_magmoms
(bool
, default:False
) –Whether to move the magnetic moments from the calculator results to the initial magnetic moments.
Returns:
-
Atoms
–Updated Atoms object.
Source code in quacc/schemas/prep.py
set_magmoms ¶
set_magmoms(
atoms: Atoms,
elemental_mags_dict: dict[str, float] | None = None,
elemental_mags_default: float = 1.0,
copy_magmoms: bool = True,
mag_cutoff: float | None = 0.05,
) -> Atoms
Sets the initial magnetic moments in the Atoms object.
This function deserves particular attention. The following logic is applied: - If there is a converged set of magnetic moments, those are moved to the initial magmoms if copy_magmoms is True. - If there is no converged set of magnetic moments but the user has set initial magmoms, those are simply used as is. - If there are no converged magnetic moments or initial magnetic moments, then the default magnetic moments from the preset elemental_mags_dict (if specified) are set as the initial magnetic moments. - For any of the above scenarios, if mag_cutoff is not None, the newly set initial magnetic moments are checked. If all have a magnitude below mag_cutoff, then they are all set to 0 (no spin polarization).
Parameters:
-
atoms
(Atoms
) –Atoms object
-
elemental_mags_dict
(dict[str, float] | None
, default:None
) –Dictionary of elemental symbols and their corresponding magnetic moments to set. If None, no default values will be used.
-
elemental_mags_default
(float
, default:1.0
) –Default magnetic moment on an element if no magnetic moment is specified in the elemental_mags_dict. Only used if elemental_mags_dict is not None. This kwarg is mainly a convenience so that you don't need to list every single element in the elemental_mags_dict.
-
copy_magmoms
(bool
, default:True
) –Whether to copy the magnetic moments from the converged set of magnetic moments to the initial magnetic moments.
-
mag_cutoff
(float | None
, default:0.05
) –Magnitude below which the magnetic moments are considered to be zero. If None, no cutoff will be applied
Returns:
-
Atoms
–Atoms object
Source code in quacc/schemas/prep.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|