Expand a crystal structure into a supercell and return a CIF file.
Size
size: presets 2x2x2, 3x3x3, 4x4x4 (bulk) or 2x2x1, 3x3x1, 4x4x1 (in-plane / 2D).
dimensions: custom [nx, ny, nz] (overrides size). Use e.g. [5, 5, 1] for monolayers like MoS2.
Vacuum (2D / slabs)
vacuum: minimum total vacuum in Å along vacuum_axis (default axis 2 = c). Expands the cell if needed and centers the slab. Typical values: 15–20 Å.
Does not extract a monolayer from bulk; pads whatever layers are already in the cell.
Limits: each dimension 1–20; result capped at 2000 atoms.
Response includes the CIF plus lattice parameters and resolved vacuum for both the input and supercell.
Learn how to interact with this route using the Ouro SDK or REST API.
API access requires an API key. Create one in Settings → API Keys, then set OURO_API_KEY in your environment.
Parameters and request body schema for this route.
2x2x23x3x34x4x42x2x13x3x14x4x1Predefined supercell size option (ignored when dimensions is set)
Minimum total vacuum thickness in Å along vacuum_axis. Expands the cell and centers the slab if current vacuum is smaller. Typical for 2D materials: 15–20. Applied after the supercell transform.
Symmetry precision for structure analysis
Custom supercell dimensions [nx, ny, nz]. Overrides size when set. Use e.g. [5, 5, 1] for monolayers.
012Lattice axis for vacuum padding (0=a, 1=b, 2=c). Default c.
Angle tolerance for symmetry finding in degrees (°)
Get route metadata including name, visibility, description, and endpoint details. You can retrieve by route ID or identifier.
Execute the route endpoint with request body, query parameters, path parameters, or asset IDs.
Get the request and response history for this route. Actions are especially useful for long-running routes where you can poll the status and retrieve the response when ready.
import os
from ouro import Ouro
# Set OURO_API_KEY in your environment or replace os.environ.get("OURO_API_KEY")
ouro = Ouro(api_key=os.environ.get("OURO_API_KEY"))
# Option 1: Retrieve by route ID
route_id = "0bd98417-bc11-43e6-a67e-f301d57035cc"
route = ouro.routes.retrieve(route_id)
# Option 2: Retrieve by route identifier (username/route-name)
route_identifier = "hermes/expand-a-crystal-structure-into-a-supercell"
route = ouro.routes.retrieve(route_identifier)
print(route.name, route.visibility)
print(route.metadata)# Retrieve the route
route = ouro.routes.retrieve("hermes/expand-a-crystal-structure-into-a-supercell")
# Execute the route
action = route.execute(
body={
'size': '2x2x2',
'symprec': 0.1,
'vacuum_axis': 2,
'angle_tolerance': 5
},
assets={
'file': 'your-file-id'
},
)
print(action.final_data)# Retrieve the route
route = ouro.routes.retrieve("hermes/expand-a-crystal-structure-into-a-supercell")
# Read all actions (request/response history) for this route
actions = route.read_actions()
print(actions)
# Actions are especially useful for long-running routes
# You can poll the status and retrieve the response when ready
for action in actions:
print(f"Action ID: {action['id']}")
print(f"Status: {action['status']}")
print(f"Response: {action.get('response_data')}")Execution
Usage
149 callsView history