betaFeedback

WorksPhysics and Astronomy

FLAKE: Friction and Lattice Analysis of Kinetics and Energetics of rigid 2D clusters on crystalline substrates

Abstract

When a small solid island slides across a crystalline surface, the outcome (smooth flow or stick-slip, free rotation or angular locking) is controlled almost entirely by the geometric relationship between the island and the surface: their relative orientation, size and lattice symmetry. These phenomena are central to nanoscale friction, to the interpretation of colloidal monolayer experiments and to structural superlubricity. FLAKE (Friction and Lattice Analysis of Kinetics and Energetics) is a Python package for simulating the statics and Langevin dynamics of a rigid 2D cluster sliding over a periodic or quasiperiodic substrate potential. It enables fast, systematic exploration of how geometry and substrate symmetry control the energy landscape and friction, studies that are prohibitively expensive with fully atomistic simulations. FLAKE has been the primary simulation tool for three published studies on structural superlubricity and colloidal friction.

[waiting for JOSS]

Software

Repository (GitHub)

Documentation (Read the Docs)

Package (PyPI: flake-rigid)

Version

0.1.3

Contact

[email protected]

Statement of need

Nanotribology experiments with colloidal clusters [2, 3, 4] and van der Waals heterostructures (Liao et al., 2023; Yao et al., 2025) show phenomena (orientational locking, rotational depinning, coupled roto-translational motion) that are difficult to interpret without a corresponding simulation tool. The standard computational approach in this field is all-atom molecular dynamics with realistic interatomic potentials, typically using LAMMPS (Thompson et al., 2022) and ASE (Larsen et al., 2017). While indispensable for elastic effects and chemical specificity, all-atom simulations are prohibitively expensive for the systematic parameter sweeps needed to extract scaling laws and build phase diagrams. They also entangle elastic deformation with the purely geometric commensurability effects that dominate in stiff 2D materials.

Several recent computational studies address the phenomena FLAKE targets: rotational energy landscapes and scaling laws for twisted bilayers (Zhang and Zhu, 2025a,b, 2026), shape-dependent friction scaling (Gao et al., 2025; Yan et al., 2024), orientational control via strain (Zhou et al., 2025), and experimental evidence for directional superlubricity in van der Waals heterostructures (Le Ster et al., 2024). These studies use a variety of tools and conventions, often relying on LAMMPS with material-specific force fields that constrain the accessible geometries and substrate symmetries. Reviews of the scaling-up challenge (Ying et al., 2025) highlight that systematic parameter exploration remains a bottleneck. FLAKE is a geometry- and chemistry-agnostic Python package for fast, systematic rigid-body friction studies, and a baseline for elastic LAMMPS studies.

State of the field

Structural superlubricity in 2D materials is an active research front (Wang et al., 2024; Ying et al., 2025). The geometric, rigid-body mechanism is now well-established in principle (Panizon et al., 2023), but quantitative predictions (e.g. how friction scales with cluster size, shape and orientation) still require systematic numerical exploration. No existing open Python package targets this combination for the rigid-body tribology use case, so each group writes its own simulation code.

DFT-level PES tools. TribChem (Losi et al., 2023) and the high-throughput workflow of Wolloch et al. (2022) operate at the opposite length-scale extreme: they compute interfacial adhesion and shear strength from first-principles electronic structure for periodic unit-cell-sized systems. These tools are complementary to FLAKE: their output (corrugation amplitude ϵ\epsilon and well shape) can parametrise FLAKE’s substrate potentials for specific material interfaces.

Geometric descriptors. The Registry Index (Hod, 2013) characterises interfacial commensurability from atomic geometry alone, producing qualitative maps. However, it carries no energy scale and cannot drive dynamics or compute energy barriers.

Interlayer potentials. In LAMMPS simulations of 2D-material interfaces, the interlayer interaction is typically described by the Interlayer Potential (ILP) of Leven et al. (2016), which uses Gaussian-shaped atom–atom overlap terms for registry-dependent repulsion, qualitatively captured by FLAKE’s Gaussian-well substrate.

Software design

Rigid-body reduction

The central design choice in FLAKE is the rigid-body reduction. In 2D, a cluster of NN particles on a substrate in principle requires 2N2N equations of motion. Treating the cluster as a rigid body collapses this to three collective degrees of freedom (center-of-mass position r=(x,y)\mathbf{r}=(x,y) and orientation angle θ\theta) governed by

