mdtraj.utils.uniform_quaternion(size=None, random_state=None)

Generate uniform normalized quaternion 4-vectors

sizeint or tuple of ints, optional

Defines the shape of the returned array of quaternions. If None (the default), returns a quaternion 4-vector.

random_stateinteger or numpy.RandomState, optional

The generator used for random numbers. If an integer is given, it fixes the seed. Defaults to the global numpy random number generator.


Array of quaternion 4-vectors. Given a size of, for example, (m,n), m*n samples are generated. Because each sample is 4-dimensional, the output shape is ``(m,n,4)`. If no shape is specified, a single (4-D) sample is returned.