lattice
Lattice energy: what it costs to take a crystal apart.
The energy of the crystal, less the energy of its molecules relaxed on their own, per molecule. Negative for anything that holds together.
result = lattice_energy(crystal, calculator)
print(result) # kJ/mol, with the decomposition
result.structure # the relaxed crystal
Both sides are relaxed by default, which is what makes the number comparable
with a sublimation enthalpy and with other calculations. Relaxing neither gives
the interaction energy of the structure as supplied, which is a different and
also useful quantity -- see relax.
The result separates two contributions that are often conflated:
E_lattice = E_interaction + E_strain
E_interaction is what the molecules gain by being packed together, measured
with each molecule held in the geometry it has in the crystal.
E_strain is what they pay to adopt that geometry rather than their relaxed
one, and it is positive by construction. A rigid molecule has none; a flexible
one can have tens of kJ/mol, and a lattice energy quoted without saying which
of the two it is can be out by that much.
LatticeEnergy
dataclass
A lattice energy and the parts it is made of.
Attributes:
| Name | Type | Description |
|---|---|---|
energy |
float
|
lattice energy per molecule, eV. Negative for a bound crystal. |
interaction |
float
|
the part from packing, with molecules held at their crystal geometry, eV per molecule |
strain |
float
|
the part paid to adopt the crystal conformation, eV per molecule, positive by construction |
crystal_energy |
float
|
total energy of the relaxed unit cell, eV |
molecule_energies |
list
|
relaxed gas-phase energy of each unique molecule, eV |
frozen_energies |
list
|
energy of each unique molecule at its crystal geometry, eV |
multiplicities |
list
|
how many of each unique molecule the cell holds |
z |
int
|
molecules per unit cell |
z_prime |
int
|
symmetry-unique molecules per cell |
structure |
object
|
the relaxed crystal |
molecules |
list
|
the relaxed gas-phase molecules |
converged |
bool
|
whether every relaxation reached its tolerance. False means the energies are those of structures still on their way downhill, and the difference between two of those is not a lattice energy. |
unconverged |
list
|
which relaxations fell short, as readable names |
evaluations |
int
|
calculator evaluations used |
Source code in chmpy/opt/lattice.py
kj_per_mol
property
Lattice energy per molecule in kJ/mol, the usual unit for it
lattice_energy(crystal, calculator, *, relax_crystal=True, relax_molecules=True, box=None, info=None, fmax=0.01, smax=0.05, steps=300, progress=None, **kwargs)
The lattice energy of a molecular crystal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
crystal
|
a |
required | |
calculator
|
a |
required | |
relax_crystal
|
bool
|
relax the crystal before taking its energy. With this off the crystal is used as supplied, which is what you want when comparing a set of structures at fixed geometry. |
True
|
relax_molecules
|
bool
|
relax each unique molecule in the gas phase. With this off the result is the interaction energy and the strain is zero. |
True
|
box
|
float | None
|
put each isolated molecule in a cubic cell of this size in Angstroms, for models that require a periodic system. The default leaves them genuinely isolated. |
None
|
info
|
model inputs that are not geometry, e.g. a charge or a spin |
None
|
|
fmax
|
float
|
force convergence, eV/A |
0.01
|
smax
|
float
|
stress convergence for the crystal, GPa |
0.05
|
steps
|
int
|
iteration cap for each relaxation |
300
|
progress
|
True to print progress, or a callable given a
|
None
|
|
**kwargs
|
passed to |
{}
|
Returns:
| Type | Description |
|---|---|
LatticeEnergy
|
LatticeEnergy |
Source code in chmpy/opt/lattice.py
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 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |