API Documentation¶
Initialize the system¶
For initialize the sysetm, the generate_initial_state() will generate an initial state either in a random way or import from a .xyz file.
Generates initial state of the system. |
Tip
The .xyz file will give the coordinates of all the particles. If the method is random, num_particles and box_length are required arguments.
Class Box¶
This is the class to generate a box, with the particles parameters.
|
In the class, we have functions as follows:
|
This is for wraping all particles in the box, updating the coordinates. |
Computes the minimum image distance between two particles. |
And we set the volume and num_particles as properties, can be called as:
Property decorator function which calculates the volume of the cubic simulation box :param box_length: Side of cubic simulation box. |
|
Property decorator function which calculates the number of particles in the cubic simulation box :param coordinates: A numpy array with the x,y and z coordinates of each atom in the simulation box. |
Class MCState¶
In the class MCState, we will have functions for the energies in the defined system:
|
In the class, we can calculate total pair energy, tail correction, unit energy and particle energy by functions as follows:
Computes the total energy of the system. |
|
Computes the standard tail correction for Lennard Jones potential. |
|
Compute the unit energy of per particles in the system. |
|
This function computes the energy of a particle with the rest of the system. |
Monte Carlo Steps¶
After that the Monte Carlo will determine the acceptance of each movement with accept_or_reject():
|
Accepts or rejects a move based on the energy difference between initial and updated state along with system temperature |
Optimization¶
Optimization of the scale of displacement can be done by adjust_displacement():
Adjusts the maximum value allowed for a displacement move. |