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.
The reference, measured deviation, confidence region and limitations for this method are recorded in Scientific validation.
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, or an RCSR net from
topology_data) - 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
- Select linker per edge type: Inequivalent edges can use different linker SBUs
- Build crystal: Combine all atoms with fractional coordinates into a
CrystalStructure
Topologies
Built-in homogeneous nets (Topology::pcu/dia/sql/...) and data-driven RCSR nets share the same assembler. Topology::from_name accepts both, and Topology::from_net converts a topology_data::NetData entry into the symmetry-expanded graph used by assembly.
| 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 |
| bcu | 8 | 2 | 8 | Body-centred cubic |
| fcu | 12 | 4 | 24 | Face-centred cubic |
| nbo | 4 | 2 | 4 | NbO net — square-planar nodes |
| kgm | 4 | 3 | 6 | Kagomé lattice |
| hxl | 6 | 1 | 3 | Hexagonal lattice |
| pillared_sql | 6 | 1 | 3 | Pillared square lattice |
| acs | 6 | 2 | 6 | RCSR net (P6₃/mmc) |
| afw | 4 | 9 | 18 | RCSR net with two edge types |
| sod | 4 | 12 | 24 | Sodalite net |
| pts | 4 | 4 | 8 | PtS net (data-driven expansion) |
| xah | 5 / 4 | 4 | 9 | RCSR net with two edge types |
| tfy | 4 / 3 | 184 | 288 | Large RCSR net with two edge types |
Nodes/edges are the symmetry-expanded counts in one unit cell.
SBU Types
Metal Node: A central metal atom with connection points arranged in the specified coordination geometry.
let node = Sbu::metal_node(30, 2.0, CoordinationGeometry::Tetrahedral);The first argument is the atomic number (30 = Zn).
Linear Linker: A bridging unit connecting two metal nodes.
let linker = Sbu::linear_linker(&[6, 6, 6], 1.4, "BDC");Elements are atomic numbers (6 = C).
Rodrigues Rotation
Linkers are oriented from the default
where
API
Rust
use sci_form::materials::{CoordinationGeometry, Sbu, Topology, UnitCell};
let cell = UnitCell::cubic(10.0);
let node = Sbu::metal_node(30, 2.0, CoordinationGeometry::Octahedral);
let linker = Sbu::linear_linker(&[6, 6], 1.4, "carboxylate");
let topology = Topology::pcu();
let crystal = sci_form::assemble_framework(&node, &linker, &topology, &cell);
println!("{} atoms", crystal.num_atoms());For nets with inequivalent edges, pass one linker per edge type:
let topology = Topology::from_name("xah")?;
let linkers = [
Sbu::linear_linker(&[6], 1.4, "short"),
Sbu::linear_linker(&[7], 1.2, "long"),
];
let crystal =
sci_form::assemble_framework_with_linkers(&node, &linkers, &topology, &cell);Edge i uses linkers[topology.edge_types[i]]. If the linker list is shorter than the type index, the last linker is reused. Topologies without edge_types (older serialized data) default to type 0.
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 30 --geometry octahedralPython
import sci_form
cell = sci_form.create_unit_cell(10.0, 10.0, 10.0, 90.0, 90.0, 90.0)
print(cell.volume)
# topology, metal (atomic number), geometry, lattice_a, supercell
crystal = sci_form.assemble_framework("pcu", 30, "octahedral", 10.0, 1)
print(crystal.num_atoms)Python and WASM currently expose the single-linker wrapper; the multi-linker assembler is available from Rust.
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 - Extended nets (F67): node counts, coordination and edge-type counts match pormake's
.cgddata - Multi-edge assembly: unit tests in
materials::assemblycheck thatxahuses the linker selected by eachedge_typesentry