Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slabs in adsorption wfs are slightly different from slabs in test_files #282

Open
JosephMontoya-TRI opened this issue Apr 13, 2019 · 1 comment
Labels
improvement reported issues that considered further improvement to atomate

Comments

@JosephMontoya-TRI
Copy link

JosephMontoya-TRI commented Apr 13, 2019

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)
Old slab: [[0.      0.      0.90625]
 [0.5     0.5     0.96875]
 [0.      0.      0.78125]
 [0.5     0.5     0.84375]]
New slab: [[0.      0.      0.09375]
 [0.5     0.5     0.03125]
 [0.      0.      0.21875]
 [0.5     0.5     0.15625]]
@CifLord
Copy link

CifLord commented Apr 16, 2019

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).

@itsduowang itsduowang added enhancement improvement reported issues that considered further improvement to atomate and removed enhancement labels Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement reported issues that considered further improvement to atomate
Projects
None yet
Development

No branches or pull requests

3 participants