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
I’m working with organic molecular crystals (e.g., Aspirin) from CIF files and need help generating clean crystal slabs in pymatgen. Right now, I’m running into a major issue: my slabs always contain fragmented molecules at the boundaries, which could cause problems in later simulations.
The Problem
When I create a slab, molecules at the boundaries are cut, leaving fragments instead of intact structures. Example:
I suspect this happens because the unit cell in the CIF file already contains fragmented molecules, as seen here:
Other programs seem to handle this automatically. For example, in this video tutorial (0:43), they
mention "tidying up" the unit cell before slab generation. However, I haven’t found a clear way to do this in pymatgen.
What I’ve Tried
I’ve searched through pymatgen’s and ASE's documentation, discussions, and issues for over a week but haven’t found a solution.
My current idea is:
Detect fragmented molecules in the unit cell.
Identify which unit cell face the broken bonds pass through.
Shift the fragments so that they align properly.
But I’m not sure if this is the right approach or if pymatgen has a built-in way to handle this.
Question
Has anyone encountered this issue before? Is there a recommended way to generate clean slabs without fragmented molecules in pymatgen, or another library more suitable to my needs?
Any advice or pointers would be greatly appreciated! Thanks in advance.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone!
I’m working with organic molecular crystals (e.g., Aspirin) from CIF files and need help generating clean crystal slabs in pymatgen. Right now, I’m running into a major issue: my slabs always contain fragmented molecules at the boundaries, which could cause problems in later simulations.
The Problem
When I create a slab, molecules at the boundaries are cut, leaving fragments instead of intact structures. Example:

I suspect this happens because the unit cell in the CIF file already contains fragmented molecules, as seen here:

Other programs seem to handle this automatically. For example, in this video tutorial (0:43), they
mention "tidying up" the unit cell before slab generation. However, I haven’t found a clear way to do this in pymatgen.
What I’ve Tried
I’ve searched through pymatgen’s and ASE's documentation, discussions, and issues for over a week but haven’t found a solution.
My current idea is:
But I’m not sure if this is the right approach or if pymatgen has a built-in way to handle this.
Question
Has anyone encountered this issue before? Is there a recommended way to generate clean slabs without fragmented molecules in pymatgen, or another library more suitable to my needs?
Any advice or pointers would be greatly appreciated! Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions