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
Working with @oxana-a on refining the adsorption workflow a bit and I noticed the unit tests are failing with the latest pymatgen release. I'm not 100% sure, but I believe this to be a result of the way oriented unit cells are made primitive. As far as I can tell, the results are not meaningfully different, but I want to verify a few things before changing the test files. Specifically, I want to make sure the SlabTransformation pipeline is still compatible with the strategy we've used for adding adsorbates (which is simply to add adsorbates at the appropriate fractional coordinate relative to the slab from which the slab transformation is generated).
@richardtran415 - have you encountered anything like this? Specifically, one weird thing about the current unit tests is that a SlabTransformation generated from a given slab's oriented unit cell and shift is different from the slab by a reflection through the midpoint of the c-lattice plane, see the following MWE:
from pymatgen import Structure, Lattice
from pymatgen.core.surface import generate_all_slabs
from pymatgen.transformations.advanced_transformations import SlabTransformation
struct_ir = Structure.from_spacegroup("Fm-3m", Lattice.cubic(3.875728), ["Ir"], [[0, 0, 0]])
sgp = {"max_index": 1, "min_slab_size": 7.0, "min_vacuum_size": 20.0}
slabs = generate_all_slabs(struct_ir, **sgp)
slab_100 = [slab for slab in slabs
if slab.miller_index==(1, 0, 0)][0]
# Generate a slab transformation of the oriented unit cell
trans_params = {"miller_index": [0, 0, 1],
"shift": slab_100.shift,
"min_vacuum_size": 20.0,
"min_slab_size": 7.0}
trans = SlabTransformation(**trans_params)
new_slab = trans.apply_transformation(slab_100.oriented_unit_cell)
print("Old slab:", slab_100.frac_coords)
print("New slab:", new_slab.frac_coords)
I did change the oriented_unit_cell attribute of the slab object recently, this was to ensure that the oriented unit cell reflects the slab units of the primitive slab cell if the user chose to use the smaller primitive cell, however this is done after the actual construction of the slab structure by replacing the oriented_unit_cell attribute of the slab object so this should not effect the slab construction algorithm unless its being used in the slab transformation like above. The structures are still the same so the adsorption algorithm should still work, however I noticed the structures in the test_file are all centered. Usually center_slab is False by default, which is what the slabs above are using.
To get the same slab as the test files, you could just set the shift to 0 (for some reason using the new oriented unit cell changes the shift value, but this shouldn't effect the logic of the work flow).
Working with @oxana-a on refining the adsorption workflow a bit and I noticed the unit tests are failing with the latest pymatgen release. I'm not 100% sure, but I believe this to be a result of the way oriented unit cells are made primitive. As far as I can tell, the results are not meaningfully different, but I want to verify a few things before changing the test files. Specifically, I want to make sure the SlabTransformation pipeline is still compatible with the strategy we've used for adding adsorbates (which is simply to add adsorbates at the appropriate fractional coordinate relative to the slab from which the slab transformation is generated).
@richardtran415 - have you encountered anything like this? Specifically, one weird thing about the current unit tests is that a SlabTransformation generated from a given slab's oriented unit cell and shift is different from the slab by a reflection through the midpoint of the c-lattice plane, see the following MWE:
The text was updated successfully, but these errors were encountered: