# Gintas'Project
###### tags: `Granular Simulations` `granular` `self-assembly`
---
---
### Owners (the only one with the permission to edit the main test)
Gintas, GF, RM
---
---
## Background
This are the notes of the project by Gintas, M1 student in the M1 GP.
## Plans
Study the yielding transition in a simple 2D model under cyclic volume preserving compressions as oppossed to shear.
The model is taken from Himangsu JCP:
[Yielding transition of a two dimensional glass former under athermal cyclic shear deformation](https://arxiv.org/abs/2108.07497)
## To Do
- ~~Implemented the tabulated potential~~
- ~~Implement the compression AQS~~
- Literature review
- Create initial configuration for the HTL and ESL states and compare with the paper result
- Investigate compression yielding.
- Generate WAL configurations using SLLOD as in the paper.
- Explore also other protocols, see for example the dynamics used for the QC+Yielding paper.
- ....
### OPEN QUESTIONS
* We have the good energies but we have cavities in the initial conf. this is probably an error in the composition.
**GG**: The error was in ratio between $N_S$ and $N_L$ during particles generation.
### Literature review
Some paper to study and to see who cite them:
https://arxiv.org/pdf/1912.00221
**RM note**: some time ago, while searching a bit for this, I found these papers; I did not read them, so some of them might be off, some might be interesting:
https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.115.188001
https://arxiv.org/pdf/1407.6167
https://doi.org/10.1103/PhysRevB.111.064105
https://doi.org/10.1103/PhysRevE.103.062906
https://arxiv.org/pdf/2309.10682
https://arxiv.org/pdf/cond-mat/0505648
**GF note**: *Shear Bands*
We need to thing about what happen to Shear Band in compression. Probably they will be at an angle with the compression direction. see this for example:
https://arxiv.org/pdf/1304.6568
**GF note**: *Relaxation time*
For the relaxation time of glasses, the stretched exponential is indeed a possible choice, but keep in mind that at low temperature you will have the typical 2-step relaxation pattern. To see this you need to use x in log scale. See the fig. 3 of the paper below for example. Indeed the fit are presented in Fig. 6.
Indeed, it is nice to introduce the intermediate scattering function, but you could also just look at the mean-square displacemnt of the two species. When each spieces has diffussed around few diameters (ideally 10), you have probably relaxd.
https://arxiv.org/pdf/cond-mat/0309007
**GF note**: *Non-Affine Displacement*
One thing to look at is $D_i$ the local non affine displacement. This will allow to look at shear-bands. See equation 5 and discussion around it in this paper we wrote few years ago.
https://arxiv.org/pdf/2111.04116
**GF note**: *Annealing glasses by cyclic shear deformation*
thi is the paper where the strategy to create WAL1 and WAL2 in the papers is described.
https://arxiv.org/pdf/1805.12476
### Initial cofingurations
#### Estimation of structural relaxation time
To estimate $\tau_{\alpha}$ I ran a simulation for both temperatures (2.38 -- HTL, 0.35 -- ESL) with $N=1000$, $dt=0.001$ in NVT.
<div style='display: flex; gap: 20px'>
<div style='flex: 1'>
<img src='https://hackmd.io/_uploads/Hkb2AQ8-Wl.png' width=300/>
</div>
<div style='flex: 1'>
<p>
<b>Structure factor</b>. <br/> It's almost identical for both temperatures. <br/> The first maximum is q<sub>max</sub> = 0.29.
</p>
</div>
</div>
The structural relaxation time can be estimated as soluton for the equation $F(\tau_{\alpha}, q_{\text{max}}) = e^{-1}$, where $F(t, q) = \big\langle \sum e^{i\bar{q}\cdot(\bar{r}(t) - \bar{r}(0))} \big\rangle$ -- intermediate scattering function.
It turned out that $\tau_{\alpha}$ is very large for ESL. So, it's not possible just to solve the equation $F(\tau_{\alpha}, q_{\text{max}}) = e^{-1}$.

I used the glassy approximation
$$F(t,q) \approx e^{-\Big(\tfrac{t}{\tau}\Big)^{\beta}}$$

Here's the fit parameter vs. chosen $q$. Red cross -- $q_{\text{max}}$.

The resulting approximations of $\tau_{\alpha}$ are
| | HTL | ESL |
| -------- | -------- | -------- |
| $\tau_{\text{fit}}$ | $70$ | $22916$ |
| simulation time | $642 \tau_{\alpha}$ | $6.5 \tau_{\alpha}$ |
Last row is simulation time in $\tau_{\alpha}$ units. One can see, that HTL is close to be relaxed, but ESL no.
#### Relaxation
I made a runs for $N=1000$ with durations $t_{\text{HTL}} = 10^4 \tau_{\alpha} = 7 \cdot 10^5$, $t_{\text{ESL}} = 10^2 \tau_{\alpha} = 23 \cdot 10^5$.
Same graphs for these runs:

Solving $F(t,q)=e^{-1}$ (red cross -- $q_{\text{max}}$)

Resulting structural relaxation time
| | HTL | ESL |
| -------- | -------- | -------- |
| $\tau_{\text{fit}}$ | $58$ | $7605$ |
They will be used for $N=10^4$.
#### Inherent Structures
I generated uncorrelated frames for every temperature by making a run with frames being saved every $\tau_{\alpha}$. 5 frames are made.
Frames are minimized to get inherent structures.

<img src='https://hackmd.io/_uploads/Hkke7g0WWe.png' width=400/>
### AQS cyclic compression
#### Formula
The transformation is given by
$(x,y) \rightarrow \Big( (1+ d\gamma)x, (1+d\gamma)^{-1} y \Big)$, $d\gamma = 0.0002$
It keeps the volume constant.
Applying this transformation $N$ times we get factor $(1+d\gamma)^N$. So, is not additive, but multiplicative.
It gives us relations for $\gamma_{\text{max}}$ and $\gamma_{\text{acc}}$.
$(1+\gamma_{\text{max}}) = (1+d\gamma)^N$
$(1+\gamma_{\text{acc}}) = (1+\gamma_{\text{max}})^{4k} = (1+d\gamma)^{4kN}$
where $N$ -- number of primitive steps from initial state to maximal amplitude, $k$ -- number of full cycles.
Since hundreds of cycles gives $\gamma_{\text{acc}}$ so big that computer's arithmetics stops working, I decided to use the logarithm of it as "time" measure for all time series.
Time measure $= \ln(1+\gamma_{\text{acc}}) = 4Nk \ln(1+d\gamma)$
This value is additive with respect to the number of cycles.
#### Energies
Energies averaged over 5 samples.

Fit of the averaged energy. For ESL there's a strange behavior of fits for low-gamma runs, because the difference between initial and final energy is much smaller than fluctuations.

Steady state energy vs. $\gamma_{\text{max}}$. It seems that $\gamma_c = 0.035$, but for HTL($N=10^3$) it goes to $\gamma_c^*=0.045$ due to the size effect.

The values of $\widetilde{\gamma}_{\text{acc}}$ from stretched exponent. The upper left pic. shows $\widetilde{\gamma}_{\text{acc}}$ for every sample and amplitude, other pics shows different means over samples.
Comparing HTL with different sizes (upper left, blue and green) one can see that bigger size gives lover fluctuations between samples.
ESL (upper left, red) shows much bigger fluctuation. When the mean value is calculated (upper right) the big values of $\widetilde{\gamma}_{\text{acc}}$ dominate others.
To compensate this effect I used different formulas: geometric and harmonic means. They give better values and align with result from the paper (2013).
Motivation for the harmonic mean is that exponential decay factor in exponential decay combines as $\frac{1}{\tau} = \frac{1}{\tau_1} + \frac{1}{\tau_2} + \dots$
Perhaps, more samples will give more stable results.

#### Pressure
I tried to find an analogue for $\sigma_{xy}$ from shear deformation. I tried to use values of pressure in X-axis, I saved pressure at the points $x\rightarrow \text{min}$ (max compression), $x\rightarrow \text{max}$ (max stretching).

Fits for pressures


The difference of these to pressures gives us value that goes to zero at zero amplitude $\Delta P(\gamma_{\text{max}}\rightarrow 0)\rightarrow 0$.
<img src='https://hackmd.io/_uploads/HJsEh6HG-l.png' width=400/>
#### Diffusion
Graphs for MSD.

Diffusion value
<img src='https://hackmd.io/_uploads/ryOylCHzbe.png' width=400/>
#### Structural change
I use Delaunay triangulation, handled borders by copying 8 cells around.
<img src='https://hackmd.io/_uploads/Bymp6FkM-l.png' width=400/>
Fractions for 5S, 6S, 6L, 7L. They are in good agreement with the paper (main one, 2022). The only difference is $f_6^S$, the right part of the graph is around $0.1$ when the paper has $0.05$.

### No volume preserving
#### Energies
Points in the range (0.045, 0.1) weren't very stable. I calculated 20 (before only 5) independent frames to average over them (by now, it was made only for yellow and bloue lines).
New data gave the alignment above phase transition for large system (red and yellow line for $\gamma \geqslant 0.085$).
In current state we can see two distinguishable limits for large $\gamma$ that shows completely different configurations depending on the system size.
Another important point is "artifact" points in yellow and blue lines which have extremely low values. In fact, they appear in all systems at specific diaposon of $\gamma$ (0.045, 0.07), for red and green I removed them for readability. At first, I thought it's just an instability around critical point, but from the graph we can see that to types of glasses start matching only at $\gamma=0.085-0.9$.
<img src='https://hackmd.io/_uploads/S1bvRefv-x.png' width=400/>
After taking a look on every energy time series I saw an interesting behavior that I describe on the example $\gamma=0.045$ for HTL $N=10^4$.
On the picture below I drew every timeseries with its own fit (without any averaging over frames, in brown) and fit on minimum of all time series in every point of time (black).
We see 4 series that go far beyond normal deviation of results. It's a very significant number -- total number of frames is 20. Also, the form of the fits is noticable: they don't have a step-like shape and mostly look like logarithm. The histogram shows disribution of limits for every fit (black bar is aggregated fit).
My intuitive conculsion is the existance of a very longliving metastable state that goes as upper branch with the shape similar to volume-preserving case but much longer. The stable branch is quite misterious because its energies don't look realistic.
It's important to note that this effect start at $\gamma=0.045$ which is the threshold from volume preserving case and stops at approx $\gamma=0.08$ which is the point of merging energies' and fractions' lines.

The explanation of this effect may be appearing of cavities that make dynamics strongly outside equilibrium. To check this hypothesis I will make a computation cell visuialization within the cycle of compression.
#### Pressures
<img src='https://hackmd.io/_uploads/rJqXSXGDWg.png' width=400/>
#### Diffusion
<img src='https://hackmd.io/_uploads/rJEKPtiH-g.png' width=400/>
#### Structural change
Before extra calculations

After extra calculations for HTL.
We see HTL $N=10^3$ behaves as expected -- it flows in main stream at $\gamma=0.08$. It perfectly matches the same effect in energies.
There's still a problem with HTL $N=10^4$. It's doesn't undergoes sharp phase transition.
I have an idea to calculate fraction values not by averaging last steps but via fitting time series. For that I need to rewrite code a little to make it more effitient since these calculations are time consuming. May be, here we will also see two distinguishable types of convergence as in energies.
