You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-4Lines changed: 46 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,12 +64,54 @@ This will build the `particlesmc` executable at `~/.julia/bin` (please add this
64
64
65
65
### Running a Monte Carlo Simulation
66
66
67
-
To run a Monte Carlo simulation, you need to define the systems and moves, and then use the provided functions to execute the simulation. Here is a basic example:
68
-
69
-
Add example code
70
-
```julia
67
+
To run a Monte Carlo simulation, you need an input atomic or molecular configuration file (typically with a `.xyz` extension) and a parameter file (in `TOML` format). The parameter file specifies both the system details (such as temperature, density, and interaction model) and the simulation details (such as simulation type, number of steps, Monte Carlo moves, and outputs). A minimal example is presented below. More detailed explanations can be found in the documentation.
68
+
69
+
**params.toml**
70
+
```toml
71
+
[system]
72
+
config = "config.xyz"
73
+
temperature = 1.0
74
+
density = 1.19206
75
+
list_type = "LinkedList"
76
+
77
+
[model]
78
+
[model."1-1"]
79
+
name = "LennardJones"
80
+
epsilon = 1.0
81
+
sigma = 1.0
82
+
rcut = 2.5
83
+
84
+
[simulation]
85
+
type = "Metropolis"
86
+
steps = 500
87
+
seed = 10
88
+
parallel = false
89
+
output_path = "./"
90
+
91
+
[[simulation.move]]
92
+
action = "Displacement"
93
+
probability = 1.0
94
+
policy = "SimpleGaussian"
95
+
parameters = {sigma = 0.05}
96
+
97
+
[[simulation.output]]
98
+
algorithm = "StoreTrajectories"
99
+
scheduler_params = {linear_interval = 50}
100
+
fmt = "XYZ"
71
101
```
72
102
103
+
**Explanation of the example:**
104
+
105
+
This example defines a minimal Monte Carlo simulation setup:
106
+
107
+
- The `[system]` section specifies the input configuration file (`config.xyz`), the simulation temperature and density, and the use of a linked list for neighbor searching.
108
+
- The `[model]` section defines the interaction potential between particles. Here, a Lennard-Jones potential is used for species pair "1-1" with specified parameters (`epsilon`, `sigma`, and cutoff `rcut`).
109
+
- The `[simulation]` section sets the simulation type to Metropolis, the number of Monte Carlo steps to 500, the random seed, whether to run in parallel, and the output path.
110
+
- The `[[simulation.move]]` section describes the Monte Carlo move to use: a displacement move with probability 1.0, guided by a simple Gaussian policy with a standard deviation (`sigma`) of 0.05.
111
+
- The `[[simulation.output]]` section configures the output: trajectories will be stored every 50 steps in the XYZ format.
112
+
113
+
By executing `particlesmc params.toml` you will run a basic Metropolis Monte Carlo simulation of particles interacting via the Lennard-Jones potential, using displacement moves, and periodically saving the system's trajectory.
114
+
73
115
## Contributing
74
116
75
117
We welcome contributions from the community. If you have a new system or feature to add, please fork the repository, make your changes, and submit a pull request.
0 commit comments