This repository is a combination of Persistence Length Using Monte Carlo Sampling and Using Transfer Matrix.
Statistical Averaging of Dihedral Angles — Single-Step Average Rotation Operator Dihedral angles are random (according to a known potential energy distribution), so for a given position i, we define the single-step average rotation operator as:
where
Since
and
where
Since each step is the action of a linear operator (with independent dihedral angles), the average transformation for n steps can be written as a product of operators:
the autocorrelation is:
where
If the chain is periodic (a repeating unit has M segments, where
Then, the correlation for
This project uses Flory's Generator Matrix method to accurately calculate the mean square end-to-end distance <R²> of polymers. This method, based on transfer matrix theory, can efficiently calculate the statistical properties of chain-like polymers.
The generator matrix G_i is a 5×5 matrix with the following structure:
where:
-
$\vec{l}_i$ is the vector of the i-th bond -
$M_{i+1}$ is the transfer matrix of the (i+1)-th bond -
$l_i$ is the length of the i-th bond - Due to the definition of angles and rotations (rotate first then draw bond),
$l_i$ is related to$M_{i+1}$ . In Flory's original definition (draw bond first then rotate),$\vec{l}_i$ is related to$M_i$ .
For periodic chains, the generator matrix of one repeating unit G_unit is the product of individual G_i matrices:
The mean square end-to-end distance can be calculated through powers of the generator matrix:
where n is the number of repeating units. This method avoids statistical errors in Monte Carlo sampling and can accurately calculate the mean square end-to-end distance for arbitrary chain lengths.
The persistence length describes the degree of directional correlation decay in polymer chains. This project provides two calculation methods:
(1) Geometric Persistence Length: Defined as the projection of the average end-to-end vector of an infinitely long chain onto the direction of the first bond
where M is the average rotation matrix and p is the average bond vector.
(2) Worm-Like Chain Approximation Persistence Length: Defined as the product of effective correlation length and effective unit length obtained using the worm-like chain formula.
The Worm-Like Chain (WLC) model is a continuous model for describing semiflexible polymers. In this project, equivalent WLC model parameters can be obtained by matching the asymptotic behavior of the exact mean square end-to-end distance <R²> of discrete chains.
This method is implemented through the following steps:
① Calculate the mean square end-to-end distance <R²> expression for the discrete chain:
where:
-
$A = s + \vec{n}^T(I-M)^{-1}\vec{p}$ (slope) -
$B = -\vec{n}^T(I-M)^{-2}\vec{p}$ (intercept) -
$\vec{n} = G_{unit}[0, 1:4], \vec{p} = G_{unit}[1:4, 4]$ are correlation vector and average unit vector extracted from the generator matrix -
$M$ is the transfer matrix of the unit,$s$ is the value of$G_{unit}[0, 4]$
② Calculate effective correlation length
③ Calculate worm-like chain approximation persistence length:
Compared to the literature Predicting Chain Dimensions of Semiflexible Polymers from Dihedral Potentials which directly uses the correlation length
See the original paper Predicting Chain Dimensions of Semiflexible Polymers from Dihedral Potentials for details. Note in this repository, the definition of deflection angles is different from the paper (moveing the last angle in the original paper to the first).
- T-bond-DPP-bond-T-bond-T-bond-E-bond-T-bond
- l = [2.533, 1.432, 3.533, 1.432, 2.533, 1.432, 2.533, 1.433, 1.363, 1.433, 2.533, 1.432] # in Angstrom
- 2.533 is the bond length of Thiophene (l[0])
- 1.432 is the bond length of first linker (l[1])
- Angle = np.deg2rad(np.array([-14.92, -10.83, 30.79, -30.79, 10.83, 14.92, -14.91, -13.29, -53.16, 53.16, 13.29, 14.91])) # convert degree to radian
- labels = {1: {'label': 'T-DPP', 'color': 'b'}, 2: {'label': 'T-T', 'color': 'm'}, 3: {'label': 'T-E', 'color': 'c'}}
- rotation = np.array([0, 1, 0, 1, 0, 2, 0, 3, 0, 3, 0, 2])
- l[1] rotated by rotation_type 1 with a deflection angle Angle[1]
- Add the Monte Carlo sampling method using Cython
- Add the rotational isomeric state (RIS) model and the mixed HR-RIS model using the same logic (Add 'type': 'ris' to labels)