-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature Request: Integration with ASE #6
Comments
Dear @ichibha, thank you for your request. I will try to implement it. |
Dear @ichibha, I have an idea for implementing this. Would you help me? I need a function to convert a
Would you try to implement it? |
@kousuke-nakano Thank you for your willingness to work on this issue. The pymatgen Structure object can be converted into an ASE Atoms object using the following function: from pymatgen.core import Structure
from ase import Atoms
def pymatgen_struct_to_ase_atoms(structure: Structure) -> Atoms:
return Atoms(
symbols=[specie.symbol for specie in structure.species],
positions=structure.cart_coords,
cell=structure.lattice.matrix,
pbc=True,
)
if __name__ == "__main__":
for label in ["cartesian", "fractional"]:
structure = Structure.from_file(f"{label}.vasp")
atoms = convert_structure_to_atoms(structure)
atoms.write(f"{label}_converted.vasp") I attach the files used to verify the code. |
Dear @kousuke-nakano, Thank you for your correspondence. The code works as I expected. I will make a suggestion with my expected behavior from the next time. |
Dear @ichibha, thanks. We will include this feature to the next release. |
It would be greatly appreciated if structures could be obtained as an array of ASE's Atoms. Since VASP is frequently paired with ASE, implementing this feature could lead to wider application of SHRY.
The text was updated successfully, but these errors were encountered: