Calculate the dipole moments of each frame in a trajectory.
An mdtraj trajectory.
- chargesnp.ndarray, shape=(n_atoms), dtype=float
Charges of each atom in the trajectory, expressed in units of the elementary charge constant.
- momentsnp.ndarray, shape=(n_frames, 3), dtype=float
Dipole moments of trajectory, units of nm * elementary charge.
This code works by first calculating displacements relative to the first atom in each residue (e.g. local frame). Then, this is added to the PBC-corrected displacement between the first atom in the two molecules. This total displacement is then used as to calculate the box dipole moment.