Repairing Unfeasible Solutions in ETRPA.

The ETRPA is designed to optimize a multi-objective function by:

1. Maximizing packing density.
2. Minimizing overlap between shapes in a configuration.

This is achieved through the use of a penalty function, which generally works quite effectively. However, there are some downsides to this approach. Many generated samples are flagged as unfeasible, leading to inefficiency. Additionally, some potentially good configurations with minimal overlaps are discarded. A more effective approach would involve mapping unfeasible solutions to feasible ones, essentially repairing the overlaps.

I’ve designed a relatively straightforward method to accomplish this almost analytically. It boils down to finding roots of a second-order polynomial, which is essentially a high school algebra problem. Admittedly, you’ll need to solve quite a few of these second-order polynomials, but they are relatively easy to handle.

So, with this approach, you can now map a configuration with overlap/s

to one without overlaps

Now, a couple of new issues have cropped up. First, there are some seriously bad solutions that are being sampled. For example, consider this one:

which is then mapped to this configuration

This is not helpful at all. Second, the parameters of this configuration are way above the optimisation boundaries that were used to create all configurations. As a result, it falls outside the configuration space where my search is taking place.

To address this issue, after repairing the configuration, I conduct a check to determine if the repaired configuration falls within my optimization boundaries. Any configurations that fall outside of these bounds are labeled as unfeasible solutions.

It might seems this puts me back in the same situation of multi-objective optimization, but that’s not the case. In my scenario, the Euclidean gradient at time t takes this form:

\nabla_{\bm{\theta}} J(\bm{\theta}^t) \ = \ \bm{\mu}^t_{\textbf{F}_{1- \frac{1}{q^{*}}}}-\bm{\mu}^t.

Here, \bm{\mu}^t represents the mean of all samples in the current batch, and I only consider the configurations without overlap or the repaired ones that lie within the optimization boundaries for \bm{\mu}^t_{\textbf{F}_{1- \frac{1}{q^{*}}}}. This effectively means I’ve eliminated the need for the penalty function and am optimizing only based on the objective function given by the packing density.

This is a promising, but it does introduce another problem. When I repair some of the unfeasible configurations, I end up making slight alterations to the underlying probability distribution, shifting it slightly from \bm{\theta}^t

to \bm{\theta}_{\text{rep}}^t

The issue here is that if I were to compute the Natural gradient as I used to, I’d obtain \widetilde{\nabla} J(\bm{\theta}_{\text{rep}}^t) =\mathcal{I}_{\bm{\theta}_{\text{rep} }^t}^{-1} \left({\bm{\mu}_{\text{rep}}^t}_{\textbf{F}_{1- \frac{1}{q^{*}}}}-\bm{\mu_\text{rep}}^t\right) in the tangent space \mathcal{T}_{\bm{\theta}_\text{rep}^t} of the statistical manifold, where everything is unfolding, but what I actually need is \widetilde{\nabla} J(\bm{\theta}^t) in the tangent space at the point \bm{\theta}^t.

Fortunately, the statistical manifold of the exponential family is a flat Riemannian manifold. So, first, I move from \bm{\theta}^t to \bm{\theta}_{\text{rep} }^t using this vector \mathcal{I}_{\bm{\theta}^t}^{-1} \left(\bm{\mu_\text{rep}}^t-\bm{\mu}^t\right) (where \bm{\mu}^t corresponds to the dual Legendre parametrization of \bm{\theta}^t, and \bm{\mu}_\text{rep}^t to \bm{\theta}_\text{rep}^t), and then I compute the natural gradient at the point \bm{\theta}_\text{rep}^t.

In addition, to increase the competition within my packing population, I introduce a sort of tournament by retaining the N-best configurations I’ve found so far and incorporating them with the repaired configurations from the current generation. This leads to yet another slightly modified distribution, \bm{\theta}_\text{rep + N-best}^t

and I have to perform the same Riemannian gymnastics once more. In the end, the approximation to the natural gradient at the point \bm{\theta}^t is as follows

