How do I export structures from Materials Project to be used in other software?

I wanted to try exporting a .cif file to my PC and then using atomsk to create a larger crystal for a LAMMPS simulation, but was having trouble as atomsk could not convert the .cif. What is the general approach for taking structures from Materials Project to an MD simulation? Or, is there another way to create a larger crystal, say 1,000 atoms, from the base of .cif file?

“failed to convert X.cif to numerical value” is an error I get.

Thank you, sorry if this is a very beginner question, but I failed to troubleshoot on my own.

Hi @Dislocation9, all matsci-related questions are welcome! Just to clarify, are you taking a structure from the Materials Project (MP), making a supercell from it, and then writing the supercell to a CIF?

If so, here’s a generic example to make a cubic Si (mp-149) supercell with at least 1,000 atoms, using our API and pymatgen:

from mp_api.client import MPRester
from pymatgen.transformations.advanced_transformations import CubicSupercellTransformation

with MPRester(<your API key>) as mpr:
    si_structure = mpr.materials.summary.search(material_ids=["mp-149"],fields=["structure"])[0].structure

supercell = CubicSupercellTransformation(min_atoms=1000).apply_transformation(si_structure)
supercell.to("Si_supercell.cif")
1 Like

Hello, thank you, yes this is what I was looking for. I was not familiar with pymatgen or the API client, but I will try this.