3.1.1.4. Generating the potential slices of a model of MoS2 on amorphous C

In this example, we perform the “action” of generating the potential slices of a model of a sample of \(\text{MoS}_2\) on amorphous C.

NOTE: Users are advised to read the remainder of the current page in its entirety before trying to execute this action.

To execute the action, first we need to change into the directory <root>/examples/modelling/cbed/simulations/MoS2_amorphous_C/scripts, where <root> is the root of the emicroml repository. Then, we need to run the Python script ./execute_action.py via the terminal command:

python execute_action.py --action=<action> --use_slurm=<use_slurm>

where <action> must be equal to generate_potential_slices, and <use_slurm> is either yes or no. If <use_slurm> equals yes and a SLURM workload manager is available on the server from which you intend to run the script, then the action will be performed as a SLURM job. If <use_slurm> is equal to no, then the action will be performed locally without using a SLURM workload manager.

If the action is to be performed locally without using a SLURM workload manager, then prior to executing the above Python script, a set of Python libraries need to be installed in the Python environment within which said Python script is to be executed. See this page for instructions on how to do so. If the action is being performed as a SLURM job, then prior to executing any Python commands that do not belong to Python’s standard library, a customizable sequence of commands are executed that are expected to try to either activate an existing Python virtual environment, or create then activate one, in which the Python libraries needed to complete the action successfully are installed. See this page for instructions how to customize the sequence of commands.

We assume that the C atoms are subject to room temperature, and that their root-mean-square \(x\)-displacement is 0.141 Å. This value was taken from Ref. [Boothroyd1].

We assume that the Mo and S atoms are subject to room temperature. Furthermore, we assume that the root-mean-square (RMS) \(x\)-displacements of the Mo and S atoms are 0.069 Å and 0.062 Å respectively. These values were taken from Ref. [Schonfeld1].

The action described at the beginning of the current page takes automatically as input data output data generated by the actions described in the pages Generating the atomic coordinates of a model of MoS2 and Generating the atomic coordinates of a model of MoS2 on amorphous C, hence one must execute the two actions described in those two pages prior to the action described at the beginning of the current page. The action described at the beginning of the current page generates the potential slices of the model of the sample of \(\text{MoS}_2\) on amorphous C using the function prismatique.sample.generate_potential_slices(). Upon successful completion of this action, the output from the call to the aforementioned function is saved to the directory <root>/examples/modelling/cbed/simulations/MoS2_amorphous_C/data/potential_slice_generator_output. See the documentation for the function prismatique.sample.generate_potential_slices() for a description of all the output files that are generated by it.

In executing the action described at the beginning of the current page, multiple scripts are executed. The particular scripts that are executed depend on the command line arguments of the parent Python script introduced at the beginning of this page. If <use_slurm> equals yes, then the following scripts are executed in the order that they appear directly below:

<root>/examples/modelling/cbed/simulations/MoS2_on_amorphous_C/scripts/execute_action.py <root>/examples/modelling/cbed/simulations/MoS2_on_amorphous_C/scripts/generate_potential_slices/execute_all_action_steps.py <root>/examples/modelling/cbed/simulations/MoS2_on_amorphous_C/scripts/generate_potential_slices/prepare_and_submit_slurm_job.sh <root>/examples/modelling/cbed/simulations/MoS2_on_amorphous_C/scripts/generate_potential_slices/execute_main_action_steps.py

Otherwise, if <use_slurm> equals no, then the third script, i.e. the one with the basename prepare_and_submit_slurm_job.sh is not executed. See the contents of the scripts listed above for implementation details.