mindspore.ops.DihedralForce
- class mindspore.ops.DihedralForce(*args, **kwargs)[source]
Calculate the force exerted by the dihedral term which made of 4-atoms on the corresponding atoms. Assume the number of dihedral terms is m and the number of atoms is n.
\[dr_{ab} = (x_b-x_a, y_b-y_a, z_b-z_a)\]\[dr_{cb} = (x_b-x_c, y_b-y_c, z_b-z_c)\]\[dr_{cd} = (x_d-x_c, y_d-y_c, z_d-z_c)\]\[r1 = dr_{ab}*dr_{cb}\]\[r2 = dr_{cd}*dr_{cb}\]\[phi = pi - sign(inner_product(r1*r2), dr_{cb}) * arccos(inner_product(r1, r2)/|r1|/|r2|)\]\[dEdphi = n*phi*(k*cos(phi_0)*sin(n*phi) - k*sin(phi_0)*cos(n*phi))/sin(phi)\]\[dphidr1 = r2/|r1|/|r2| + cos(phi)/|r1|^2*r1\]\[dphidr2 = r1/|r1|/|r2| + cos(phi)/|r2|^2*r2\]\[dEdra = dEdphi * dr_{cb} * dphidr1\]\[dEdrd = dEdphi * dphi_dr2 * dr_{cb}\]\[dEdrjpart = dEdphi * ((dr_{ab} * dphidr1) + (dr_{cd} * dphidr2))\]\[F_a = dEdri\]\[F_b = dEdrjpart - dEdri\]\[F_c = - dEdrl - dEdrjpart\]\[F_d = dEdrl\]- Parameters
dihedral_numbers (int32) – the number of dihedral terms m.
- Inputs:
dihedral_numbers (int32) - the number of dihedral terms m.
uint_crd_f (Tensor, uint32) - [n, 3], the unsigned int coordinates value of each atom.
scaler_f (Tensor, float32) - [3,], the 3-D scale factor between the real space float coordinates and the unsigned int coordinates.
atom_a (Tensor, int32) - [m,], the 1st atom index of each dihedral.
atom_b (Tensor, int32) - [m,], the 2nd atom index of each dihedral.
atom_c (Tensor, int32) - [m,], the 3rd atom index of each dihedral.
atom_d (Tensor, int32) - [m,], the 4th atom index of each dihedral. 4 atoms are connected in the form a-b-c-d.
ipn (Tensor, int32) - [m,], the period of dihedral angle of each dihedral.
pk (Tensor, float32) - [m,], the force constant of each dihedral.
gamc (Tensor, float32) - [m,], k*cos(phi_0) of each dihedral.
gams (Tensor, float32) - [m,], k*sin(phi_0) of each dihedral.
pn (Tensor, float32) - [m,], the floating point form of ipn.
- Outputs:
frc_f (Tensor, float32) - [n, 3], the force felt by each atom.
- Supported Platforms:
GPU