ηtr˙=Fsub(r,θ)+Fext+ξt,(1)\eta_t\dot{\mathbf{r}}=\mathbf{F}_{\mathrm{sub}}(\mathbf{r},\theta)+\mathbf{F}_{\mathrm{ext}}+\boldsymbol{\xi}_t, \tag*{(1)}
ηrθ˙=τsub(r,θ)+τext+ξr,(2)\eta_r\dot{\theta}=\tau_{\mathrm{sub}}(\mathbf{r},\theta)+\tau_{\mathrm{ext}}+\xi_r, \tag*{(2)}

where ηt=Nη\eta_t=N\eta and ηr=η∑iri2\eta_r=\eta\sum_i r_i^2 are translational and rotational drag coefficients computed from cluster geometry, Fsub\mathbf{F}_{\mathrm{sub}} and τsub\tau_{\mathrm{sub}} are the total substrate force and torque summed over all particles, and ξt,r\boldsymbol{\xi}_{t,r} are Gaussian white noise terms, ⟨ξi(t)ξj(t′)⟩=2kBTηiδijδ(t−t′)\langle\xi_i(t)\xi_j(t')\rangle=2k_{\mathrm{B}}T\eta_i\delta_{ij}\delta(t-t'). The overdamped (inertia-free) limit is the physically appropriate regime for colloidal clusters in viscous media [2] and for 2D materials at low sliding speeds; extending the integrator to include inertia is straightforward. This reduction makes it possible to run thousands of trajectories in minutes on a laptop, enabling the systematic parameter sweeps over cluster size, shape, orientation, substrate symmetry, and applied force that are the primary target of FLAKE.

Rigidity is a good approximation for stiff 2D materials (graphene, hBN, MoS2_2) at moderate loads, and for colloidal clusters where interparticle distances are effectively fixed: in both cases the dominant friction mechanism is geometric commensurability rather than elastic deformation (Panizon et al., 2023).

Limitations. The rigid-body approximation does not capture intralayer elasticity, which drives the Aubry-type commensurate–incommensurate transition [1] (Wang and Tosatti 2025); moiré-induced out-of-plane buckling in freestanding bilayers (Wang and Tosatti, 2024; Wang et al., 2023); or elastic edge effects that give rise to chiral moiré dynamics at finite contacts (Silva et al., 2024). These effects require fully elastic simulations and are beyond FLAKE’s scope.

Performance

All substrate energy and force kernels are Numba just-in-time compiled (@njit, Numba’s JIT decorator (Lam et al., 2015}): the substrate_from_params factory pre-converts parameters to float64 arrays once and returns closures, eliminating per-step Python overhead, and run_md dispatches to a fully JIT-compiled inner loop when no Python callbacks are needed; the test suite checks that this loop is faster than the interpreted one.

String method in roto-translational space

The string method for minimum-energy paths (E et al., 2002}) is extended to the joint (x,y,θ)(x,y,\theta) space using independent length scales (lx,ly,lθ)(l_x,l_y,l_\theta) that put translational and angular displacements on equal footing,

ds2=(dxlx)2+(dyly)2+(dθlθ)2,(3)ds^2 = \left(\frac{dx}{l_x}\right)^2 + \left(\frac{dy}{l_y}\right)^2 + \left(\frac{d\theta}{l_\theta}\right)^2, \tag*{(3)}

a metric choice required to find physically meaningful roto-translational paths. The scales enter only the reparametrisation of the string to equal arc length, not the gradient step; typical choices are lx=lyl_x=l_y equal to the substrate spacing and lθl_\theta equal to the angular period of the contact (e.g. 60∘60^\circ for triangular-on-triangular).

Features

FLAKE provides:

  • Energy landscape maps over translational and/or rotational degrees of freedom (flake map), for static analysis of commensurability and orientational locking.

  • Minimum-energy path search via the string method in 2D (translational) and 3D (roto-translational) configuration space (flake string), giving static friction forces and transition pathways.

  • Parameter-sweep Langevin dynamics (flake sweep) parallelised over a parameter grid via joblib, for depinning thresholds and velocity–force scaling laws.

  • Substrate types: sinusoidal (optical lattices), Gaussian well (ILP-like registry dependence), tanh well (lithographic patterns), and flat (testing baseline); new types require only a single Numba @njit function.

  • Cluster geometries: circle, hexagon, triangle, rectangle, ellipse, and arbitrary polygon via Shapely; multi-site bases supported.

  • A YAML-driven CLI, which needs no Python scripting, and six end-to-end Jupyter notebooks in examples/ covering the full workflow from substrate construction to scaling-law analysis.

