File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 33
33
>>> from ase.build import molecule
34
34
>>> from xtb.ase.calculator import XTB
35
35
>>> atoms = molecule('H2O')
36
- >>> atoms.set_calculator( XTB(method="GFN2-xTB") )
36
+ >>> atoms.calc = XTB(method="GFN2-xTB")
37
37
>>> atoms.get_potential_energy()
38
38
-137.9677758730299
39
39
>>> atoms.get_forces()
Original file line number Diff line number Diff line change @@ -199,8 +199,7 @@ def test_gfn1_xtb_3d():
199
199
- 0.37178059 , - 0.37127074 ,
200
200
])
201
201
202
- calc = XTB (method = "GFN1-xTB" )
203
- atoms .set_calculator (calc )
202
+ atoms .calc = XTB (method = "GFN1-xTB" )
204
203
assert atoms .pbc .all ()
205
204
206
205
assert approx (atoms .get_potential_energy (), abs = thr ) == - 1256.768167202048
@@ -233,7 +232,7 @@ def test_gfn2_xtb_3d():
233
232
)
234
233
235
234
calc = XTB (method = "GFN2-xTB" )
236
- atoms .set_calculator ( calc )
235
+ atoms .calc = calc
237
236
238
237
with raises (CalculationFailed ):
239
238
atoms .get_potential_energy ()
Original file line number Diff line number Diff line change @@ -100,8 +100,7 @@ def test_gfn2xtb_lbfgs():
100
100
]),
101
101
)
102
102
103
- calc = XTB (method = "GFN2-xTB" , solvent = "water" , accuracy = 0.1 )
104
- atoms .set_calculator (calc )
103
+ atoms .calc = XTB (method = "GFN2-xTB" , solvent = "water" , accuracy = 0.1 )
105
104
opt = LBFGS (atoms )
106
105
opt .run (fmax = 0.1 )
107
106
@@ -142,8 +141,7 @@ def test_gfn2xtb_velocityverlet():
142
141
]),
143
142
)
144
143
145
- calc = XTB (method = "GFN2-xTB" , cache_api = False )
146
- atoms .set_calculator (calc )
144
+ atoms .calc = XTB (method = "GFN2-xTB" , cache_api = False )
147
145
148
146
dyn = VelocityVerlet (atoms , timestep = 1.0 * fs )
149
147
dyn .run (20 )
You can’t perform that action at this time.
0 commit comments