#!/usr/bin/env python # coding: utf-8 # ## Using ACE as a ASE calculator # Install pyjulip from https://github.com/casv2/pyjulip # # This requires pyjulia to be set up properly first: https://github.com/JuliaPy/pyjulia # In[1]: import pyjulip from ase.build import bulk import time # In[2]: at = bulk("Al") * (2,2,2) # In[3]: calc = pyjulip.ACE("./ACE_Al.json") # In[4]: at.rattle(0.01) # In[5]: at.set_calculator(calc) # In[6]: at.get_forces() # In[7]: at.get_potential_energy() # In[8]: def get_forces(at): at.rattle(0.01) return at.get_forces() # ## Timing (ms/atom) # In[9]: N = 100 t1 = time.time() for i in range(N): get_forces(at) t2 = time.time() print("FORCE CALL/ATOM [ms]:", ((t2-t1)/N)/len(at) * 1E3) # In[ ]: # In[ ]: