# Power Consumption Comparison of GPU Linear Solvers for Cellular Potts Model Simulations
## 2 Mathematical Background
_Hamiltonian energy change_ (\(\Delta H\)): After transitioning the state of \(Q\) to the state of \(P\), the related variation in the Hamiltonian of the system is given by \[\Delta H=H^{\text{new}}-H.\] (1) \(H\) is the value at the current state, \(H^{\text{new}}\) the one if the cell index of \(P\) becomes the cell index of \(Q\). 3. _Modified Metropolis criterion and state modification_: To establish whether to accept the state transition of \(P\)s cell index, the criterion uses the value of \(\Delta H\). If it is negative or zero, the system undergoes the state transition; if positive, it is accepted with a Boltzmann distribution probability: \[p(\Delta H)=\exp\left(-\frac{\Delta H}{T}\right),\] (2) where \(T\) plays a role analogous to temperature in thermodynamics. The Hamiltonian is the total energy of the system, and it is given by  
\[H=H_{ad}+H_{v}+H_{s}. \tag{3}\]  
\(H\) encapsulates three different components, each of them reflecting different physical phenomena:  
1. \(H_{ad}\) denotes the contribution due to the cell adhesion energy and it is defined as the following sum: \[H_{ad}=J\cdot\sum_{P\in\Omega}\ \sum_{Q\in Nb\left(P\right)}1-\delta(L_{P},L_{Q}).\] (4) Here, \(Nb\left(P\right)\) is the set of neighboring positions of \(P\), while the inner sum involves all neighbors \(Q\) by evaluating the expression \(1-\delta(L_{P},L_{Q})\), where \(\delta\) is the Kronecker delta function, defined as \[\delta(x,y)= \begin{cases}1,&\text{if }x=y,\\ 0,&\text{otherwise.}\end{cases} \] The Kronecker function assigns values of \(1\) or \(0\) by checking if two neighboring cells are or are not of the same type, respectively: if they are of different types, the contribution reflects the presence of an interface between them. The parameter \(J\) quantifies the  
Figure 1: Lattice evolution (\(L^{\tau}\)) involved in Cellular Potts model for some values of \(\tau\). White is for medium, red for the unique cell type. adhesion strength between different types of cells, that is, it determines how much cells adhere to each other within the tissue. 2. \(H_{v}\) is a term measuring a cell's volume area (volume in case of 3D lattices), and it is given by \[H_{v}=\lambda\sum_{k}\left(\frac{V_{k}}{\bar{V}}-1\right)^{2},\quad V_{k}= \operatorname{vol}(C_{k}).\] (5) Here, \(C_{k}\) and \(V_{k}\) are the current area of cell \(k\) and the set of pixels of cell \(k\), respectively. The term \(\bar{V}\) represents a target volume, while \(\lambda\) is a parameter which attempts to measure the volume constraint. 3. The last term, \[H_{s}=\mu\sum_{P}(\Delta\varepsilon_{P})^{2},\qquad\Delta\varepsilon_{P}= \varepsilon(P)-\bar{\varepsilon}(P)\] (6) represents the effect of the surface tension and it stands for the mechanical strain of the system: \(\Delta\varepsilon(P)\) is the gap between the current strain \(\varepsilon(P)\) and the target value \(\bar{\varepsilon}(P)\). The parameter \(\mu\) controls the strength of the strain constraint. High accuracy is demanded in evaluating \(H_{s}\) to delineate well the effects of mechanical forces on cell behavior. It has to be noted that while using the Metropolis criterion the change in the Hamiltonian can be conveniently written as follows:  
\[\Delta H=\Delta H_{\text{ad}}+\Delta H_{v}+\Delta H_{s}. \tag{7}\]  
This implies that \(\Delta H\) can be evaluated by separately computing the gap in their addends. Since the model proceeds one pixel at a time, these terms only involve a few terms, related to the neighboring pixels, and require low computational cost. For the strain \(\varepsilon\) evaluation, the finite element method (FEM) is used, following the approach shown in [9]. Such a choice allows the strain to be computed by breaking down the global problem into smaller and more manageable pieces. It requires the use of a local stiffness matrix \(K_{e}\), which takes into account, for each element \(e\), the correlation between the nodal displacements and the forces exerted upon them.