\widetilde{\nabla} J(\bm{\theta}^t) = \mathcal{I}_{\bm{\theta}_{\text{rep + N-best} }^t}^{-1} \left({\bm{\mu}_{\text{rep + N-best}}^t}_{\textbf{F}_{1- \frac{1}{q^{*}}}}-\bm{\mu}_{\text{rep + N-best} }^t\right) + \mathcal{I}_{\bm{\theta}_{\text{rep} }^t}^{-1} \left(\bm{\mu}_{\text{rep + N-best}}^t-\bm{\mu_\text{rep}}^t\right) + \mathcal{I}_{\bm{\theta}^t}^{-1}\left(\bm{\mu_\text{rep}}^t-\bm{\mu}^t\right)

So far, experiments show that these modifications to the ETRPA are far more effective than the original ETRPA. Here’s a visualization from one of the test optimization runs:

In this particular run, the best packing I achieved attains the density of 0.7845. Previously, reaching such a level of density required multiple rounds of the refinement process, each consisting of 8000 iterations. Now, a single run with just 2000 iterations is sufficient. It’s worth noting that even after only 200 iterations, the algorithm already reaches areas with densities exceeding 0.7.

It’s important to mention that currently, I’ve only implemented the repair process for unfeasible configurations for the P1 space group. However, similar repairs can be done for configurations in any space group. Furthermore, the algorithm’s convergence speed can be further enhanced by fine-tuning its hyperparameters. Perhaps it’s time to make use of the BARKLA cluster for the hyperparameter tuning.

Minimising a Lennard-Jones hexagonal molecular system

Each frame of this simulation showcases the outcomes of Sequential Quadratic Programming (SQP) minimization applied to a Lennard-Jones system. The system’s energy is defined by the following expression:

    \begin{equation*} E_{LJ}=\sum_{\{ A, B \} } \frac{1}{2}\sum_{a \in A} \sum_{b \in B} 4\epsilon\left[\left(\frac{\sigma}{r_{ab}}\right)^{12} - \left(\frac{\sigma}{r_{ab}}\right)^{6}\right] \end{equation*}

where the parameters are set as \sigma = 1 and \epsilon = \frac{1}{4}. Here, \{ A, B \} represents the ordered pair of molecules A and B. The simulation involves a system of 500 molecules, each comprising 6 atoms. At the start, a uniform random configuration was generated, with each molecule represented by two center of mass coordinates and one rotational coordinate.

As the simulation progresses, the boundaries of the box are incrementally reduced following each SQP minimization. This effectively simulates an increase in pressure on the system. Notice the hexagonal tiling patches as the simulation advances. These are depicted as blue regular hexagons, each scaled by a factor of 1.93185 and rotated by an angle of 0.17862 relative to the molecules.

It’s important to note that the empty spaces observed in the simulation are a result of the rate at which pressure is increased. A sufficiently slow increase in pressure would eventually lead to a 6^3 regular tiling.

Densest P1 packing of the tetrahedron

I applied the Entropic Trust Region Packing Algorithm to search for the densest lattice packing of tetrahedra. It turned out that the GPU implementation of the overlap constraint evaluation for space group packings of polyhedra was more complicated than I expected. The good news was that the optimization algorithm worked as intended.

