Why VASP calculation on ASE created slab cannot start?

Hello, I am trying to write a script that creates many slabs with different thickness and optimise the geometry of them using vasp. When I run the code nothing happens, and even the usual INCAR, POTCAR, and KPOINTS files are not generated. Here is my code:

from ase.build import hcp0001
from ase.calculators.vasp import Vasp
slab = hcp0001('Ru', size=(1, 2, 4), vacuum=15.0, orthogonal=True, periodic=True)
calculator = Vasp(istart=0,
             icharg=2,
             iniwav=1,
             nelm=150,
             nelmin=6,
             algo='Fast',
             ispin =2,
             ediff=1e-05,
    #		 magmom=natoms,'*0',
             ismear=1,
             sigma=0.2,
             prec='Accurate',
             encut=400,
             xc='pbe',
             ncore=4,
             lwave =False,
             lcharg =False,
    #		 lechg =False,
             lreal=False,       
             nedos=1200,
             lorbit=11,
             ldipol=True,
             idipol=3,
             ediffg=-0.01,
             ibrion=2,
             isif=1,
             nsw=300,
             potim=0.2,
             ivdw=12,
             kpts=(2,2,1))
    
slab.calc = calculator

It seems like there is a problem with the hcp0001 function, since if I create a system using Atoms everything works smoothly.

Hello Fabio,

I am trying to start my first ase script. I tried on a supercomputer cluster. I run the sctipt but nothing happened, only an error message suggesting the “ase.calculators.calculator.CalculatorSetupError: Vasp cannot handle non-periodic boundaries. Please enable all PBC, e.g. atoms.pbc=True”. I am quite confused. Would you please give me some advice. Thanks!

from ase import Atoms, Atom
from ase.calculators.vasp import Vasp
co = Atoms([Atom(‘C’, [0, 0, 0]),
Atom(‘O’, [1.2, 0, 0])],
cell=(6., 6., 6.))
calc = Vasp(xc=‘pbe’, # the exchange-correlation functional
encut=350, # planewave cutoff
atoms=co)
print(‘energy = {0} eV’.format(co.get_potential_energy()))
print(co.get_forces())

Error: Vasp cannot handle non-periodic boundaries. "
ase.calculators.calculator.CalculatorSetupError: Vasp cannot handle non-periodic boundaries. Please enable all PBC, e.g. atoms.pbc=True