Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mc moves #109

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions aiida_lsmo/workchains/sim_annealing.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from aiida_lsmo.calcfunctions.ff_builder_module import load_yaml

from .isotherm import get_molecule_dict, get_ff_parameters
from .parameters_schemas import FF_PARAMETERS_VALIDATOR, Required
from .parameters_schemas import FF_PARAMETERS_VALIDATOR, Required, Optional

# import sub-workchains
RaspaBaseWorkChain = WorkflowFactory('raspa.base') # pylint: disable=invalid-name
Expand Down Expand Up @@ -109,7 +109,15 @@ class SimAnnealingWorkChain(WorkChain):
Required('mc_steps', default=int(1e3), description='Number of MC cycles.'):
int,
Required('number_of_molecules', default=1, description='Number of molecules loaded in the framework.'):
int
int,
Optional('reinsertion_probability',
default=float(1.0),
description='Relative probability to perform a reinsertion move.'):
float,
Optional('randomtranslation_probability',
default=float(0.0),
description='Relative probability to perform a random translation move.'):
float
})
parameters_info = parameters_schema.schema # shorthand for printing

Expand Down Expand Up @@ -167,7 +175,8 @@ def _get_raspa_nvt_param(self):
self.ctx.molecule['name']: {
'MoleculeDefinition': 'Local',
'TranslationProbability': 1.0,
'ReinsertionProbability': 1.0,
'ReinsertionProbability': self.ctx.parameters['reinsertion_probability'],
'RandomTranslationProbability': self.ctx.parameters['randomtranslation_probability'],
'CreateNumberOfMolecules': self.ctx.parameters['number_of_molecules'],
},
},
Expand Down Expand Up @@ -199,11 +208,7 @@ def setup(self):
self.ctx.molecule = self.inputs.molecule

# Get the parameters Dict, merging defaults with user settings
@calcfunction
def get_valid_dict(dict_node):
return Dict(dict=self.parameters_schema(dict_node.get_dict()))

self.ctx.parameters = get_valid_dict(self.inputs.parameters)
self.ctx.parameters = Dict(dict=self.parameters_schema(self.inputs.parameters.get_dict()))

# Initialize the input for raspa_base, which later will need only minor updates
self.ctx.inp = self.exposed_inputs(RaspaBaseWorkChain, 'raspa_base')
Expand Down
4 changes: 3 additions & 1 deletion examples/run_SimAnnealingWorkChain_HKUST-1_3xDMA.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def main(raspa_code):
'ff_framework': 'UFF', # (str) Forcefield of the structure.
'temperature_list': [300, 150], # (list) List of decreasing temperatures for the annealing.
'mc_steps': int(10), # (int) Number of MC cycles.
'number_of_molecules': 3 # (int) Number of molecules loaded in the framework.
'number_of_molecules': 1 # (int) Number of molecules loaded in the framework.
# 'reinsertion_probability': float(0.0),
# 'randomtranslation_probability': float(1.0),
})

run(builder)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# critical constants: Temperature [T], Pressure [Pa], and Acentric factor [-] (file generated by aiida-raspa)
304.19
7382000
0.228
# Number Of atoms
3
# Number of groups (only whole molecule)
1
# Group-1: rigid/flexible
rigid
# Group-1: Number of atoms
3
# Group-1: Atomic positions
0 O_co2 0 0 1.16
1 C_co2 0 0 0
2 O_co2 0 0 -1.16
# Chiral centers Bond BondDipoles Bend UrayBradley InvBend Torsion Imp. Torsion Bond/Bond Stretch/Bend Bend/Bend Stretch/Torsion Bend/Torsion IntraVDW IntraCoulomb
0 2 0 0 0 0 0 0 0 0 0 0 0 0 0
# Bond stretch: atom n1-n2, type, parameters
0 1 RIGID_BOND
0 2 RIGID_BOND
# Number of config moves
0

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Cell info:
========================================================================
number-of-unit-cells: 4 2 2
unit-cell-vector-a: 6.999010000000 0.000000000000 0.000000000000
unit-cell-vector-b: -2.333967534586 15.064165518126 0.000000000000
unit-cell-vector-c: -2.333325540663 -7.531873256093 13.046302663032

cell-vector-a: 27.996040000000 0.000000000000 0.000000000000
cell-vector-b: -4.667935069171 30.128331036252 0.000000000000
cell-vector-c: -4.666651081327 -15.063746512187 26.092605326064

cell-lengths: 6.999010000000 15.243900000000 15.244000000000
cell-angles: 117.699000000000 98.804600000000 98.807100000000


Maximum changes for MC-moves:
========================================================================
Maximum-volume-change: 0.006250
Maximum-Gibbs-volume-change: 0.025000
Maximum-box-shape-change: 0.100000 0.100000 0.100000, 0.100000 0.100000 0.100000, 0.100000 0.100000 0.100000


