RandomDirection

class RandomDirection(magnitude=None)

Used to generate random directions.

Parameters:

magnitude (PhysicalQuantity of type length or tuple.) – The magnitude of the returned directions. If this is a scalar, all the directions will have the same magnitude. If it is a tuple, the magnitude will be randomly chosen between the two values.
Default: 1 * Angstrom

getMagnitude()

Get the magnitude of the directions.

Returns:

The magnitude of the directions.

Return type:

PhysicalQuantity of type length

getNextDirection()

Get the next direction.

Returns:

The next random direction.

Return type:

numpy.ndarray

initialize(num_dimensions)

Initialize the generator with the number of dimensions.

Parameters:

num_dimensions (int) – The number of dimensions of the generated vectors.

isInitialized()

Check if the generator is initialized.

Returns:

True if the generator is initialized.

Return type:

bool

reset()

Reset the direction generator.

Notes

RandomDirection is used to generate initial directions for the different saddle search methods in AdaptiveKineticMonteCarlo. RandomDirection uses a naive approach where a set of number of random numbers are first generated. The random numbers are used to create a vector which is normalized and then multiplied with the specified magnitude.

After instantiating a new RandomDirection object, the initialize() method should be called the desired number of vector components an argument.