Efficient and Safe Molecular Assembly via Reinforcement Learning and Constraint Solving
Abstract
Scanning tunneling microscopy (STM) enables precise manipulation of individual atoms and molecules, offering a pathway to constructing nanoscale assemblies with rich quantum mechanical behavior. Despite its potential, STM-based fabrication remains limited by the inherent complexity of manipulation procedures and the extensive manual effort required. In this work, we take a substantial step toward autonomous manufacturing with STMs by introducing a novel AI-based planning framework for molecular assembly and a high-fidelity simulation environment. Our framework computes collision-free assembly plans that minimize the total distance traveled by molecules. Given an assignment of molecules to target positions, satisfiability solving is used to compute execution schedules in which each molecule has an empty corridor available when it is scheduled to move. Reinforcement learning (RL) agents then execute sequences of STM actions to manipulate molecules to their targets. We further introduce NanoAssemblyGym, a high-fidelity simulation environment for molecular manipulation built on the Gymnasium API, allowing seamless integration with existing RL libraries and workflows. Using NanoAssemblyGym, we demonstrate autonomous assembly of structures containing up to 420 molecules.
Lay Summary
Building precise nanoscale structures, such as quantum corrals that can shape quantum-mechanical wave functions, holds enormous promise for next-generation computing and materials science. But today, constructing these structures with a scanning tunneling microscope requires human experts to manually position each molecule one by one, a process so painstaking it can take months to arrange just a hundred molecules. We developed an AI-based framework that automates this process. Given a target structure, our system first computes a smart assembly plan: it assigns each molecule to its destination and figures out a safe order to move them so they never collide along the way. This scheduling step uses a constraint-solving technique to detect and resolve conflicts automatically. Reinforcement learning agents then carry out the physical manipulations, learning through simulated practice to nudge molecules to their targets efficiently while staying within safe movement corridors. We also built NanoAssemblyGym, an open simulation environment where these agents can be trained and evaluated. In experiments, our system autonomously assembled structures of up to 420 molecules with near-perfect success, something previously far beyond reach. This is a major step toward fully autonomous nanofabrication, opening the door to systematically building and studying complex quantum structures at scale.