Context: The predictive modeling of one-dimensional (1D) supramolecular assemblies depends on the identification of stable, low-energy configurations—a task frequently hindered by the vast configurational space and highly multimodal energy landscapes—inherent to non-covalently bonded systems. In this study, we introduce the \(\pi \) -stack optimizer, a modular, open-source framework designed to generate energetically favorable 1D stacking motifs directly from a single monomeric building block with minimal computational overhead. The framework systematically explores high-dimensional space by globally sampling coupled rigid-body translational and rotational degrees of freedom, while optionally accounting for intramolecular torsional flexibility. Extensive validation across 14 chemically diverse supramolecular systems demonstrates that the framework reliably identifies stable low-energy configurations, including systems stabilized by directional intermolecular hydrogen-bonding networks. Comparative analyses indicate that, while algorithms differ in robustness and efficiency, they consistently converge to nearly identical low-energy minima. Coupled with automated hyperparameter optimization, the \(\pi \) -stack optimizer serves as a scalable and practical tool for generating high-quality initial structures for advanced quantum-mechanical calculations and molecular simulations.
Methods: The \(\pi \) -stack optimizer utilizes global optimization algorithms within a multidimensional parameter space defined by rigid-body translations, rotations, and intramolecular degrees of freedom. By integrating the molecular symmetry constraints, the framework minimizes redundant exploration of equivalent configurations. Configurational sampling was performed using multiple metaheuristic algorithms, including Particle Swarm Optimization, Genetic Algorithms, Grey Wolf Optimizer, and a hybrid PSO–Nelder–Mead approach, with convergence governed by early-stopping criteria. Candidate stack geometries were evaluated using semi-empirical quantum-mechanical energy calculations, primarily employing the GFN2-xTB Hamiltonian. The objective function combines intermolecular binding energies with quadratic steric-penalty terms to bypass unphysical configurations and target chemically realistic minima. Developed in Python with a modular architecture, the framework features parallelized execution and automated hyperparameter optimization via Optuna, providing a flexible, open-source tool for efficient generation of supramolecular stacks with minimal user inputs.