Open schiotz opened 4 years ago
import numpy as np
from pyqstem import PyQSTEM
import ase.build
qstem=PyQSTEM('TEM')
rng = np.random.default_rng()
for i in range(10):
atoms = ase.build.bulk('Au', orthorhombic=True).repeat((2,2,2))
atoms.center(vacuum=10*rng.random(), axis=2)
wave_size=(int(atoms.get_cell()[0,0]*10),int(atoms.get_cell()[1,1]*10))
print("Setting atoms")
qstem.set_atoms(atoms)
print("Building wave:", wave_size)
qstem.build_wave('plane', 300, wave_size)
slices = int(atoms.get_cell()[2,2]*2)
print("Building potential: slices =", slices)
qstem.build_potential(slices)
print("Running multislice")
qstem.run()
(Sorry, cannot attach a .py file).
Hi Jakob,
PyQSTEM has quite a few issues. I will probably not have time to fix them, as I will release its replacement at the MM20 meeting. I have spent quite a bit of time on the new package, and it should be better in every possible way.
Hi Jacob,
This makes sense. I saw your M&M2020 talk, and I am looking forward to trying it out!
Hi Jacob,
PyQSTEM sometimes crashes when you reuse the same object with a different number of slices. Using a new pyqstem object in each iteration instead leads to a memory leak.
The attached script shows the problem. On a Mac, it gives the error
On linux, it just gives a
Segmentation fault (core dumped)
. It is not 100% reproducible, the attached script crashes every second time or so.