modifier

The Modifier object is the method by which javelin.mc.MC changes a javelin.structure.Structure.

All modifiers inherit from javelin.modifier.BaseModifier.

class javelin.modifier.BaseModifier(int number_of_cells=1, sites=0)

This class does not actually change the structure but is the base of all modifiers. The number_of_cells is number of random location that the modifier will change, for example swap type modifiers require 2 sites while shift requires only one. The methods self.initialize_cells(int number_of_cells) and self.initialize_sites(sites) must be called to set the number of cells and which sites to use.

cells
get_random_cells(self, Py_ssize_t size_x, Py_ssize_t size_y, Py_ssize_t size_z) → Py_ssize_t[:, :]

Sets internally and returns randomly selected cells, shape (number_of_cells, 3), based on size_x, size_y and size_z. This needs to be executed before self.run.

number_of_cells
run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void

Modifies the provided arrays (a, x, y, z) for cells selected by self.get_random_cells.

sites
undo_last_run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void

Undoes the last modification done by self.run.

By default it just executes self.run again assuming the process is reversible, such as swapping.

class javelin.modifier.SetDisplacementNormal(sites, double mu, double sigma)

Sets the atoms displacement in all directions to a random point in the normal distribution given by mu and sigma.

run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
undo_last_run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
class javelin.modifier.SetDisplacementNormalXYZ(sites, double x_mu, double x_sigma, double y_mu, double y_sigma, double z_mu, double z_sigma)

Sets the atoms displacement in all directions to a random point in the normal distribution given by mu and sigma for each direction.

run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
undo_last_run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
class javelin.modifier.SetDisplacementRange(sites, double minimum, double maximum)

Sets the atoms displacement in all directions to a random point in the given range.

run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
undo_last_run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
class javelin.modifier.SetDisplacementRangeXYZ(sites, double x_min, double x_max, double y_min, double y_max, double z_min, double z_max)

Sets the atoms displacement in all directions to a random point in the given range for each direction

run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
undo_last_run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
class javelin.modifier.ShiftDisplacementNormal(sites, double mu, double sigma)

Shifts the atoms displacement in all directions by a random amount in the normal distribution given by mu and sigma.

run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
undo_last_run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
class javelin.modifier.ShiftDisplacementNormalXYZ(sites, double x_mu, double x_sigma, double y_mu, double y_sigma, double z_mu, double z_sigma)

Shifts the atoms displacement in all directions by a random amount in the normal distribution given by mu and sigma for each direction.

run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
undo_last_run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
class javelin.modifier.ShiftDisplacementRange(sites, double minimum, double maximum)

Shifts the atoms displacement in all directions by a random amount in the given range.

run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
undo_last_run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
class javelin.modifier.ShiftDisplacementRangeXYZ(sites, double x_min, double x_max, double y_min, double y_max, double z_min, double z_max)

Shifts the atoms displacement in all directions by a random amount in the given range for each direction

run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
undo_last_run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
class javelin.modifier.Swap(sites)

Swap the atom occupancy and displacement at swap_site between two cells.

run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
class javelin.modifier.SwapDisplacement(sites)

Swap the atom displacement at swap_site between two cells.

run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void
class javelin.modifier.SwapOccupancy(sites)

Swap the atoms occupancy at swap_site between two cells.

run(self, int64_t[:, :, :, :] a, double[:, :, :, :] x, double[:, :, :, :] y, double[:, :, :, :] z) → void