import mlatom as ml

complex = ml.data.molecule.from_xyz_string('''4
Sodium-water complex
Na 0.00000 0.00000 2.40000
O  0.00000 0.00000 0.00000
H  0.00000 0.75545 -0.58895
H  0.00000 -0.75545 -0.58895
''')
complex.charge = 1
complex.multiplicity = 1

model = ml.methods(method='uaiqm_gfn2xtbstar@cc', version='20250115')
model.predict(molecule=complex, calculate_energy=True,
              calculate_energy_gradients=True)

print(f'Energy (Hartree): {complex.energy:.8f}')
print('Gradient shape:', complex.energy_gradients.shape)
complex.write_file_with_xyz_coordinates('na_water.xyz')
complex.dump(filename='na_water.json', format='json')
