Structures
Supercells
Create supercells from existing crystal structures.
1. Overview
Supercells are larger periodic structures created by replicating a unit cell along the x, y, and z crystallographic directions. They are essential for simulating larger systems, studying defects, and investigating properties that require extended periodicity.
supercell.py
from atomict.structure.conversion import create_supercell
result = create_supercell(
user_upload_id="uuid",
dimensions=[2, 2, 2]
label="Defect Study Supercell",
description="2×2×2 supercell for vacancy calculations"
)
Note: generating a supercell simply expands the unit cell by the specified factor. The supercell must be relaxed prior to further processing.
2. Valid Dimension Formats
Dimensions must be three positive integers that correspond to the x, y, z directions respectively. You also have the option to pass in a list of strings.
valid_dimensions = [
[2, 2, 2], # Cubic supercell
[3, 3, 1], # Slab-like
[1, 1, 4], # Wire-like
[2, 3, 4]
]
valid_strings = [
"2 2 2", # Cubic supercell
"3 3 1", # Slab-like
"1 1 4", # Wire-like
"2 3 4"
]
3. Downloading Supercells
You can download your supercell with the download_user_upload method.
supercell.py
from atomict.file.user_upload import get_user_upload, download_user_upload
supercell_info = get_user_upload("your-supercell-id")
download_user_upload(
user_upload_id="your-supercell-id",
local_path="./my_supercell.cif"
)
print(f"Downloaded: {supercell_info['filename']}")