 ### polymer rewrite without PERM and figures

parent f5d407f2
Pipeline #57444 passed with stages
in 1 minute and 31 seconds
 # Simulating polymers as self-avoiding random walks ## Background: polymers and how to characterize them Polymers are large molecules composed of several repeating subunits (the monomers). They play an important role in our everyday life, ranging from biological processes to synthetic materials (see [Polymers on Wikipedia](https://en.wikipedia.org/wiki/Polymer) for more background). In this project we want to simulate polymers that are linear and unbranched, and that are immersed in a good solvent. The latter condition of being in a good solvent means that different polymers are separated from each other and will not interact. We can thus consider the physics of a single polymer alone. One particular property of a polymer is its lack of rigidity: in general polymers are rather floppy. We will not describe this from a microscopic model (such as quantum chemistry), but we will instead use a more simplistic toy model described below. Before we do that, let us however first consider how we can *quantitatively* describe a polymer. We can assign the \$i\$-th subunit of the polymer a coordinate vector \$\mathbf{r}_i\$. A linear polymer consisting of \$L+1\$ subunits is then described by a ordered set of points \$\{\mathbf{r}_0, \mathbf{r}_1, \dots, \mathbf{r}_L\}\$. Note that there are \$L+1\$ subunits, but \$L\$ bonds between the subunits. We can characterize the polymer by its end-to-end distance: \$\$r_e^2(L) = \left|\mathbf{r}_L - \mathbf{r}_0\right|^2\,.\$\$ Alternatively, we can use the radius of gyration that is given by \$\$r_g^2(L) = \frac{1}{L+1} \sum_{i=0}^L \left|\mathbf{r}_i - \mathbf{r}_\text{cm}\right|^2\,,\$\$ where \$\mathbf{r}_\text{cm} = \frac{1}{L+1} \sum_{i=0}^L \mathbf{r}_i\$ is the center of mass of the polymer. The radius of gyration describes how "curled up" the polymer is. ## Model: Polymers as a self-avoiding random walk on a lattice We will now give a complete description of the polymer toy model. We will continue to describe a polymer by an ordered set of points \$\{\mathbf{r}_0, \mathbf{r}_1, \dots, \mathbf{r}_L\}\$. In a polymer, the distance between subunits is determined by the length of the chemical bonds, and we will thus assume a fixed bond length \$a\$ between subunits \$\left|\mathbf{r}_{i+1} - \mathbf{r}_i\right| = a\$. In contrast, for many polymers the angle between bonds is far less restricted, and we use this as the degree of freedom that determines the shape of the polymer. To simplify the model even further, we will assume that the angle between different bonds is restricted to be a multiple of \$90\degree\$. In doing so, we restrict the polymer points \$\mathbf{r}_i\$ to be on a square lattice with lattice constant \$a\$. Without restricting generality, we can set \$a=1\$. In the above example, you may already see the last ingredient for our toy model: Since a polymer has a finite extent in space, two subunits cannot come too close. In our lattice model we implement this by demanding that one lattice point cannot be occupied by two different subunits. In other words: \$\mathbf{r}_i \neq \mathbf{r}_j\$ for all \$i \neq j\$. With these assumptions, our polymer model becomes a *self-avoiding random walk on a square lattice*. For such a self-avoiding random walk, the end-to-end distance and the radius of gyration are known to obey a scaling law: \$\$\langle r^2_e(L)\rangle \sim L^{2\nu}\,\$\$ \$\$\langle r^2_g(L)\rangle \sim L^{2\nu}\,\$\$ where \$\nu = 3/4\$ for 2D, and \$\nu\approx 3/5\$ in 3D. (For more details, see [the information at this link](https://polymerdatabase.com/polymer%20physics/SAW.html)). **The goal of this project is to reproduce the findings (for 2D).** The behavior of the self-avoiding random walk should be contrasted to the free random walk where both backtracking (the random walk takes a step back: \$\mathbf{r}_{i+2} = \mathbf{r}_i\$) and intersections are allowed: For the free random walk the scaling behavior is well-known and we have \$\nu = 1/2\$. ## Why sampling polymers is hard In principle, our problem looks easy, as we have a very simple model, where every self-avoiding random walk of length \$L\$ has the same probability. We could actually attempt to do a complete sampling of all possible polymers of a given length, and in this way compute the ensemble average exactly. To this end, we could generate all possible free random walks of length \$L\$ without back-tracking and throw away all intersecting walks. This however becomes exceedingly difficult very fast: At every step of the free random walk we have 3 possible directions, hence there are \$3^L\$ possible free random walks. For example, even for rather short walks like \$L=20\$ this gives already \$3^{20} \approx 3 \times 10^9\$ possibilities. It would thus be desirable to sample in the spirit of the Monte Carlo method only a small set of self-avoiding random walks, and use these to estimate the end-to-end distance/radius of gyration. ## The Rosenbluth method ### Description of the algorithm The first such sampling method was developed by [Rosenbluth and Rosenbluth in 1955]( https://doi.org/10.1063/1.1741967). Apart from the numerical method we will describe in a moment, this paper also contains a noteworthy overview of previous attempts, such as: >To the best of the authors' knowledge the first numerical calculations of chain length were made by Dr. Ei Teramoto of Kyoto University, who performed the remarkable feat of evaluating chain lengths in the two-dimensional case up to N = 20 by a hand calculation cataloging all possible chains. You don't have to do this for the final report ;-) The Rosenbluth method generates \$N\$ different polymers/self-avoiding random walks independently from each other, by growing every polymer individually. The polymer is grown successively by adding a new subunit \$\mathbf{r}_i\$to the end of the polymer, choosing randomly one of the \$m_i\$ unoccupied lattice sites adjacent to \$\mathbf{r}_{i-1}\$. You can then encounter different situations: Note that in the latter case \$m_i=0\$ no new subunit can be added, and the polymer sampling cannot continue beyond a certain length. This process is repeated \$N\$ times. For each polymer \$k\$ (with \$k\$ denoting the polymer index, \$k=1,\dots, N\$) we record all positions \$\{\mathbf{r}_{k, 1}, \dots, \mathbf{r}_{k, L}\}\$ (we can let all polymers start from the same initial point \$\mathbf{r}_{k, 0}\$). In addition, we record for every polymer the *weight* \$\$w_k^{(L)} = \prod_{i=1}^L m_{k, i}\,, \tag{1}\$\$ where \$m_{k, i}\$ is the number of available positions to place the new subunit \$\mathbf{r}_i\$ while growing polymer \$k\$. The average end-to-end distance or radius of gyration are then given by the *weighted average* \$\$\langle r^2(L) \rangle = \frac{ \sum_{k=1}^N w_k^{(L)} r^2_{k}(L)}{\sum_{k=1}^N w_k^{(L)}} \tag{2}\$\$ where \$r_k(L)\$ is the value of the desired observable computed from polymer \$k\$. Let us make some observations here: 1. When generating \$N\$ polymers of length \$L\$ (disregarding the case where the polymer got stuck in the growing process), we also generate \$N\$ polymers of all lengths \$
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!