Acceptance targets for MC-moves:
========================================================================
Target-volume-change: 0.500000
Target-box-shape-change: 0.500000
Target-Gibbs-volume-change: 0.500000


Components: 1 (Adsorbates 1, Cations 0)
========================================================================
Component 0 (CO2)
Fractional-molecule-id component 0: -1
Lambda-factors component 0: 0.000000 0.000000 0.000000
Number-of-biasing-factors component 0: 21
Biasing-factors component 0: 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
Maximum-CF-Lambda-change component 0: 0.500000
Maximum-CBCF-Lambda-change component 0: 0.500000

Maximum-translation-change component 0: 1.000000,0.714286,0.500000
Maximum-translation-in-plane-change component 0: 0.000000,0.000000,0.000000
Maximum-rotation-change component 0: 0.436332 0.981748 0.327249

Reactions: 0

Component: 0 Adsorbate 1 molecules of CO2
------------------------------------------------------------------------
Adsorbate-atom-position: 0 0 2.292997246259 12.304905106384 15.998582371191
Adsorbate-atom-position: 0 1 2.286953251473 11.236937279774 16.451360673954
Adsorbate-atom-position: 0 2 2.280909256687 10.168969453163 16.904138976716
Adsorbate-atom-velocity: 0 0 0.587314427151 -0.171941668227 -0.714928402441
Adsorbate-atom-velocity: 0 1 0.098066881956 0.128930754635 -0.011791666479
Adsorbate-atom-velocity: 0 2 -0.391180663238 0.429803177497 0.691345069482
Adsorbate-atom-force: 0 0 1341.350026907245 792.682599006407 -2566.140379039859
Adsorbate-atom-force: 0 1 -976.475518123466 -2138.208781827630 291.469492586537
Adsorbate-atom-force: 0 2 -262.378037693601 -695.425504107459 -1084.641711305106
Adsorbate-atom-charge: 0 0 -0.350000000000
Adsorbate-atom-charge: 0 1 0.700000000000
Adsorbate-atom-charge: 0 2 -0.350000000000
Adsorbate-atom-scaling: 0 0 1.000000000000
Adsorbate-atom-scaling: 0 1 1.000000000000
Adsorbate-atom-scaling: 0 2 1.000000000000
Adsorbate-atom-fixed: 0 0 0 0 0
Adsorbate-atom-fixed: 0 1 0 0 0
Adsorbate-atom-fixed: 0 2 0 0 0


Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
_cell_length_a: 6.999010
_cell_length_b: 15.243900
_cell_length_c: 15.244000
_cell_length_alpha: 117.699000
_cell_length_beta: 98.804600
_cell_length_gamma: 98.807100
_symmetry_space_group_name_Hall: P 1 found space group: 1
_symmetry_space_group_name_H-M: P 1 found space group: 1
space group found from symmetry elements: 1 (nr elements: 1)
End reading cif-file
Writing Crash-file!: 0
Writing Crash-file!: 10
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# rules to overwrite (file generated by aiida-raspa)
0
# number of defined interactions
0
# mixing rules to overwrite
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# general rule for shifted vs truncated (file generated by aiida-raspa)
truncated
# general rule tail corrections
yes
# number of defined interactions
105
# atom_type, interaction, parameters
Ac_ lennard-jones 16.608 3.0985
Ag_ lennard-jones 18.1178 2.8045
Al_ lennard-jones 254.152 4.0082
Am_ lennard-jones 7.0458 3.0121
Ar_ lennard-jones 93.1052 3.446
As_ lennard-jones 155.5108 3.7685
At_ lennard-jones 142.929 4.2318
Au_ lennard-jones 19.6276 2.9337
B_ lennard-jones 90.5888 3.6375
Ba_ lennard-jones 183.1907 3.299
Be_ lennard-jones 42.7781 2.4455
Bi_ lennard-jones 260.6945 3.8932
Bk_ lennard-jones 6.5425 2.9747
Br_ lennard-jones 126.3211 3.732
C_ lennard-jones 52.8435 3.4309
Ca_ lennard-jones 119.7786 3.0282
Cd_ lennard-jones 114.7458 2.5373
Ce_ lennard-jones 6.5425 3.168
Cf_ lennard-jones 6.5425 2.9515
Cl_ lennard-jones 114.2426 3.5164
Cm_ lennard-jones 6.5425 2.9631
Co_ lennard-jones 7.0458 2.5587
Cr_ lennard-jones 7.5491 2.6932
Cs_ lennard-jones 22.6472 4.0242
Cu_ lennard-jones 2.5164 3.1137
Dy_ lennard-jones 3.5229 3.054
Er_ lennard-jones 3.5229 3.021
Es_ lennard-jones 6.0393 2.9391
Eu_ lennard-jones 4.0262 3.1119
F_ lennard-jones 25.1636 2.997
Fe_ lennard-jones 6.5425 2.5943
Fm_ lennard-jones 6.0393 2.9275
Fr_ lennard-jones 25.1636 4.3654
Ga_ lennard-jones 208.8576 3.9048
Gd_ lennard-jones 4.5294 3.0005
Ge_ lennard-jones 190.7398 3.813
H_ lennard-jones 22.1439 2.5711
He_ lennard-jones 28.1832 2.1043
Hf_ lennard-jones 36.2355 2.7983
Hg_ lennard-jones 193.7594 2.4099
Ho_ lennard-jones 3.5229 3.0371
I_ lennard-jones 170.609 4.009
In_ lennard-jones 301.4595 3.9761
Ir_ lennard-jones 36.7388 2.5302
K_ lennard-jones 17.6145 3.3961
Kr_ lennard-jones 110.7197 3.6892
La_ lennard-jones 8.5556 3.1377
Li_ lennard-jones 12.5818 2.1836
Lr_ lennard-jones 5.536 2.8829
Lu_ lennard-jones 20.6341 3.2429
Md_ lennard-jones 5.536 2.9168
Mg_ lennard-jones 55.8631 2.6914
Mn_ lennard-jones 6.5425 2.638
Mo_ lennard-jones 28.1832 2.719
N_ lennard-jones 34.7257 3.2607
Na_ lennard-jones 15.0981 2.6576
Nb_ lennard-jones 29.693 2.8197
Nd_ lennard-jones 5.0327 3.185
Ne_ lennard-jones 21.1374 2.8892
Ni_ lennard-jones 7.5491 2.5248
No_ lennard-jones 5.536 2.8936
Np_ lennard-jones 9.5622 3.0504
O_ lennard-jones 30.1963 3.1181
Os_ lennard-jones 18.621 2.7796
P_ lennard-jones 153.4977 3.6946
Pa_ lennard-jones 11.072 3.0504
Pb_ lennard-jones 333.6688 3.8282
Pd_ lennard-jones 24.157 2.5827
Pm_ lennard-jones 4.5294 3.16
Po_ lennard-jones 163.5632 4.1952
Pr_ lennard-jones 5.0327 3.2126
Pt_ lennard-jones 40.2617 2.4535
Pu_ lennard-jones 8.0523 3.0504
Ra_ lennard-jones 203.3216 3.2758
Rb_ lennard-jones 20.1309 3.6652
Re_ lennard-jones 33.2159 2.6317
Rh_ lennard-jones 26.6734 2.6094
Rn_ lennard-jones 124.8113 4.2451
Ru_ lennard-jones 28.1832 2.6397
S_ lennard-jones 137.8963 3.5948
Sb_ lennard-jones 225.9688 3.9378
Sc_ lennard-jones 9.5622 2.9355
Se_ lennard-jones 146.4519 3.7462
Si_ lennard-jones 202.315 3.8264
Sm_ lennard-jones 4.0262 3.136
Sn_ lennard-jones 285.3548 3.9128
Sr_ lennard-jones 118.2687 3.2438
Ta_ lennard-jones 40.765 2.8241
Tb_ lennard-jones 3.5229 3.0745
Tc_ lennard-jones 24.157 2.6709
Te_ lennard-jones 200.302 3.9823
Th_ lennard-jones 13.0851 3.0255
Ti_ lennard-jones 8.5556 2.8286
Tl_ lennard-jones 342.2245 3.8727
Tm_ lennard-jones 3.0196 3.0059
U_ lennard-jones 11.072 3.0246
V_ lennard-jones 8.0523 2.801
W_ lennard-jones 33.7192 2.7342
Xe_ lennard-jones 167.0861 3.9235
Y_ lennard-jones 36.2355 2.9801
Yb_ lennard-jones 114.7458 2.989
Zn_ lennard-jones 62.4056 2.4616
Zr_ lennard-jones 34.7257 2.7832
O_co2 lennard-jones 79.0 3.05
C_co2 lennard-jones 27.0 2.8
# general mixing rule for Lennard-Jones
Lorentz-Berthelot
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
data_crystal

