mindspore.ops.Constrain
- class mindspore.ops.Constrain(atom_numbers, constrain_pair_numbers, iteration_numbers, half_exp_gamma_plus_half, update_interval=10)[source]
Calculate the constraint force and virial depends on pressure calculation.
Warning
This is an experimental prototype that is subject to change and/or deletion.
- Parameters
atom_numbers (int32) – the number of atoms n.
constrain_pair_numbers (int32) – the number of constrain pairs m.
iteration_numbers (int32) – the number of iteration numbers p.
half_exp_gamma_plus_half (float32) – half exp_gamma plus half q.
update_interval (int32) – the number of update interval, default 10.
- Inputs:
crd (Tensor) - The coordinate of each atom. The data type is float32 and the shape is \((n, 3)\).
quarter_cof (Tensor) - The 3-D scale factor. The data type is float32 and the shape is \((3,)\).
mass_inverse (Tensor) - The inverse value of mass of each atom. The data type is float32 and the shape is \((n,)\).
scaler (Tensor) - The 3-D scale factor (x, y, z), The data type is float32 and the shape is \((3,)\).
pair_dr (Tensor) - The displacement vector of each constrained atom pair. The data type is float32 and the shape is \((m, 3)\).
atom_i_serials (Tensor) - The first atom index of each constrained atom pair. The data type is int32 and the shape is \((m,)\).
atom_j_serials (Tensor) - The second atom index of each constrained atom pair. The data type is int32 and the shape is \((m,)\).
constant_rs (Tensor) - The constrained distance of each constrained atom pair. The data type is float32 and the shape is \((m,)\).
constrain_ks (Tensor) - The coefficient of each constrained atom pair. The data type is float32 and the shape is \((m,)\).
need_pressure (Tensor) - If need pressure, 1 else 0. The data type is int32 and the shape is \((1,)\) or \(()\).
- Outputs:
uint_crd (Tensor) - The unsigned int coordinate value of each atom. The data type is uint32 and the shape is \((n, 3)\).
frc (Tensor) - The constraint force on each atom. The data type is float32 and the shape is \((n, 3)\).
virial (Tensor) - The constraint virial on each atom. The data type is float32 and the shape is \((m,)\).
- Supported Platforms:
GPU