Hi all.
I’d like to make energy predictions of the oxide materials which are not in the OC22 dataset by one of the pretrained models as OCPCalculator.
I’m trying to create the oxide slab by specifying atoms one-by-one, or by using Materials Project (by material ID for example). But, I was unable to make progress for the relaxation step. I’m getting an error from LBFGS (I shared after the code). I couldn’t figure this error out. And, is this the most suitable way to create new oxide slabs, or are there any other ways?
Here is an example code snippet to create PtO2 with O adsorbate:
from ase import Atom
from ase.build import surface
from ase.visualize.plot import plot_atoms
PtO2 = Atoms([Atom('Pt', (-0., -0., -0.)),
Atom('Pt', (1.57841783, 2.27358129, 2.25503354)),
Atom('O', (0. , 3.35854824, 2.89009325)),
Atom('O', (0. , 1.18861434, 1.61997384)),
Atom('O', (1.57841783, 1.08496695, 3.87500738)),
Atom('O', (1.57841783, 3.46219563, 0.63505971))],
cell=[3.15683565, 4.54716258, 4.51006709],
pbc=True)
adslab = surface(PtO2, (1, 1, 1), 9)
adslab.center(vacuum=10, axis=2)
adsorbate = molecule("O")
add_adsorbate(adslab, adsorbate, 1, offset=(1, 1))
adslab.set_pbc(True)
adslab.set_calculator(ocp_calculator)
dyn = LBFGS(adslab, trajectory="data/gemnetOC_oc22_PtO2-O.traj")
dyn.run(fmax=0.03, steps=100)
adslab_traj = ase.io.read("data/gemnetOC_oc22_PtO2-O.traj", ":")
The error I get:
User provided device_type of 'cuda', but CUDA is not available. Disabling
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-138-43a2aaa38245> in <cell line: 1>()
----> 1 dyn = LBFGS(adslab, trajectory="data/gemnetOC_oc22_PtO2-O.traj")
2 dyn.run(fmax=0.03, steps=100)
3
4 adslab_traj = ase.io.read("data/gemnetOC_oc22_PtO2-O.traj", ":")
18 frames
/content/ocp/ocpmodels/models/gemnet_oc/layers/spherical_basis.py in <lambda>(cosφ, θ)
118 circular_basis(cosφ)[:, :, None]
119 * circular_basis(torch.cos(ϑ))[:, None, :]
--> 120 ).reshape(cosφ.shape[0], -1)
121
122 elif sbf_name == "gaussian_outer":
RuntimeError: cannot reshape tensor of 0 elements into shape [0, -1] because the unspecified dimension size -1 can be any value and is ambiguous