You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using generate_all_slabs to generate surfaces by primitive=True, I have found some surfaces will have thickness smaller than the min_slab_size value.
Reproduce the bug
frompymatgen.core.surfaceimportgenerate_all_slabsfrompymatgen.symmetry.analyzerimportSpacegroupAnalyzerfrompymatgen.coreimportStructurebulk_structure=Structure.from_file('TiNb_conv.cif') # I attach this as `TiNb_conv.cif`sga=SpacegroupAnalyzer(bulk_structure)
conv_structure=sga.get_conventional_standard_structure()
slabs=generate_all_slabs(structure=conv_structure,
max_index=2,
min_slab_size=8,
min_vacuum_size=15,
center_slab=True,
primitive=True)
The slab thickness of TiNb(111) surface is 7.06Å, which is less than min_slab_size, which is 8Å.
Slab thickness is calculated by the maximal distance of z-component of cartesian coordinates:
I have checked the lattice constant and fractional coordinates before and after the get_primitive_structure(), it seems the third component of the coordinates don't change.
Here's the lattice constant and fractional coordinates beforeget_primitive_structure():
As you can see although the lattice matrix has been changed, the third component of the fractional coordinates don't change. This could cause the thickness of the generated slab to be smaller than min_slab_size. Is that an issue?
The text was updated successfully, but these errors were encountered:
Bug Description
When using
generate_all_slabs
to generate surfaces byprimitive=True
, I have found some surfaces will have thickness smaller than themin_slab_size
value.Reproduce the bug
The slab thickness of TiNb(111) surface is 7.06Å, which is less than
min_slab_size
, which is 8Å.Slab thickness is calculated by the maximal distance of z-component of cartesian coordinates:
Since cif file cannot be uploaded, I paste the cif file (
TiNb_conv.cif
, conventional cell of TiNb) in the following:Try to pin point the bug
I have done some digging myself. It seems to me the problem lies in the following code of
get_slab()
function:I have checked the lattice constant and fractional coordinates before and after the
get_primitive_structure()
, it seems the third component of the coordinates don't change.Here's the lattice constant and fractional coordinates before
get_primitive_structure()
:Here's the lattice constant and fractional coordinates after
get_primitive_structure()
:As you can see although the lattice matrix has been changed, the third component of the fractional coordinates don't change. This could cause the thickness of the generated slab to be smaller than
min_slab_size
. Is that an issue?The text was updated successfully, but these errors were encountered: