Reaction Network Monte Carlo
A three dimensional statistical field theory simulator which supports one and two site interactions useful for simulating nanoparticles. Some examples of single site interaction are optical transitions, multiphonon relaxation, or magnetic dipole. Two site interactions represent energy transfer events in which energy is transferred from one species to another.
Species in this case are dopants to the host matrix. For example, in a nanoparticle composed of a NaYF4 host, any lanthanide such as Yb3+ or Tm3 can be doped onto the Y3+ site. The 4f electrons of these lanthanides give rise to some number of excitation levels. Calculating the rates for the interactions is a non-trivial process, please refer to NanoParticleTools for this.
Sqlite is used for input, output, and checkpointing. Before running NPMC
two necessary .sqlite files must be generated - The Nano Particle Database and State Database. An example of the Python code used to generate these files is available in examples directory . Below is an outline of each .sqlite file and its necessary tables. Each .sqlite file must follow this format exactly.
There are four tables in the nanoparticle database all of which must be created and filled in by the user:
CREATE TABLE species (
species_id INTEGER NOT NULL PRIMARY KEY,
degrees_of_freedom INTEGER NOT NULL
);
CREATE TABLE sites (
site_id INTEGER NOT NULL PRIMARY KEY,
x REAL NOT NULL,
y REAL NOT NULL,
z REAL NOT NULL,
species_id INTEGER NOT NULL
);
CREATE TABLE interactions (
interaction_id INTEGER NOT NULL PRIMARY KEY,
number_of_sites INTEGER NOT NULL,
species_id_1 INTEGER NOT NULL,
species_id_2 INTEGER NOT NULL,
left_state_1 INTEGER NOT NULL,
left_state_2 INTEGER NOT NULL,
right_state_1 INTEGER NOT NULL,
right_state_2 INTEGER NOT NULL,
rate REAL NOT NULL
);
CREATE TABLE metadata (
number_of_species INTEGER NOT NULL,
number_of_sites INTEGER NOT NULL,
number_of_interactions INTEGER NOT NULL
);
There are five tables in the initial state database all of which must be created by the user:
CREATE TABLE initial_state (
site_id INTEGER NOT NULL PRIMARY KEY,
degree_of_freedom INTEGER NOT NULL
);
CREATE TABLE trajectories (
seed INTEGER NOT NULL,
step INTEGER NOT NULL,
time REAL NOT NULL,
site_id_1 INTEGER NOT NULL,
site_id_2 INTEGER NOT NULL,
interaction_id INTEGER NOT NULL
);
linear
and inverse_cubic
. CREATE TABLE factors (
one_site_interaction_factor REAL NOT NULL,
two_site_interaction_factor REAL NOT NULL,
interaction_radius_bound REAL NOT NULL,
distance_factor_type TEXT NOT NULL
);
CREATE TABLE interrupt_state (
seed INTEGER NOT NULL,
site_id INTEGER NOT NULL,
degree_of_freedom INTEGER NOT NULL
);
CREATE TABLE interrupt_cutoff (
seed INTEGER NOT NULL,
step INTEGER NOT NULL,
time REAL NOT NULL
);
To access the makefile, enter the NPMC
folder:
$ cd NPMC
Next create an executable with the makefile. The executable will be located in the build
folder.
$ make NPMC
For further help on the makefile and to view other commands:
$ make help
NPMC
requires six input arguments (either step_cutoff
or time_cutoff
must be specified):
base_seed, base_seed+1, ..., base_seed+number_of_simulations-1
When running NPMC
ensure that your input file paths are correct considering the executable is inside the build
folder. Below is an example of how NPMC
can be run using the input files inside the examples directory (here step_cutoff
is specified):
build/NPMC --nano_particle_database=examples/NPMC/np.sqlite --initial_state_database=examples/NPMC/initial_state.sqlite --number_of_simulations=1000 --base_seed=1000 --thread_count=8 --step_cutoff=200 --checkpoint=1
Running this command does not generate any new files or directories but will populate the initial_state_database
with trajectory data.