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 3333>>> from ase.build import molecule
3434>>> from xtb.ase.calculator import XTB
3535>>> atoms = molecule('H2O')
36- >>> atoms.set_calculator( XTB(method="GFN2-xTB") )
36+ >>> atoms.calc = XTB(method="GFN2-xTB")
3737>>> atoms.get_potential_energy()
3838-137.9677758730299
3939>>> atoms.get_forces()
Original file line number Diff line number Diff line change @@ -199,8 +199,7 @@ def test_gfn1_xtb_3d():
199199 - 0.37178059 , - 0.37127074 ,
200200 ])
201201
202- calc = XTB (method = "GFN1-xTB" )
203- atoms .set_calculator (calc )
202+ atoms .calc = XTB (method = "GFN1-xTB" )
204203 assert atoms .pbc .all ()
205204
206205 assert approx (atoms .get_potential_energy (), abs = thr ) == - 1256.768167202048
@@ -233,7 +232,7 @@ def test_gfn2_xtb_3d():
233232 )
234233
235234 calc = XTB (method = "GFN2-xTB" )
236- atoms .set_calculator ( calc )
235+ atoms .calc = calc
237236
238237 with raises (CalculationFailed ):
239238 atoms .get_potential_energy ()
Original file line number Diff line number Diff line change @@ -100,8 +100,7 @@ def test_gfn2xtb_lbfgs():
100100 ]),
101101 )
102102
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 )
105104 opt = LBFGS (atoms )
106105 opt .run (fmax = 0.1 )
107106
@@ -142,8 +141,7 @@ def test_gfn2xtb_velocityverlet():
142141 ]),
143142 )
144143
145- calc = XTB (method = "GFN2-xTB" , cache_api = False )
146- atoms .set_calculator (calc )
144+ atoms .calc = XTB (method = "GFN2-xTB" , cache_api = False )
147145
148146 dyn = VelocityVerlet (atoms , timestep = 1.0 * fs )
149147 dyn .run (20 )
You can’t perform that action at this time.
0 commit comments