1. Interaction energy functionals

A few interaction energy functionals \(W\) are defined in HyMD through the Hamiltonian class and associated subclasses.

1.1. \(\chi\)–interaction and \(\kappa\)–incompressibility

The most common hPF energy functional is specified by

hamiltonian = "DefaultWithChi"

in the configuration file (see Configuration file). It takes the form

\[W=\frac{1}{2\phi_0}\int\mathrm{d}\mathbf{r}\sum_{\text{i}, \text{j}}\tilde\chi_{\text{i}-\text{j}}\tilde\phi_\text{i}(\mathbf{r})\tilde\phi_\text{j}(\mathbf{r}) + \frac{1}{2\kappa}\left(\sum_\text{k}\tilde\phi_\text{k}(\mathbf{r})-\phi_0\right)^2,\]

where \(\tilde\chi_{\text{A}-\text{B}}\) is the interaction energy between overlapping densities of particle types \(\text{A}\) and \(\text{B}\). The incompressibility term is governed by the compressibility parameter \(\kappa\). The average density of the full system is denoted \(\phi_0\).

Using this energy functional necessitates specification of \(\tilde\chi\) and \(\kappa\) in the configuration file (see Configuration file)

kappa = 0.05
chi = [
   ["A", "B", 15.85],
   ["B", "C", -5.70],
   ...
]

1.2. Only \(\kappa\)–incompressibility

The only \(\kappa\) interactions energy functional is specified by

hamiltonian = "DefaultNoChi"

in the configuration file (see Configuration file). It takes the form

\[W=\int\mathrm{d}\mathbf{r}\frac{1}{2\kappa}\left(\sum_\text{k}\tilde\phi_\text{k}(\mathbf{r})-\phi_0\right)^2,\]

where the incompressibility term is governed by the compressibility parameter \(\kappa\). The average density of the full system is denoted \(\phi_0\).

Using this energy functional necessitates specification of \(\kappa\) in the configuration file (see Configuration file)

kappa = 0.05

1.3. Only \(\phi^2\)

The \(\phi^2\) interactions energy functional is specified by

hamiltonian = "SquaredPhi"

in the configuration file (see Configuration file). It takes the form

\[W=\int\mathrm{d}\mathbf{r}\frac{1}{2\kappa\phi_0}\left(\sum_\text{k}\tilde\phi_\text{k}(\mathbf{r})\right)^2,\]

where the \(\phi\) squared term is governed by the compressibility parameter \(\kappa\). The average density of the full system is denoted \(\phi_0\).

Using this energy functional necessitates specification of \(\kappa\) in the configuration file (see Configuration file)

kappa = 0.05

1.4. Implementing new interaction energy forms

Implementing new interaction energy functions is straightforward by subclassing Hamiltonian and applying sympy differentiation to the symbolic field objects. The sympy.lamdify function creates vectorised numpy functions automatically from the differentiation result which is used to transform the density fields.