_cell_length_a 6.99901
_cell_length_b 15.24390
_cell_length_c 15.24400
_cell_angle_alpha 117.69900
_cell_angle_beta 98.80460
_cell_angle_gamma 98.80710

_symmetry_space_group_name_Hall 'P 1'
_symmetry_space_group_name_H-M 'P 1'

loop_
_symmetry_equiv_pos_as_xyz
'x,y,z'

loop_
_atom_site_label
_atom_site_type_symbol
_atom_site_fract_x
_atom_site_fract_y
_atom_site_fract_z
_atom_site_charge
C C 0.35274 0.17129 0.60974 0.4040000000
C C 0.16766 0.08548 0.55335 -0.1750000000
C C 0.97267 0.10131 0.53659 0.1990000000
C C 0.81056 0.01449 0.48312 -0.0750000000
C C 0.74299 0.39029 0.56155 0.4020000000
C C 0.61432 0.44668 0.53211 -0.1750000000
C C 0.43609 0.46344 0.56472 0.1990000000
C C 0.32745 0.51691 0.53136 -0.0750000000
C C 0.18146 0.43848 0.82875 0.4020000000
C C 0.08221 0.46791 0.91456 -0.1740000000
C C 0.87137 0.43531 0.89872 0.1980000000
C C 0.79610 0.46867 0.98555 -0.0760000000
C C 0.64731 0.82876 0.39027 0.4030000000
C C 0.83238 0.91457 0.44666 -0.1760000000
C C 0.02737 0.89874 0.46342 0.1990000000
C C 0.18948 0.98555 0.51689 -0.0750000000
C C 0.25706 0.60977 0.43848 0.4030000000
C C 0.38573 0.55337 0.46792 -0.1750000000
C C 0.56397 0.53662 0.43532 0.1990000000
C C 0.67260 0.48315 0.46868 -0.0750000000
C C 0.81859 0.56156 0.17129 0.4020000000
C C 0.91783 0.53213 0.08547 -0.1740000000
C C 0.12866 0.56472 0.10129 0.1980000000
C C 0.20394 0.53136 0.01447 -0.0760000000
H H 0.66065 0.02504 0.46935 0.0600000000
H H 0.19131 0.53068 0.55569 0.0600000000
H H 0.63563 0.44435 0.97500 0.0610000000
H H 0.33939 0.97500 0.53066 0.0600000000
H H 0.80874 0.46937 0.44434 0.0600000000
H H 0.36441 0.55569 0.02503 0.0610000000
O O 0.33071 0.26288 0.64716 -0.5910000000
O O 0.52341 0.15205 0.61879 -0.4750000000
O O 0.93423 0.19484 0.56864 -0.5580000000
O O 0.68356 0.35286 0.61572 -0.5900000000
O O 0.90464 0.38125 0.53326 -0.4740000000
O O 0.36560 0.43139 0.62620 -0.5580000000
O O 0.06784 0.38429 0.73714 -0.5900000000
O O 0.37139 0.46677 0.84799 -0.4740000000
O O 0.73940 0.37382 0.80518 -0.5580000000
O O 0.66933 0.73716 0.35286 -0.5900000000
O O 0.47663 0.84799 0.38123 -0.4750000000
O O 0.06581 0.80520 0.43138 -0.5580000000
O O 0.31649 0.64718 0.38431 -0.5900000000
O O 0.09541 0.61881 0.46677 -0.4740000000
O O 0.63445 0.56867 0.37383 -0.5580000000
O O 0.93219 0.61573 0.26287 -0.5900000000
O O 0.62865 0.53327 0.15204 -0.4740000000
O O 0.26063 0.62620 0.19483 -0.5580000000
Zn Zn 0.10914 0.32911 0.59362 1.2110000000
Zn Zn 0.51553 0.40640 0.73549 1.2110000000
Zn Zn 0.78005 0.26454 0.67092 1.2110000000
Zn Zn 0.89091 0.67094 0.40641 1.2110000000
Zn Zn 0.48452 0.59364 0.26454 1.2110000000
Zn Zn 0.21999 0.73550 0.32910 1.2110000000
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# number of pseudo atoms
2
#type print as chem oxidation mass charge polarization B-factor radii connectivity anisotropic anisotropic-type tinker-type
O_co2 yes O O 0 15.9994 -0.35 0.0 1.0 0.68 0 0 relative 0
C_co2 yes C C 0 12.0 0.7 0.0 1.0 0.72 0 0 relative 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
!!! Generated by AiiDA !!!
ChargeMethod Ewald
CutOff 12.0
EwaldPrecision 1e-06
Forcefield Local
NumberOfCycles 10
PrintEvery 0.1
PrintPropertiesEvery 10000000000
RemoveAtomNumberCodeFromLabel yes
SimulationType MonteCarlo
UseChargesFromCIFFile yes
WriteBinaryRestartFileEvery 1000
Framework 0
FrameworkName framework_1
ExternalTemperature 300
UnitCells 4 2 2
Component 0 MoleculeName CO2
CreateNumberOfMolecules 1
MoleculeDefinition Local
RandomTranslationProbability 0.0
ReinsertionProbability 1.0
RotationProbability 1.0
TranslationProbability 1.0
Loading