exercises:2014_ethz_mmm:monte_carlo_ice
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
exercise:monte_carlo_ice [2014/05/23 13:00] – sclelia | exercises:2014_ethz_mmm:monte_carlo_ice [2020/08/21 10:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
+ | <note important> | ||
+ | - Add the line '' | ||
+ | - Add the line '' | ||
+ | </ | ||
In this exercise we will use Monte Carlo sampling to calculate the [[wp> | In this exercise we will use Monte Carlo sampling to calculate the [[wp> | ||
Line 13: | Line 18: | ||
The advantage of Monte Carlo is that we can employ special hydrogen reordering moves, which lead to an effective sampling of the dipole. | The advantage of Monte Carlo is that we can employ special hydrogen reordering moves, which lead to an effective sampling of the dipole. | ||
- | Run the input-file '' | + | Run the input-file '' |
The dielectric constant can then calculated from the dipole moments via: | The dielectric constant can then calculated from the dipole moments via: | ||
Line 43: | Line 48: | ||
for fn in sys.argv[2: | for fn in sys.argv[2: | ||
print " | print " | ||
+ | assert(fn.endswith(" | ||
raw_data = np.loadtxt(fn) # [C*Angstrom] | raw_data = np.loadtxt(fn) # [C*Angstrom] | ||
weights.append(raw_data[1:, | weights.append(raw_data[1:, | ||
Line 56: | Line 62: | ||
print "Mean cell volume: %.2f Angstrom^3" | print "Mean cell volume: %.2f Angstrom^3" | ||
- | M_norm = np.sqrt(np.sum(np.square(M_vec), | ||
M = np.sqrt(np.sum(np.square(M_vec), | M = np.sqrt(np.sum(np.square(M_vec), | ||
var = np.average(np.square(M), | var = np.average(np.square(M), | ||
Line 80: | Line 85: | ||
===== Task 2: Gather more samplings ===== | ===== Task 2: Gather more samplings ===== | ||
- | You can gather more samples by launching multiple independent runs in parallel. The python-script | + | You can gather more samples by launching multiple independent runs in parallel |
< | < | ||
you@brutusX ~$ ./ | you@brutusX ~$ ./ | ||
Line 88: | Line 93: | ||
</ | </ | ||
===== Task 3: Calculate the thermal expansion coefficient ===== | ===== Task 3: Calculate the thermal expansion coefficient ===== | ||
- | Run the MC sampling again at temperatures | + | Run the MC sampling again at temperature |
===== Required Files ===== | ===== Required Files ===== | ||
==== Initial Coordinates ==== | ==== Initial Coordinates ==== | ||
- | {{:exercise:ice_ih_96.xyz.gz| Download here}} | + | {{ice_ih_96.xyz.gz| Download here}} |
Line 102: | Line 107: | ||
RUN_TYPE TMC | RUN_TYPE TMC | ||
PRINT_LEVEL LOW | PRINT_LEVEL LOW | ||
- | WALLTIME | + | WALLTIME |
&END GLOBAL | &END GLOBAL | ||
&MOTION | &MOTION | ||
&TMC | &TMC | ||
+ | RND_DETERMINISTIC 42 !<=== Change this number to obtain different samplings | ||
+ | PRINT_COORDS .FALSE. !this avoids the file-size problem | ||
GROUP_CC_SIZE 0 | GROUP_CC_SIZE 0 | ||
NUM_MC_ELEM 100000 | NUM_MC_ELEM 100000 |
exercises/2014_ethz_mmm/monte_carlo_ice.1400850052.txt.gz · Last modified: 2020/08/21 10:14 (external edit)