Research impact

FLAKE v0.1.3 is the packaged and tested release of a codebase developed from 2022 onward at SISSA. The predecessor (v0.0.6, publicly available since November 2022) was the primary simulation tool for the following published studies:

  • Panizon et al. (2023) (Nanoscale): geometric classification of arbitrary 2D interfaces and scaling laws of static friction force from finite commensurate and incommensurate contacts.

  • Cao et al. [4] (Physical Review X): coupled roto-translational depinning and the role of moiré pattern evolution in colloidal experiments.

  • Liao et al. (2023) (ACS Applied Materials and Interfaces): combined experiment and simulation of twisting dynamics in large lattice-mismatch van der Waals heterostructures.

The colloidal experiments of Cao et al. [2] and Cao et al. [3] provided the physics foundation and motivated the initial design of the package.

Version 0.1.3 adds a fully JIT-compiled MD inner loop, the roto-translational string method, and a complete test suite. The package is currently in active use at SISSA for ongoing research on quasicrystalline substrates and roto-translational synchronisation effects, in collaboration with experimentalists in Germany and China.

Availability. FLAKE requires Python ≥3.10\ge3.10, NumPy, SciPy, Numba, PyYAML, h5py and joblib (Shapely and ASE are optional) and is installed with pip install flake-rigid. Its pytest suite, run in continuous integration, includes physics validation tests: Fc=NF1sF_c = NF_{1s} for commensurate clusters and reduced static friction for incommensurate ones.

AI usage disclosure

The physical model, all design decisions, and the research direction of FLAKE are entirely the work of the author. The central argument that geometry dominates friction in stiff 2D contacts, making a rigid-body model both sufficient and necessary for systematic study is grounded in the author’s prior publications [4] (Panizon et al. 2023). The choice of substrate models, the roto-translational string method and its arc-length metric, and the scope of the package all predate any AI involvement: the core physical model and simulation algorithms were functional in the predecessor codebase (v0.0.6, November 2022) prior to any AI assistance. Claude Code (Anthropic, claude-sonnet-4-6) was subsequently used to improve the codebase: making the code more readable (docstring rewriting, module restructuring and API cleanup) and more efficient (Numba JIT refactoring of substrate closures and the MD inner loop), adding the test suite and CI configuration, and improving this manuscript. All AI-generated outputs were reviewed and edited by the author.

Acknowledgements

The author thanks Emanuele Panizon, Jin Wang, Dong Han, Erio Tosatti, Andrea Vanossi, Nicola Manini, Xin Cao, and Clemens Bechinger for the physics discussions and experimental collaborations that motivated and shaped this work. The author thanks Andrea Trost for help with the logo design.

This work was supported by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme, grant agreement No. 834402 (ULTRADISS), and by the Italian Ministry of University and Research (MUR) under PRIN grant No. 20178PZCB5 (UTFROM).

Workflow and examples

A typical study builds the cluster, defines the substrate, scans the static energy landscape, and drives the cluster with Langevin dynamics. All quantities are in reduced units: well depth ϵ=1\epsilon= 1, substrate spacing a=1a = 1, single-particle drag η=1\eta= 1.

Building clusters

A cluster is a finite cut of a 2D Bravais lattice, optionally decorated with a multi-site basis (Figure S1). make_cluster provides the built-in shapes; cluster_poly masks the lattice with an arbitrary Shapely polygon, rotated independently of the lattice, or punches it as a hole; params_from_poscar imports the in-plane lattice and basis of a real material from a VASP POSCAR file. Positions are returned with the center of mass at the origin and θ=0\theta= 0: rotation and translation are initial conditions, applied by the caller. The drag coefficients of Eqs. (1)–(2) follow from the same positions.

