Materials Assembly
sci-form supports assembly of Metal-Organic Frameworks (MOFs) and other crystalline structures from Secondary Building Units (SBUs) and topological blueprints. This module handles periodic unit cells, coordination geometries, and framework construction.
Unit Cell and Lattice Vectors
Lattice Parameters
A crystallographic unit cell is defined by six parameters:
| Parameter | Symbol | Description |
|---|---|---|
| Lengths | Edge lengths in Ångströms | |
| Angle | Angle between | |
| Angle | Angle between | |
| Angle | Angle between |
Lattice Matrix
The lattice vectors are stored as rows of a
For the general triclinic case:
where
Coordinate Transforms
Fractional → Cartesian:
Cartesian → Fractional:
Volume
Periodic Boundary Conditions
Wrapping fractional coordinates into
Minimum image distance under periodicity:
Supercell Generation
A
Lattice vectors scale:
Framework Assembly
Assembly Pipeline
- Select topology: Define node positions and edge connectivity (pcu, dia, sql, etc.)
- Place metal nodes: Position SBU at each topology vertex with appropriate coordination geometry
- Orient linkers: Use Rodrigues rotation to align linker SBUs along each edge direction
- Build crystal: Combine all atoms with fractional coordinates into a
CrystalStructure
Topologies
| Topology | Coordination | Nodes | Edges | Description |
|---|---|---|---|---|
| pcu | 6 | 1 | 3 | Primitive cubic — octahedral nodes |
| dia | 4 | 2 | 4 | Diamond — tetrahedral nodes |
| sql | 4 | 1 | 2 | Square lattice — square planar nodes |
SBU Types
Metal Node: A central metal atom with connection points arranged in the specified coordination geometry.
let node = Sbu::metal_node("Zn", 2.0, CoordinationGeometry::Tetrahedral);Linear Linker: A bridging unit connecting two metal nodes.
let linker = Sbu::linear_linker(&["C", "C", "C"], 1.4, "BDC");Rodrigues Rotation
Linkers are oriented from the default
where
API
Rust
use sci_form::{create_unit_cell, assemble_framework};
let cell = create_unit_cell(10.0, 10.0, 10.0, 90.0, 90.0, 90.0);
let crystal = assemble_framework("Zn", "BDC", "pcu", &cell);CLI
# Unit cell info
sci-form cell --a 10 --b 10 --c 10 --alpha 90 --beta 90 --gamma 90
# Framework assembly
sci-form assemble --topology pcu --a 10.0 --metal Zn --geometry octahedralPython
import sci_form
cell = sci_form.unit_cell(10.0, 10.0, 10.0, 90.0, 90.0, 90.0)
print(cell.volume()) # 1000.0
print(cell.parameters()) # (a, b, c, alpha, beta, gamma)
crystal = sci_form.assemble_framework("pcu", 10.0, "Zn", "octahedral")
print(crystal.num_atoms())Validation
- Cubic cell: Volume
, all angles 90° - Coordinate roundtrip: frac → cart → frac recovers original
- PBC wrapping: All fractional coords in
after wrapping - Minimum image: Distance is always ≤ half the cell diagonal
- Supercell scaling:
supercell has 8× the atoms