SIRIUS 7.5.0
Electronic structure library and applications
energy.hpp
Go to the documentation of this file.
1// Copyright (c) 2013-2020 Anton Kozhevnikov, Thomas Schulthess
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without modification, are permitted provided that
5// the following conditions are met:
6//
7// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
8// following disclaimer.
9// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
10// and the following disclaimer in the documentation and/or other materials provided with the distribution.
11//
12// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
13// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
14// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
15// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
16// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
17// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
18// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19
20/** \file energy.hpp
21 *
22 * \brief Total energy terms.
23 */
24
25#ifndef __ENERGY_HPP__
26#define __ENERGY_HPP__
27
28#include "density/density.hpp"
31
32namespace sirius {
33
34/// Compute the ion-ion electrostatic energy using Ewald method.
35/** The following contribution (per unit cell) to the total energy has to be computed:
36 * \f[
37 * E^{ion-ion} = \frac{1}{N} \frac{1}{2} \sum_{i \neq j} \frac{Z_i Z_j}{|{\bf r}_i - {\bf r}_j|} =
38 * \frac{1}{2} \sideset{}{'} \sum_{\alpha \beta {\bf T}} \frac{Z_{\alpha} Z_{\beta}}{|{\bf r}_{\alpha} -
39 * {\bf r}_{\beta} + {\bf T}|}
40 * \f]
41 * where \f$ N \f$ is the number of unit cells in the crystal.
42 * Following the idea of Ewald the Coulomb interaction is split into two terms:
43 * \f[
44 * \frac{1}{|{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|} =
45 * \frac{{\rm erf}(\sqrt{\lambda} |{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|)}{|{\bf r}_{\alpha} -
46 * {\bf r}_{\beta} + {\bf T}|} +
47 * \frac{{\rm erfc}(\sqrt{\lambda} |{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|)}{|{\bf r}_{\alpha} -
48 * {\bf r}_{\beta} + {\bf T}|}
49 * \f]
50 * Second term is computed directly. First term is computed in the reciprocal space. Remembering that
51 * \f[
52 * \frac{1}{\Omega} \sum_{\bf G} e^{i{\bf Gr}} = \sum_{\bf T} \delta({\bf r - T})
53 * \f]
54 * we rewrite the first term as
55 * \f[
56 * \frac{1}{2} \sideset{}{'} \sum_{\alpha \beta {\bf T}} Z_{\alpha} Z_{\beta}
57 * \frac{{\rm erf}(\sqrt{\lambda} |{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|)}{|{\bf r}_{\alpha} -
58 * {\bf r}_{\beta} + {\bf T}|} = \frac{1}{2} \sum_{\alpha \beta {\bf T}} Z_{\alpha} Z_{\beta}
59 * \frac{{\rm erf}(\sqrt{\lambda} |{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|)}
60 * {|{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|} -
61 * \frac{1}{2} \sum_{\alpha} Z_{\alpha}^2 2 \sqrt{\frac{\lambda}{\pi}} = \\
62 * \frac{1}{2} \sum_{\alpha \beta} Z_{\alpha} Z_{\beta} \frac{1}{\Omega} \sum_{\bf G} \int e^{i{\bf Gr}}
63 * \frac{{\rm erf}(\sqrt{\lambda} |{\bf r}_{\alpha\beta} + {\bf r}|)}{|{\bf r}_{\alpha\beta} + {\bf r}|}
64 * d{\bf r} - \sum_{\alpha} Z_{\alpha}^2 \sqrt{\frac{\lambda}{\pi}}
65 * \f]
66 * The integral is computed using the \f$ \ell=0 \f$ term of the spherical expansion of the plane-wave:
67 * \f[
68 * \int e^{i{\bf Gr}} \frac{{\rm erf}(\sqrt{\lambda} |{\bf r}_{\alpha\beta} + {\bf r}|)}{|{\bf r}_{\alpha\beta} +
69 * {\bf r}|} d{\bf r} =
70 * \int e^{-i{\bf r}_{\alpha \beta}{\bf G}} e^{i{\bf Gr}} \frac{{\rm erf}(\sqrt{\lambda} |{\bf r}|)}{|{\bf r}|}
71 * d{\bf r} = e^{-i{\bf r}_{\alpha \beta}{\bf G}} 4 \pi \int_0^{\infty} \frac{\sin({G r})}{G}
72 * {\rm erf}(\sqrt{\lambda} r ) dr
73 * \f]
74 * We will split integral in two parts:
75 * \f[
76 * \int_0^{\infty} \sin({G r}) {\rm erf}(\sqrt{\lambda} r ) dr = \int_0^{b} \sin({G r})
77 * {\rm erf}(\sqrt{\lambda} r ) dr +
78 * \int_b^{\infty} \sin({G r}) dr = \frac{1}{G} e^{-\frac{G^2}{4 \lambda}}
79 * \f]
80 * where \f$ b \f$ is sufficiently large. To reproduce in Mathrmatica:
81 \verbatim
82 Limit[Limit[
83 Integrate[Sin[g*x]*Erf[Sqrt[nu] * x], {x, 0, b},
84 Assumptions -> {nu > 0, g >= 0, b > 0}] +
85 Integrate[Sin[g*(x + I*a)], {x, b, \[Infinity]},
86 Assumptions -> {a > 0, nu > 0, g >= 0, b > 0}], a -> 0],
87 b -> \[Infinity], Assumptions -> {nu > 0, g >= 0}]
88 \endverbatim
89 * The first term of the Ewald sum thus becomes:
90 * \f[
91 * \frac{2 \pi}{\Omega} \sum_{{\bf G}} \frac{e^{-\frac{G^2}{4 \lambda}}}{G^2} \Big| \sum_{\alpha} Z_{\alpha}
92 * e^{-i{\bf r}_{\alpha}{\bf G}} \Big|^2 - \sum_{\alpha} Z_{\alpha}^2 \sqrt{\frac{\lambda}{\pi}}
93 * \f]
94 * For \f$ G=0 \f$ the following is done:
95 * \f[
96 * \frac{e^{-\frac{G^2}{4 \lambda}}}{G^2} \approx \frac{1}{G^2}-\frac{1}{4 \lambda }
97 * \f]
98 * The term \f$ \frac{1}{G^2} \f$ is compensated together with the corresponding Hartree terms in electron-electron
99 * and electron-ion interactions (cell should be neutral) and we are left with the following conribution:
100 * \f[
101 * -\frac{2\pi}{\Omega}\frac{N_{el}^2}{4 \lambda}
102 * \f]
103 * Final expression for the Ewald energy:
104 * \f[
105 * E^{ion-ion} = \frac{1}{2} \sideset{}{'} \sum_{\alpha \beta {\bf T}} Z_{\alpha} Z_{\beta}
106 * \frac{{\rm erfc}(\sqrt{\lambda} |{\bf r}_{\alpha} - {\bf r}_{\beta} + {\bf T}|)}{|{\bf r}_{\alpha} -
107 * {\bf r}_{\beta} + {\bf T}|} + \frac{2 \pi}{\Omega} \sum_{{\bf G}\neq 0}
108 * \frac{e^{-\frac{G^2}{4 \lambda}}}{G^2} \Big| \sum_{\alpha} Z_{\alpha} e^{-i{\bf r}_{\alpha}{\bf G}}
109 * \Big|^2 - \sum_{\alpha} Z_{\alpha}^2 \sqrt{\frac{\lambda}{\pi}} - \frac{2\pi}{\Omega}
110 * \frac{N_{el}^2}{4 \lambda}
111 * \f]
112 */
113double ewald_energy(const Simulation_context& ctx, const fft::Gvec& gvec, const Unit_cell& unit_cell);
114
115/// Returns exchange correlation potential.
116double energy_vxc(Density const& density, Potential const& potential);
117
118/// Returns exchange correlation energy.
119double energy_exc(Density const& density, Potential const& potential);
120
121/// Returns Hatree potential.
122double energy_vha(Potential const& potential);
123
124/// TODO doc
125double energy_bxc(const Density& density, const Potential& potential);
126
127/// Return nucleus energy in the electrostatic field.
128/** Compute energy of nucleus in the electrostatic potential generated by the total (electrons + nuclei)
129j* charge density. Diverging self-interaction term z*z/|r=0| is excluded. */
130double energy_enuc(Simulation_context const& ctx, Potential const& potential);
131
132/// TODO doc
133double energy_vloc(Density const& density, Potential const& potential);
134
135/// Return eigen-value sum of core states.
136double core_eval_sum(Unit_cell const& unit_cell);
137
138/// TODO doc
139double valence_eval_sum(K_point_set const& kset);
140
141/// TODO doc
142double eval_sum(Unit_cell const& unit_cell, K_point_set const& kset);
143
144/// TODO doc
145double energy_veff(Density const& density, Potential const& potential);
146
147/// Return kinetic energy
148double energy_kin(Simulation_context const& ctx, K_point_set const& kset, Density const& density,
149 Potential const& potential);
150
151double energy_potential(Density const& density, Potential const& potential);
152
153/// Total energy of the electronic subsystem.
154/** <b> Full potential total energy </b>
155 *
156 * From the definition of the density functional we have:
157 * \f[
158 * E[\rho] = T[\rho] + E^{H}[\rho] + E^{XC}[\rho] + E^{ext}[\rho]
159 * \f]
160 * where \f$ T[\rho] \f$ is the kinetic energy, \f$ E^{H}[\rho] \f$ - electrostatic energy of
161 * electron-electron density interaction, \f$ E^{XC}[\rho] \f$ - exchange-correlation energy
162 * and \f$ E^{ext}[\rho] \f$ - energy in the external field of nuclei.
163 *
164 * Electrostatic and external field energies are grouped in the following way:
165 * \f[
166 * \frac{1}{2} \int \int \frac{\rho({\bf r})\rho({\bf r'}) d{\bf r} d{\bf r'}}{|{\bf r} - {\bf r'}|} +
167 * \int \rho({\bf r}) V^{nuc}({\bf r}) d{\bf r} = \frac{1}{2} \int V^{H}({\bf r})\rho({\bf r})d{\bf r} +
168 * \frac{1}{2} \int \rho({\bf r}) V^{nuc}({\bf r}) d{\bf r}
169 * \f]
170 * Here \f$ V^{H}({\bf r}) \f$ is the total (electron + nuclei) electrostatic potential returned by the
171 * poisson solver. Next we transform the remaining term:
172 * \f[
173 * \frac{1}{2} \int \rho({\bf r}) V^{nuc}({\bf r}) d{\bf r} =
174 * \frac{1}{2} \int \int \frac{\rho({\bf r})\rho^{nuc}({\bf r'}) d{\bf r} d{\bf r'}}{|{\bf r} - {\bf r'}|} =
175 * \frac{1}{2} \int V^{H,el}({\bf r}) \rho^{nuc}({\bf r}) d{\bf r}
176 * \f]
177 *
178 * <b> Pseudopotential total energy </b>
179 *
180 * Total energy in PW-PP method has the following expression:
181 * \f[
182 * E_{tot} = \sum_{i} f_i \sum_{\sigma \sigma'} \langle \psi_i^{\sigma'} | \Big( \hat T + \sum_{\xi \xi'}
183 * |\beta_{\xi} \rangle D_{\xi \xi'}^{ion} \delta_{\sigma \sigma'} \langle \beta_{\xi'} |\Big) | \psi_i^{\sigma}
184 * \rangle + \int V^{ion}({\bf r})\rho({\bf r})d{\bf r} + \frac{1}{2} \int V^{H}({\bf r})\rho({\bf r})d{\bf r} +
185 * E^{XC}[\rho + \rho_{core}, |{\bf m}|]
186 * \f]
187 * Ionic contribution to the non-local part of pseudopotential is diagonal in spin. The following rearrangement
188 * is performed next:
189 * \f[
190 * \int \rho({\bf r}) \Big( V^{ion}({\bf r}) + \frac{1}{2} V^{H}({\bf r}) \Big) d{\bf r} = \\
191 * \int \rho({\bf r}) \Big( V^{ion}({\bf r}) + V^{H}({\bf r}) + V^{XC}({\bf r}) \Big) d{\bf r} +
192 * \int {\bf m}({\bf r}) {\bf B}^{XC}({\bf r}) d{\bf r} -
193 * \frac{1}{2} \int V^{H}({\bf r})\rho({\bf r})d{\bf r} - \int V^{XC}({\bf r})\rho({\bf r})d{\bf r} -
194 * \int {\bf m}({\bf r}) {\bf B}^{XC}({\bf r}) d{\bf r} = \\
195 * \sum_{\sigma \sigma'}\int \rho_{\sigma \sigma'}({\bf r}) V_{\sigma' \sigma}^{eff}({\bf r}) d{\bf r} -
196 * \frac{1}{2} \int V^{H}({\bf r})\rho({\bf r})d{\bf r} - \int V^{XC}({\bf r})\rho({\bf r})d{\bf r} -
197 * \int {\bf m}({\bf r}) {\bf B}^{XC}({\bf r}) d{\bf r}
198 * \f]
199 * Where
200 * \f[
201 * \rho_{\sigma \sigma'}({\bf r}) = \sum_{i}^{occ} f_{i} \psi_{i}^{\sigma' *}({\bf r})\psi_{i}^{\sigma}({\bf r})
202 * \f]
203 * is a \f$ 2 \times 2 \f$ density matrix and
204 * \f[
205 * V_{\sigma\sigma'}^{eff}({\bf r})=\Big({\bf I}V^{eff}({\bf r})+{\boldsymbol \sigma}{\bf B}^{XC}({\bf r}) \Big)
206 * = \left( \begin{array}{cc} V^{eff}({\bf r})+B_z^{XC}({\bf r}) & B_x^{XC}({\bf r})-iB_y^{XC}({\bf r}) \\
207 * B_x^{XC}({\bf r})+iB_y^{XC}({\bf r}) & V^{eff}({\bf r})-B_z^{XC}({\bf r}) \end{array} \right)
208 * \f]
209 * is a \f$ 2 \times 2 \f$ matrix potential (see \ref dft for the full derivation).
210 *
211 * We are interested in this term:
212 * \f[
213 * \sum_{\sigma \sigma'}\int \rho_{\sigma \sigma'}({\bf r}) V_{\sigma' \sigma}^{eff}({\bf r}) d{\bf r} =
214 * \int V^{eff}({\bf r})\rho({\bf r})d{\bf r} + \int {\bf m}({\bf r}) {\bf B}^{XC}({\bf r}) d{\bf r}
215 * \f]
216 *
217 * We are going to split density into two contributions (sum of occupied bands \f$ \rho^{ps} \f$ and augmented
218 * charge \f$ \rho^{aug} \f$) and use the definition of \f$ \rho^{aug} \f$: \f[ \sum_{\sigma \sigma'}\int
219 * \rho_{\sigma \sigma'}^{aug}({\bf r}) V_{\sigma' \sigma}^{eff}({\bf r}) d{\bf r} = \sum_{\sigma \sigma'}\int
220 * \sum_{i} \sum_{\xi \xi'} f_i \langle \psi_i^{\sigma'} | \beta_{\xi} \rangle Q_{\xi \xi'}({\bf r}) \langle
221 * \beta_{\xi'} | \psi_i^{\sigma} \rangle V_{\sigma' \sigma}^{eff}({\bf r}) d{\bf r} = \sum_{\sigma \sigma'}
222 * \sum_{i}\sum_{\xi \xi'} f_i \langle \psi_i^{\sigma'} | \beta_{\xi} \rangle D_{\xi \xi', \sigma' \sigma}^{aug}
223 * \langle \beta_{\xi'} | \psi_i^{\sigma} \rangle \f] Now we can rewrite the total energy expression: \f[ E_{tot} =
224 * \sum_{i} f_i \sum_{\sigma \sigma'} \langle \psi_i^{\sigma'} | \Big( \hat T + \sum_{\xi \xi'} |\beta_{\xi} \rangle
225 * D_{\xi \xi'}^{ion} \delta_{\sigma \sigma'} + D_{\xi \xi', \sigma' \sigma}^{aug} \langle \beta_{\xi'} |\Big) |
226 * \psi_i^{\sigma} \rangle + \sum_{\sigma \sigma}
227 * \int V^{eff}_{\sigma' \sigma}({\bf r})\rho^{ps}_{\sigma \sigma'}({\bf r})d{\bf r} -
228 * \frac{1}{2} \int V^{H}({\bf r})\rho({\bf r})d{\bf r} - \int V^{XC}({\bf r})\rho({\bf r}) d{\bf r} -
229 * \int {\bf m}({\bf r}) {\bf B}^{XC}({\bf r}) d{\bf r} + E^{XC}[\rho + \rho_{core}, |{\bf m}|]
230 * \f]
231 * From the Kohn-Sham equations
232 * \f[
233 * \hat T |\psi_i^{\sigma} \rangle + \sum_{\sigma'} \sum_{\xi \xi'} \Big( |\beta_{\xi}
234 * \rangle D_{\xi \xi', \sigma' \sigma} \langle \beta_{\xi'}| + \hat V^{eff}_{\sigma' \sigma} \Big)
235 * | \psi_i^{\sigma'} \rangle = \varepsilon_i \Big( 1+\hat S \Big) |\psi_i^{\sigma} \rangle
236 * \f]
237 * we immediately obtain that
238 * \f[
239 * \sum_{i} f_i \varepsilon_i = \sum_{i} f_i \sum_{\sigma \sigma'} \langle \psi_i^{\sigma'} |
240 * \Big( \hat T + \sum_{\xi \xi'} |\beta_{\xi}
241 * \rangle D_{\xi \xi', \sigma' \sigma} \langle \beta_{\xi'} |\Big) |
242 * \psi_i^{\sigma} \rangle + \sum_{\sigma \sigma}
243 * \int V^{eff}_{\sigma' \sigma}({\bf r})\rho^{ps}_{\sigma \sigma'}({\bf r})d{\bf r}
244 * \f]
245 * and the total energy expression simplifies to:
246 * \f[
247 * E_{tot} = \sum_{i} f_i \varepsilon_i - \frac{1}{2} \int V^{H}({\bf r})\rho({\bf r})d{\bf r} -
248 * \int V^{XC}({\bf r})\rho({\bf r}) d{\bf r} - \int {\bf m}({\bf r}) {\bf B}^{XC}({\bf r}) d{\bf r} +
249 * E^{XC}[\rho + \rho_{core}, |{\bf m}|]
250 * \f]
251 */
252double total_energy(Simulation_context const& ctx, K_point_set const& kset, Density const& density,
253 Potential const& potential, double ewald_energy);
254
255double ks_energy(Simulation_context const& ctx, K_point_set const& kset, Density const& density,
256 Potential const& potential, double ewald_energy);
257
258double ks_energy(Simulation_context const& ctx, const std::map<std::string, double>& energies);
259
260std::map<std::string, double> total_energy_components(Simulation_context const& ctx, const K_point_set& kset,
261 Density const& density, Potential const& potential,
262 double ewald_energy);
263
264double one_electron_energy(Density const& density, Potential const& potential);
265
266double one_electron_energy_hubbard(Density const& density, Potential const& potential);
267double hubbard_energy(Density const& density);
268
269inline auto
270energy_dict(Simulation_context const& ctx__, K_point_set const& kset__, Density const& density__,
271 Potential const& potential__, double ewald_energy__, double scf_correction__ = 0)
272{
273 nlohmann::json dict;
274
275 dict["energy"] = nlohmann::json::object();
276
277 dict["energy"]["total"] = total_energy(ctx__, kset__, density__, potential__, ewald_energy__) + scf_correction__;
278 dict["energy"]["vha"] = energy_vha(potential__);
279 dict["energy"]["vxc"] = energy_vxc(density__, potential__);
280 dict["energy"]["exc"] = energy_exc(density__, potential__);
281 dict["energy"]["bxc"] = energy_bxc(density__, potential__);
282 dict["energy"]["veff"] = energy_veff(density__, potential__);
283 dict["energy"]["eval_sum"] = eval_sum(ctx__.unit_cell(), kset__);
284 dict["energy"]["kin"] = energy_kin(ctx__, kset__, density__, potential__);
285 dict["energy"]["ewald"] = ewald_energy__;
286 dict["energy"]["scf_correction"] = scf_correction__;
287 dict["energy"]["entropy_sum"] = kset__.entropy_sum();
288 dict["efermi"] = kset__.energy_fermi();
289 dict["band_gap"] = kset__.band_gap();
290 if (ctx__.full_potential()) {
291 dict["energy"]["core_eval_sum"] = core_eval_sum(ctx__.unit_cell());
292 dict["energy"]["enuc"] = energy_enuc(ctx__, potential__);
293 dict["core_leakage"] = density__.core_leakage();
294 } else {
295 dict["energy"]["vloc"] = energy_vloc(density__, potential__);
296 }
297
298 return dict;
299}
300
301} // namespace sirius
302
303#endif /* __ENERGY_HPP__ */
Generate charge density and magnetization from occupied spinor wave-functions.
Definition: density.hpp:214
double core_leakage() const
Find the total leakage of the core states out of the muffin-tins.
Definition: density.cpp:138
Set of k-points.
Definition: k_point_set.hpp:41
double entropy_sum() const
Return entropy contribution from smearing store in Kpoint<T>.
Generate effective potential from charge density and magnetization.
Definition: potential.hpp:46
Simulation context is a set of parameters and objects describing a single simulation.
Representation of a unit cell.
Definition: unit_cell.hpp:43
Contains definition and partial implementation of sirius::Density class.
Namespace of the SIRIUS library.
Definition: sirius.f90:5
double core_eval_sum(Unit_cell const &unit_cell)
Return eigen-value sum of core states.
Definition: energy.cpp:125
double valence_eval_sum(K_point_set const &kset)
TODO doc.
double total_energy(Simulation_context const &ctx, K_point_set const &kset, Density const &density, Potential const &potential, double ewald_energy)
Total energy of the electronic subsystem.
Definition: energy.cpp:186
double energy_veff(Density const &density, Potential const &potential)
TODO doc.
Definition: energy.cpp:141
double eval_sum(Unit_cell const &unit_cell, K_point_set const &kset)
TODO doc.
Definition: energy.cpp:135
double energy_vxc(Density const &density, Potential const &potential)
Returns exchange correlation potential.
Definition: energy.cpp:76
double energy_vloc(Density const &density, Potential const &potential)
TODO doc.
Definition: energy.cpp:119
double energy_vha(Potential const &potential)
Returns Hatree potential.
Definition: energy.cpp:88
double energy_kin(Simulation_context const &ctx, K_point_set const &kset, Density const &density, Potential const &potential)
Return kinetic energy.
Definition: energy.cpp:147
double energy_enuc(Simulation_context const &ctx, Potential const &potential)
Return nucleus energy in the electrostatic field.
Definition: energy.cpp:104
double energy_bxc(const Density &density, const Potential &potential)
TODO doc.
Definition: energy.cpp:94
double energy_exc(Density const &density, Potential const &potential)
Returns exchange correlation energy.
Definition: energy.cpp:82
double ewald_energy(const Simulation_context &ctx, const fft::Gvec &gvec, const Unit_cell &unit_cell)
Compute the ion-ion electrostatic energy using Ewald method.
Definition: energy.cpp:30
Contains declaration and partial implementation of sirius::Potential class.
Contains definition and implementation of Simulation_context class.