---
# System prepended metadata

title: 2D Glass-formers-Machine Learning
tags: [machine learning, local structures, glasses]

---

# 2D Glass-formers-Machine Learning
###### tags: `glasses` `local structures` `machine learning`

---
---


### Owners (the only ones with the permission to edit the main text)

Susana,  Giuseppe, Frank 

---
---
## Background and Plans
Based on the recent papers on 3D glass formers where we found a relation between dynamical behaviour and  tetrahedrality in 3D [(Tetrahedrality)](https://arxiv.org/pdf/1908.00425.pdf) and where we use machine learning techniques to distinguish between two structural families which are correlated with dynamics [(ML)](https://arxiv.org/pdf/2003.00586.pdf). We would like to extend these ideas into 2D glass formers, in particular hard spheres. Moreover, we want to explore the possibility of comparing our results with experimental data [(Roel's paper)](https://journals.aps.org/pre/pdf/10.1103/PhysRevE.95.012614?casa_token=Hyo9FiOjF1QAAAAA%3Al_fxdP9FXz2CMdWrX4YZ1vbRGrafqELgb9S3mmxa7cf89tqtiduTR0EjNlopZ0wAXNzFQEPruWb8ShI).

### Plans

We will start simulating binary mixtures of hard-spheres on a plane using EDMD. In particular, we will focus on the size ratio $q=0.7$ and $q=0.833$ (the typical glass-former size ratio in 3D) and a composition of $x_L=0.5$. The packing fractions from $\eta=0.66$ to have a reference point with [(Roel's paper)](https://journals.aps.org/pre/pdf/10.1103/PhysRevE.95.012614?casa_token=Hyo9FiOjF1QAAAAA%3Al_fxdP9FXz2CMdWrX4YZ1vbRGrafqELgb9S3mmxa7cf89tqtiduTR0EjNlopZ0wAXNzFQEPruWb8ShI).
The particles will interact in a non-additive form, mimicking the way that in experiments two spheres of different size ratios interact. Based on the same way of obtaining the  non-additiviy from [Stability of hard disks](https://hackmd.io/sh_a-uVAQt-2gW3Lvih07Q), the non-additive factor $\Delta$:
\begin{equation}
\Delta=\frac{2 \sqrt{q}}{1+q}-1
\end{equation}

Hence, $\Delta$ for the two size ratios is:


| q     | $\Delta$    |
| ----- | ----------- |
| 0.7   | -0.0156941  |
| 0.833 | -0.00415893 |




### To Do
:::success
green is for finished tasks
* Implent 2D EDMD
* Structure: BOP, $g(r)$
* Dynamics: MSD, Diffusion Coefficient
* Implement ML
:::
* Check if the chosen size ratios do not crystalize in long simulations
* Dynamics: ISF 2D?.
* Structure: $S(q)$
* Simulate larger packing fractions
* How is the dynamical heterogeneity in 2D? Is there any?
* Run larger simulations of $q=0.700$ at higher $\eta$

## RESULTS

### Dynamics
> [name=SMA] I have calculated the MSD and then the diffusion coefficient after letting the system diffuse for at least $5\sigma_L$ for different packing fractions. I've started from $\eta=0.6$ upto $\eta=0.800$ in order to explore dynamical and structural behaviour of them.
> 


| q=0.700 |![](https://i.imgur.com/3MNkG0k.png)| 
| -------- | -------- |
| **q=0.833**    |   ![](https://i.imgur.com/ugLNaDm.png)
 | 

![](https://i.imgur.com/P3Uowol.png)



Seems thatfor $q=0.833$ $\eta=0.78$ and $\eta=0.8$ the system has  crystallized (actually seems it cannot really equilibrate)

 
### Structure
In order to explore the structure, I've calculated the bond order parameters:
\begin{equation}
\psi_l(r_j)=\frac{1}{N_b} \left| \sum_m^{N_b}\exp\left(il\theta_{jm}\right) \right| ,
\end{equation}
where $N_b$ is the number of neighbors, $l$ an integer and $\theta_{jm}$ the angle between a fix axis and the vector that joins particle $j$ with $m$.
In order to get the list of neighbors, I used two different approaches:
* Cut-off radius (which could be improved) of $r_c=1.5\sigma_L$.
* Voronoi construction (fromo voro++)

The two methods give slight different resukts

To have all the structural infomation for the ML I have calculated $\psi$ from $1$ to $8$. First, the average of all and then per particle. One of the most relevant BOP is $\psi_6$ because (if I understood well) from the infinite pressure phase diagram of similar systems it seems that the configuration $H_2$ is stable in those size ratios and composition. Thus, we could expect if the system crystallize changes on $\psi_6$.
>[name=SMA] However, I don't have a real reference point of which should be the values for $\psi_l$.
>

Comparison between cut-off and Voronoi for large particles:
|           |               Cut-off                |               Voronoi                |
| --------- |:------------------------------------:|:------------------------------------:|
| $q=0.700$ | ![](https://i.imgur.com/Z2AyCG7.png) | ![](https://i.imgur.com/AMoowN8.png) |
| $q=0.833$ | ![](https://i.imgur.com/PyGZFmb.png) | ![](https://i.imgur.com/OYHYLnB.png) |


Voronoi results, for all, large and small  particles:

|              $q=0.700$               |              $q=0.833$               |
|:------------------------------------:|:------------------------------------:|
|            All Particles             |                                      |
| ![](https://i.imgur.com/37WW5Ai.png) | ![](https://i.imgur.com/2nK03Pt.png) |
|           Large Particles            |                                      |
| ![](https://i.imgur.com/jBNL58g.png) | ![](https://i.imgur.com/UDdbryj.png) |
|           Small Particles            |                                      |
| ![](https://i.imgur.com/xSxGG7s.png) | ![](https://i.imgur.com/UH6XssJ.png) |
|                                      |                                      |





>[name=SMA] It seems that for $q=0.833$ at high packing fractions $\psi_6$ increases, even the last point I would think that it might cristallyze, and this is related with the drop on diffusion coefficient we see.
>
In order to see the temporal evolution of the BOP, I calculate $\psi_4$, $\psi_5$ and $\psi_6$ as a function of time for different packing fractions (voronoi, large particles)



|             |              $q=0.700$               |              $q=0.833$               |
|:-----------:|:------------------------------------:|:------------------------------------:|
| $\eta=0.6$  | ![](https://i.imgur.com/8V5YjFo.png) | ![](https://i.imgur.com/9og2UaD.png) |
|             |                                      |                                      |
| $\eta=0.78$ | ![](https://i.imgur.com/uXJuw0M.png) | ![](https://i.imgur.com/SCyGywt.png) |
|             |                                      |                                      |
| $\eta=0.8$  | ![](https://i.imgur.com/mBw0utc.png) | ![](https://i.imgur.com/e2B1Wht.png) |
|             |                                      |                                      |


### Relation Structure and Dynamics

Before moving to machine learning, I characterized the relation between the dynamics and the structure. To do so, I have calculated the dynamical propensity $D_i$ for each particle, which is a way of averaging the contribution of the thermal effects to the motion, leaving the ammount of displacement due to the structure. To calculate it, we start $N_c$ new simulations from the same equilibrated starting point. We assing to each of these simulations different velocities a according to the Maxwell distribution. Hence, the propensity is calculated as:

\begin{equation}
 D_i(t)=\frac{1}{N_c}\sum_j^{N_c}\left| \mathbf{r}_i(t)-\mathbf{r}_i(0) \right|
\end{equation}

where $N_c$ is the number of different configurations.

Here, I used 32 configurations (which might be useful to have a larger sample because the system is quite small). 
In order to correlate this dynamical property with structure, I have calculated the first 8 BOP per particle of the initial configuration (the one used for reestarting the simulations). Later, I calculated the Spearmann's correlation between $D_i$ and each of the $BOP$:



|              |              $q=0.700$               | $q=0.833$                            |
| ------------ |:------------------------------------:| ------------------------------------ |
| $\eta=0.600$ | ![](https://i.imgur.com/4qk2QhR.png) | ![](https://i.imgur.com/4dcGZTt.png) |
| $\eta=0.660$ | ![](https://i.imgur.com/7hotNUy.png) | ![](https://i.imgur.com/h9oTBBE.png) |
| $\eta=0.700$ | ![](https://i.imgur.com/wpHlfzC.png) | ![](https://i.imgur.com/K0dsPXX.png) |
| $\eta=0.740$ | ![](https://i.imgur.com/LQ27Qx4.png) | ![](https://i.imgur.com/NCOzdED.png) |
| $\eta=0.780$ | ![](https://i.imgur.com/pPjQ0hj.png) | ![](https://i.imgur.com/LGJL8eK.png) |
| $\eta=0.800$ | ![](https://i.imgur.com/sdrb7oy.png) | ![](https://i.imgur.com/XJ8D970.png) |
>[name=SMA] The $q=0.833$ at high packing fractions is not really moving, so the correlations I was expecting to be low. However, interesting things happend to $q=0.700$. First, it has not crystallized, however we can see from the bops of each specie that for small particles $\psi_6$ is increasing at high packing fractions. At the same time we see a clear correlation at $\eta$

## Machine Learning
