dpdata will disturb the box size and shape and change atom coordinates randomly.
dpdata.System('./POSCAR').perturb(pert_num=3,
box_pert_fraction=0.02,
atom_pert_fraction=0.01,
atom_pert_style='normal')
pert_num
Each frame in the input system will generate pert_num
frames.
That means the command will return a system containing frames of input system * pert_num
frames.
box_pert_fraction
A relative length that determines the length the box size change in each frame. It is just a fraction and doesn't have unit. Typlicaly, for cubic box with side length a
, a
will increase or decrease a random value from the intervel [-a*box_pert_fraction, a*box_pert_fraction]
.
It will also change the shape of the box. That means an orthogonal box will become a non-orthogonal box after perturbing. The angle of inclination of the box is a random variable.
box_pert_fraction
is also relating to the probability distribution function of the angle.
See more details about how it will change the box below.
atom_pert_fraction
A relative length that determines the length atom moves in each frame. It is just a fraction and doesn't have unit. Typlicaly, for a cubic box with side length a
, the mean value of the distance that atom moves is approximate a*atom_pert_fraction
.
atom_pert_style
The probability distribution function used to change atom coordinates.
available options:'uniform' 'normal' 'const'
.
uniform
means that if the box is a cube with side length a
, how far atoms in the cube move is a random vector with max length a*atom_pert_fraction
.
normal
means the squares of the distance atoms move are subject to a chi-square distribution with 3 degrees of freedom (chi-square distribution can be seen as the sum of squares of normal distributed random variable. This is why we name this option as 'normal'.).
If the box is a cube with side length a
, the mean value of the distance atom moves is a*atom_pert_fraction
.
const
means that if the box is a cube with side length a
, the distance atom moves is always a*atom_pert_fraction
(For triclinic box, the distances are not equal.)
The direction atoms move and box deformation is random.
See more details about how atoms will move below.
For each frame in the input system,dpdata will repeat the following steps pert_num
times. That means the command will return a system containing frames of input system * pert_num
frames.
dpdata will generate a perturb matrix
distrubution on interval
That is
The origin box matrix of this frame is defined as
The box matrix after deformation will be
The atom coordinates in this frame will change correspondingly.
That is,
for atom with index
the coordinate after deformation
That is:
For each atom with index
The method used to generate
That is:
The expectation value of atom_pert_fraction
.That is:
That is:
The point is chosen with equal probability. That means for arbitrary two subsets of the 3D sphere and its internal space
The following method is used to generate such
random direction of equal probability
let
become a 3 dimension standard normal distribution. That is
and
Nowpoint to a point located at the surface of the 3D unit sphere.
random point of equal probability
let
become a random variable which is object to the uniform on interval [0,1]. That is:
and defineas the 3th root of (because it is 3 dimension), That is:
Then the target vectoris
The definition of
and it is obvious that
After the
At the beginning, dpdata will create an empty system.
perturbed_system = System()
After every single perturbed frame is generated, it will be appended to the perturbed_system
.
perturbed_system will contain pert_num * frames of the input system
frames.
System.data['cells'][0]
)
System.data['coords'][0][j]
)
note: 0 means the index of the frame, j means atom index,
Finally dpdata will return perturbed_system
as results.