Figure S1. Cluster geometries: the six built-in shapes cut from a triangular lattice with a two-site (honeycomb) basis; an L-shaped polygon (shaded) masking a triangular lattice rotated independently of it; the same polygon as a hole in a honeycomb hexagon.

Substrates

The substrate is a fixed potential acting on each particle; force and torque on the cluster are sums over particles, with the torque taken about the center of mass. Sinusoidal substrates superpose nn plane waves (Vanossi et al., 2012),

V(r)=−ϵn2∣∑l=0n−1eikl⋅r∣2(4)V(\mathbf{r}) = -\frac{\epsilon}{n^2}\left|\sum_{l=0}^{n-1}e^{i\mathbf{k}_l\cdot\mathbf{r}}\right|^2 \tag*{(4)}

with n=2,3,4n = 2, 3, 4 giving lines, triangular and square lattices, and n=5,6n = 5, 6 quasicrystals with no unit cell. Lattice-of-wells substrates repeat a Gaussian well, smoothly cut off at a finite radius, or a flat-bottomed tanh well as used for lithographic colloidal templates (Cao et al., [3]) (Figure S2). A flat substrate serves as a testing baseline. substrate_from_params turns a parameter dictionary or YAML file into JIT-compiled closures for energy, force and torque.

Figure S2. Single-particle substrate potential for the available families: sinusoidal with n=3n = 3, 44 and 55 (quasicrystal, QC) plane waves, and triangular lattices of Gaussian and tanh wells.

Static analysis

translational_map, rotational_map and rototrasl_map evaluate energy, force and torque on grids of CM positions, angles, or both (Figure S3). Panels (a)–(d) show a circular cluster with a 5%5\% lattice mismatch on the triangular sinusoidal substrate. The particle energies trace the moiré pattern panel (a), and the cancellation of particle forces makes the translational corrugation per particle more than two orders of magnitude smaller than for a single particle panel (b). Translation and rotation are coupled: the translational corrugation depends strongly on θ\theta panel (c). Minimising the energy over the CM position at each angle gives the orientational landscape, whose global minimum lies at a small twist, θ≈2.6∘\theta\approx2.6^\circ panel (d).

Figure S3. Static analysis. (a)–(d): circular cluster (N=397N = 397, mismatch ρ=1.05\rho= 1.05) on the triangular sinusoidal substrate. (a) Particle energies at θ=2.5∘\theta= 2.5^\circ, showing the moiré pattern. (b) Translational map at θ=0\theta= 0. (c) Energy versus xcmx_{\rm cm} and θ\theta at ycm=0y_{\rm cm} = 0. (d) Orientational landscape: energy minimised over the CM position (solid) and at fixed rcm=0r_{\rm cm} = 0 (dashed). (e) String method for a different system: a circular cluster (N=637N = 637, ρ=1+1/21\rho= 1 + 1/21, θ=0\theta= 0) on a triangular lattice of tanh wells; initial string (dashed) and relaxed minimum-energy path (solid) on the translational landscape (red: high, blue: low); inset: energy along the path. (f) Static friction versus NN for circular and hexagonal clusters, aligned (0∘0^\circ) and twisted (1.5∘1.5^\circ); dashed: NF1sNF_{1s}; dotted: N1/2N^{1/2} guide to the eye. In (b) and (c) energies are per particle, measured from the minimum.

find_mep locates minimum-energy paths with the string method, in (xcm,ycm)(x_{\rm cm}, y_{\rm cm}) at fixed orientation or in the full (xcm,ycm,θ)(x_{\rm cm}, y_{\rm cm}, \theta) space. The barrier is the energy maximum along the path and the static friction is the largest force met, Fs=max⁡s∣F(s)∣F_s = \max_s \lvert\mathbf{F}(s) \rvert, with F=−∇E\mathbf{F} = -\nabla E the force along the path ss. In panel (e), on a lattice of tanh wells, the straight initial string between two equivalent minima relaxes to a path that bends through an intermediate minimum and crosses two equivalent saddles.

Repeating such scans over cluster size gives scaling laws panel (f): a commensurate contact follows Fs=NF1sF_s = N F_{1s} exactly, with F1sF_{1s} the single-particle value, while a small twist makes the contact incommensurate and FsF_s sublinear, with oscillations set by the fraction of moiré tiles in the cluster (Panizon et al., 2023).

Driven dynamics and depinning

