Matlab code used in "M. Torda, J. Y. Goulermas, R. Pucek, V. Kurlin, Entropic trust region for densest crystallographic symmetry group packings". Requirements: MATLAB r2021b + Parallel Computing Toolbox NVIDIA CUDA Enabled GPU with compute capability 3.5 and higher P2 packing of convex polygons: 'packingP2nGon.m' - performs densest P2 packing for a given convex polygon. Input arguments: polygon - name of .txt file containing polygon vertices coordinates nRuns - number of packing refinement runs nWorkers - number of workers to use in computations Output: highest packing configuration achieved with the following structure properties 'density' - packing density 'x,y' - fractional coordinates of the centroid of given polygon 'omega' - angle of rotation of give polygon 'a,b' - lengths of primitive cell edges 'alpha' - primitive cell angle Example: packingP2nGon('octagon.txt', 100, 10) 'drawP2nGon.m' - draws a visualization of a P2 configuration for a given convex polygon Input arguments: solution - name of the text file containing: 'x' - fractional coordinate of the centroid of given polygon 'y' - fractional coordinate of the centroid of given polygon 'omega' - angle of rotation of give polygon 'a' - length of primitive cell edge 'b' - length of primitive cell edge 'alpha' - primitive cell angle polygon - name of text file containing polygon vertices coordinates Example: drawP2nGon('octagonP2solution.txt', 'octagon.txt') 'packingP2nGonCon.m' - overlap constraint computation for 'n' P2 configurations of a given convex polygon. 'packingObliqueObj.m' - computes volume of the primitive cell for oblique crystal system configuration of a given convex polygon. PG packing of convex polygons: 'packingPGnGon.m' - performs densest PG packing for a given convex polygon. Input arguments: polygon - name of .txt file containing polygon vertices coordinates nRuns - number of packing refinement runs nWorkers - number of workers to use in computations Output: highest packing configuration achieved with the following structure properties 'density' - packing density 'x,y' - fractional coordinates of the centroid of given polygon 'omega' - angle of rotation of give polygon 'a,b' - lengths of primitive cell edges Example: packingPGnGon('pentagon.txt', 100, 10) 'drawPGnGon.m' - draws a visualization of a PG configuration for a given convex polygon Input arguments: solution - name of the text file containing: 'x' - fractional coordinate of the centroid of given polygon 'y' - fractional coordinate of the centroid of given polygon 'omega' - angle of rotation of give polygon 'a' - length of primitive cell edge 'b' - length of primitive cell edge polygon - name of text file containing polygon vertices coordinates Example: drawPGnGon('pentagonPGsolution.txt', 'pentagon.txt') 'packingPGnGonCon.m' - overlap constraint computation for 'n' PG configurations of a given convex polygon. 'packingRectangularObj.m' - computes volume of the primitive cell for rectangular crystal system configuration of a given convex polygon. P2GG packing of convex polygons: 'packingP2GGnGon.m' - performs densest P2GG packing for a given convex polygon. Input arguments: polygon - name of .txt file containing polygon vertices coordinates nRuns - number of packing refinement runs nWorkers - number of workers to use in computations Output: highest packing configuration achieved with the following structure properties 'density' - packing density 'x,y' - fractional coordinates of the centroid of given polygon 'omega' - angle of rotation of give polygon 'a,b' - lengths of primitive cell edges Example: packingPGnGon('heptagon.txt', 100, 10) 'drawP2GGnGon.m' - draws a visualization of a PG configuration for a given convex polygon Input arguments: solution - name of the text file containing: 'x' - fractional coordinate of the centroid of given polygon 'y' - fractional coordinate of the centroid of given polygon 'omega' - angle of rotation of give polygon 'a' - length of primitive cell edge 'b' - length of primitive cell edge polygon - name of text file containing polygon vertices coordinates Example: drawP2GGnGon('heptagonP2GGsolution.txt', 'heptagon.txt') 'packingP2GGnGonCon.m' - overlap constraint computation for 'n' PG configurations of a given convex polygon. 'packingRectangularObj.m' - computes volume of the primitive cell for rectangular crystal system configuration of a given convex polygon. P3 packing of convex polygons: 'packingP3nGon.m' - performs densest P3 packing for a given convex polygon. Input arguments: polygon - name of .txt file containing polygon vertices coordinates nRuns - number of packing refinement runs nWorkers - number of CPU workers to use in computations Output: highest packing configuration achieved with the following structure properties 'density' - packing density 'x,y' - fractional coordinates of the centroid of given polygon 'omega' - angle of rotation of give polygon 'a,b' - lengths of primitive cell edges Example: packingP3nGon('hexagon.txt', 100, 10) 'drawP3nGon.m' - draws a visualization of a P3 configuration for a given convex polygon Input arguments: solution - name of the .txt file containing: 'x' - fractional coordinate of the centroid of given polygon 'y' - fractional coordinate of the centroid of given polygon 'omega' - angle of rotation of give polygon 'a' - length of primitive cell edge 'b' - length of primitive cell edge polygon - name of .txt file containing polygon vertices coordinates Example: drawP3nGon('hexagonP3solution.txt', 'hexagon.txt') 'packingP3nGonCon.m' - overlap constraint computation for 'n' P3 configurations of a given convex polygon. 'packingHexagonalObj.m' - computes volume of the primitive cell for hexagonal crystal system configuration of a given convex polygon. P4 packing of convex polygons: 'packingP4nGon.m' - performs densest P4 packing for a given convex polygon. Input arguments: polygon - name of text file containing polygon vertices coordinates nRuns - number packing refinement runs nWorkers - number of workers to use in computations Output: highest packing configuration achieved with the following structure properties 'density' - packing density 'x,y' - fractional coordinates of the centroid of given polygon 'omega' - angle of rotation of give polygon 'a' - length of primitive cell edge Example: packingP4nGon('iregPentagon.txt', 100, 10) 'drawP4nGon.m' - draws a visualization of a P4 configuration for a given convex polygon Input arguments: solution - name of the text file containing: 'x' - fractional coordinate of the centroid of given polygon 'y' - fractional coordinate of the centroid of given polygon 'omega' - angle of rotation of give polygon 'a' - length of primitive cell edge polygon - name of text file containing polygon vertices coordinates Example: drawP4nGon('iregPentagonP4solution.txt', 'iregPentagon.txt') 'packingP4nGonCon.m' - overlap constraint computation for 'n' P4 configurations of a given convex polygon. 'packingSquareObj.m' - computes volume of the primitive cell for square crystal system configuration of a given convex polygon. P6M packing of convex polygons: 'packingP6NGon.m' - performs densest P6M packing for a given convex polygon. Input arguments: polygon - name of .txt file containing polygon vertices coordinates nRuns - number packing refinement runs nWorkers - number of workers to use in computations Output: highest packing configuration achieved with the following structure properties 'density' - packing density 'x,y' - fractional coordinates of the centroid of given polygon 'omega' - angle of rotation of give polygon 'a' - length of primitive cell edge Example: packingP6MnGon('iregTriangle.txt', 100, 10) 'drawP6MnGon.m' - draws a visualization of a P6M configuration for a given convex polygon Input arguments: solution - name of the .txt file containing: 'x' - fractional coordinate of the centroid of given polygon 'y' - fractional coordinate of the centroid of given polygon 'omega' - angle of rotation of give polygon 'a' - length of primitive cell edge polygon - name of .txt file containing polygon vertices coordinates Example: drawP6MnGon('iregTriangleP6Msolution.txt', 'iregTriangle.txt') 'packingP6MnGonCon.m' - overlap constraint computation for 'n' P6M configurations of a given convex polygon. 'packingHexagonalObj.m' - computes volume of the primitive cell for hexagonal crystal system configuration of a given convex polygon. Entropic trust region optimization: 'entropicPacking.m' - initial run of the entropic trust region 'entropicPackingRef.m' - refining run of the entropic trust region Extended multivariate von Mises Gibbs sampler: 'emvmRand.m' - simulates n realizations of the exponential family reparametrisation of extended multivariate von Mises distribution. 'gvmRand.m' - rejection sampling generating n realizations from the generalized von Mises distribution. "R. Gatto, Some computational aspects of the generalized von mises distribution, Statistics and computing, (2008)."