The densest lattice packing of the regular tetrahedron is \frac{18}{49} \approx 0.36734 (https://www.ams.org/journals/bull/1970-76-01/S0002-9904-1970-12400-4/). This is the configuration the algorithm found. See the visualization of the output packing with density 0.36734 below.

Densest P1, P-1 and P21/c packings of spheres

I started to work on space group packings. I applied the Entropic Trust Region Packing Algorithm (https://arxiv.org/abs/2202.11959) to search for the densest packings of the sphere in space groups P1 and P-1.

In the P1 setting, the densest packing density coincides with the general optimal packing density of spheres (https://www.jstor.org/stable/20159940). If the unit cell parameters are set to a=b=c=2 and \alpha=\beta=\gamma=\frac{\pi}{3} with the unit cell given by

    \begin{equation*} U=\left[\begin{array}{ccc} a\sin(\beta)\sqrt{1-\left(\frac{\cos(\alpha)cos(\beta) - cos(\gamma)}{\sin(\alpha)\sin(\beta)}\right)^2} & 0 & 0 \\ -a\frac{\cos(\alpha)cos(\beta) - cos(\gamma)}{\sin(\alpha)} & b\sin(\alpha) & 0 \\ a\cos(\beta) & b\cos(\alpha) & c \end{array}\right] \end{equation*}


then the determinant of U equals to \det(U)=4\sqrt{2} and combined with the volume of the unit sphere \text{vol}(S)=\frac{4}{3}\pi gives the optimal packing density of spheres \rho(S_{P1})=\frac{\text{vol}(S)}{\det(U)}=\frac{\pi}{\sqrt{18}}\approx 0.74048. See a visualization of this configuration below.

There are a few interesting things about this. First, for some reason, I could find this configuration reported anywhere. Second, it is conjectured that the densest packings of centrally symmetric polyhedra are P1 packings (https://journals.aps.org/pre/abstract/10.1103/PhysRevE.80.041104). It might be that this conjecture can be extended to a larger class of centrally symmetric convex sets, similar to the 2D setting where the densest packing of centrally symmetric convex sets is a lattice packing (https://link.springer.com/article/10.1007/BF02392671).

In the P-1 setting the situation is similar. If the unit cell parameters are set to a=c=2, b=2\sqrt{2} and \alpha=\beta=\gamma=\frac{\pi}{2}, then the determinant of the unit cell equals to \det(U)=8\sqrt{2} and again we get the optimal packing density of spheres \rho(S_{P-1})=\frac{2\text{vol}(S)}{\det(U)}=\frac{\pi}{\sqrt{18}}. See the visualization of this configuration below.

Here again, I couldn’t find this configuration of spheres reported anywhere. Another interesting thing is that the situation resembles the 2D setting, where the densest P1 and P2 configurations of a disc have the same packing density (https://journals.aps.org/pre/abstract/10.1103/PhysRevE.106.054603). The P-1 space group can be considered as an equivalent of the P2 plane group since the point group symmetries are given via inversion through the centre of the unit cell. It might be that centrally symmetric polyhedra attain their optimal packings also in the P-1 space group. Moreover, it is conjectured that for convex 2D sets, the P2 configurations are optimal (https://link.springer.com/article/10.1007/s00454-016-9792-4). I am wondering for which other convex 3D sets is the P-1 packing configuration optimal.

With the P21/c space group, the symmetries of the densest sphere packing continue. If the unit cell parameters are set to a=2\sqrt{2}, b=4, c=2 and \alpha=\beta=\gamma=\frac{\pi}{2}, then the determinant of the unit cell equals to \det(U)=16\sqrt{2} and again we get the optimal packing density of spheres \rho(S_{P21/c})=\frac{4\text{vol}(S)}{\det(U)}=\frac{\pi}{\sqrt{18}}. See the visualization of this configuration below.

What is interesting is that the P21/c and P-1 space groups are the most frequent space groups found in the Cambridge Structural Database amounting to 59.3% of structures. I wonder if there is a relationship between densest space group packing of a sphere and the frequencies space groups occurring in CSD.

Projected n-gon plane group packing orderings

We can use the packing density table to define a plane group ordering according to densest n-gon packings for each n-gon. Below is a visualization of this ordering. For given n-gon a color is assigned for each plane group based on the density of respective densest plane group packing.

 

Based on these orderings we can tell the densest plane group packing ordering for an arbitrary n-gon and it’s symmetries. Below are the projected orderings of densest plane group packings of n-gons for n = 5 : 42

 

Pentagon densest P2MM packing to PM and C2MM packings

Given densest P2MM packing of a regular convex polygon it possible to convert the configuration to a PM and C2MM packing of exatly same density. For n-gons without central symmetry this these C2MM packings are not optimal and the PM packings are not the same as those obtained using etropic trust region packing algorithm although they have the same approximate density.

Here is an example in the pentagon instance. PM and C2MM packings constructed based on densest P2MM packing with density 0.6909830 . The PM packing is different  than the one obtained by entropic trust region http://milotorda.net/wp-content/uploads/2022/06/paperPMgon5-eps-converted-to.pdf and the C2MM has lower density than the one obtained by the entropic trust region http://milotorda.net/index.php/packings/ From left to righ: P2MM, PM and C2MM.