run_md integrates Eqs. (1)–(2) with the Euler–Maruyama scheme, with noise fixed by the fluctuation–dissipation theorem. sweep_md runs one trajectory per point of a parameter grid in parallel, reduces each with a post-processing function (e.g. drift velocity), and optionally stores trajectories in HDF5 with resume support. Figure S4 shows a commensurate cluster pinned below and sliding above the depinning threshold; panels (b) and (c) show translational and rotational depinning.

Figure S4. Overdamped Langevin dynamics of a commensurate circular cluster (N=223N = 223) on the triangular sinusoidal substrate. (a) CM trajectory below (pinned) and above (sliding) the depinning threshold. (b) Drift velocity versus applied force. (c) Mean angular velocity versus applied torque.

Usage

Listing S1 builds the commensurate cluster of Figure S4 and runs an energy evaluation, a rotational map, a translational minimum-energy path, whose static friction matches the depinning force of Figure S4, and a driven trajectory above threshold. From the shell, the physical parameters sit in a YAML file and each task reads its own configuration, writing HDF5 output (examples in example_cli/):

flake map    -i params.yaml --grid grid_trasl.yaml -o map_trasl.h5
flake string -i params.yaml --cfg string_roto.yaml -o mep_roto.h5
flake sweep  -i params.yaml --spec sweep_Fx.yaml
import numpy as np
from flake.substrate import substrate_from_params, get_ks
from flake.cluster import cluster_from_params, rotate
from flake.maps import rotational_map
from flake.string_method import find_mep
from flake.dynamics import run_md

params = {
    # substrate: triangular sinusoidal potential of depth epsilon
    'well_shape': 'sin', 'epsilon': 1.0, 'sub_basis': [[0., 0.]],
    'ks': get_ks(1.0, 3, 4./3., 0.),       # R, n, c_n, alpha_n (radians)
    # cluster: circular cut of a commensurate triangular lattice
    'cluster_shape': 'circle', 'N1': 15, 'N2': 15, 'cl_basis': [[0., 0.]],
    'a1': [1., 0.], 'a2': [0.5, -np.sqrt(3.)/2.],
}
pen_func, en_func, _ = substrate_from_params(params)  # JIT-compiled closures
pos = cluster_from_params(params)       # (N, 2), CM at origin, theta = 0

cm = np.zeros(2)
E, F, tau = en_func(rotate(pos, 2.0) + cm, cm)       # theta = 2 deg
rot = rotational_map(pos, en_func, theta_deg=np.linspace(-30, 30, 601))
mep = find_mep(pos, en_func, p0=[0., 0.], p1=[1., 0.], n_pt=50)
traj = run_md(pos, en_func, eta=1.0, Fx=630., kBT=1e-8,
              dt=1e-3, n_steps=20000)

Listing S1. Minimal use of the Python API.

References

  1. [1]T. Brazda, A. Silva, N. Manini, A. Vanossi, R. Guerra, E. Tosatti, and C. Bechinger. Experimental observation of the Aubry transition in two-dimensional colloidal monolayers. Physical Review X, 8(1):011050, 2018. doi: 10.1103/PhysRevX.8.011050.DOI
  2. [2]Xin Cao, Emanuele Panizon, Andrea Vanossi, Nicola Manini, and Clemens Bechinger. Orientational and directional locking of colloidal clusters driven across periodic surfaces. Nature Physics, 15(8):776–780, 2019. doi: 10.1038/s41567-019-0515-7.DOI
  3. [3]Xin Cao, Emanuele Panizon, Andrea Vanossi, Nicola Manini, Erio Tosatti, and Clemens Bechinger. Pervasive orientational and directional locking at geometrically heterogeneous sliding interfaces. Physical Review E, 103(1):012606, 2021. doi: 10.1103/PhysRevE.103.012606.DOI
  4. [4]Xin Cao, Andrea Silva, Emanuele Panizon, Andrea Vanossi, Nicola Manini, Erio Tosatti, and Clemens Bechinger. Moiré-pattern evolution couples rotational and translational friction at crystalline interfaces. Physical Review X, 12(2):021059, 2022. doi: 10.1103/PhysRevX.12.021059.DOI

Paper details

vlnc:W_gxrg637k
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Claude Code

View statement
Looking for related papers…
Contents