# mdtraj.compute_directors

mdtraj.compute_directors(traj, indices='chains')

  Compute the characteristic vector describing the orientation of each group

  In this definition, the long molecular axis is found from the inertia tensor, \(I_{ab}\), and is taken to be the eigenvector associated with the smallest eigenvalue of \(I_{ab}\).

  See [1] for brief summary and discussion on other methods to obtain the director.

  Parameters:

    - traj (Trajectory) – Trajectory to compute orientation of.

    - indices ({'chains', 'residues', list of lists}, optional, default='chains') – The group to consider. Users can pass their own indices as a list of lists with the “shape” (n_compounds, len(each_compound)). Recognized string keywords are ‘chains’ and ‘residues’.

  Returns:

    directors – Characteristic vectors describing the trajectory for each frame.

  Return type:

    np.ndarray, shape=(traj.n_frames, len(indices), 3), dtype=float64

  See also

  `compute_nematic_order`, `compute_inertia_tensor`

  Notes

  Since there is no preferred orientation of the director, the director \(n\) has the same meaning as \(-n\). Therefore, care should be taken to ensure the director is pointing in the direction you think it is, e.g., by constraining it to a hemisphere that makes physical sense.

  References

  [1]

  http://cmt.dur.ac.uk/sjc/thesis_dlc/node65.html