Calculating energies

In the multisysten framework, the total energy (total_energy) of a calculation consists of various contributions, where we follow the standard definitions of thermodynamics (see here)

Kinetic energy

We use the term kinetic energy in the usual sense. The only slight exception is for container systems:

Ideally, for containers, the kinetic energy should be the kinetic energy with respect to the centre of mass of the container. The kinetic energies of the constituents, relative to the centre of mass frame, should be accounted for as part of the internal energy of the container.


Specific systems need their specific routines to calculate the kinetic energy.

For the Maxwell system, this is the so-called electromagnetic energy.

Interaction energies

Everything else is treated as an interaction energy. Here we have to distinguish between the interactions between two different systems (which can be of the same type), and the interaction of a system with itself (intra-interaction).


The interactions between two different systems do not require any further thought, as by definition no physical self-interaction can occur. As the method to calculate the interactions are part of the interaction class, it is independent of the actual system and can be implemented at the level of the classsystem_t.


The exception are containers. Here we need to loop over the constituents. In order to distinguish inter- from intra-interactions, we need to query each interaction for its interaction partner, and skip the interaction, if the partner is part of the container.



Systems may contain more than one physical particle (e.g. the electrons, a set of ions or container systems). In order to account for the interaction of these particles with other particles of the same system, we decided to treat this case as a system interacting with itself, which we call intra-interaction.

In some cases, such as a single particle, this intra interaction has to be zero, while in other cases with many particles, the interactions have to be calculated, where – of course – the interaction of one particle with itself has to be removed (at least approximatively).

Another important aspect of the implementation is that Octopus deals with one-sided interactions. This has the implication that there is no double counting when calculating the interaction energies. Both contributions have to be counted: for each system, we add the the energy of the system in the field of the partner.


For containers, this means that the interaction energy contains the complete interaction energies of all subsystems in the container, plus the energies of the subsystems in the field of all other systems (not part of that container).

Note that the internal_energy of a container is not the sum of the self_energies of the constituents, and also the external energy of a container is not the sum of the external energies of the constituents!


Total energy

The total energy of the whole simulation (top level container) is clearly defined. It contains the sum of all internal and interaction energies.

For a specific system (e.g. electrons), the total energy also is the sum of the internal energy and the interaction energies (including the intra interaction energy).


Total energies and interaction energies depend on the state of other systems, and therefore should not be used for convergence criteria for a given system. Only the internal energy is safe to use here.