Skip to main content
Scientific Reports logoLink to Scientific Reports
. 2026 Apr 28;16:19821. doi: 10.1038/s41598-026-49667-w

PairPotMCinator: a tool for fast simulations of the organic-molecular ordering on the solid surfaces using pair potentials

J Antoš 1, P Kocán 1,✉
PMCID: PMC13315599  PMID: 42049803

Abstract

Organic molecules on nonreactive surfaces self-assemble to ordered superstructures. This problem is typically studied using quantum mechanical models, such as Density functional theory (DFT). However, the use of those models for systems with hundreds of atoms is computationally impractical if at least approximate structures are not known. Here, we demonstrate an algorithm employing a Monte Carlo simulation and a method of pair potentials - thus simplifying the quantum mechanical description by using pair-parameterized forces. We incorporate this model into a Monte Carlo simulation which, from a given approximate molecular superstructure periodicity obtained from experimental data, predicts the position and deformation of the ordered molecules to minimize the potential energy of the system. We test the algorithm on published results of self-ordering of selected pigments in different environments: 1) on highly oriented pyrolytic graphite in solution, and 2) on the Si(111)-InInline graphic surface prepared under ultra-high vacuum. The generated structures can be used as close-to-relaxed candidates for inputs to more accurate DFT calculations.

Subject terms: Chemistry, Materials science, Mathematics and computing, Physics

Introduction

The structure of the interfaces between organic films and solid substrates plays a crucial role in many applications, such as organic field-effect transistors or organic photovoltaics1. The functionality of organic electronic devices depends on the quality of the interface between the film and the metal electrode2. The electronic properties of molecular films, for example, HOMO / LUMO electron filling, are strongly related to the molecular arrangement2. Ordered molecular layers can also enhance the properties of the substrate, as in the case of graphene3 or functionalized silicon4–7 used as a substrate.

The self-assembly process is determined by molecule-substrate and molecule-molecule interactions8. If the interaction with the substrate is too strong, the self-assembly is limited by the low mobility of the molecules. The van der Waals interaction without formation of chemical bonds is one of the typical prerequisites. Intermolecular interactions are usually of electrostatic origin: van der Waals, dipolar, and hydrogen bonding. In addition, the strong Pauli repulsion protects the molecules from overlapping. Under sufficient conditions, even negligible or even repulsive interactions between molecules can result in the formation of self-ordered arrays9,10. The difference between the substrate-molecule and intermolecular interactions drives the molecular structures to be commensurate or incommensurate with the substrate11–13.

The periodicity of the molecular layer can be obtained from experiments in either real space, using scanning tunneling (STM) or atomic force microscopy (AFM), or in reciprocal space, using typically low-energy electron diffraction. A primitive cell of the structure can contain up to several molecules. The density functional theory (DFT) calculations are an excellent tool to obtain detailed information about the electronic and structural properties of the system. Today, DFT-based calculations use a significant fraction of publicly available high-performance computational resources14. For the DFT calculations, at least approximate arrangement of the molecules within the cell is needed as input, which is, however, often difficult to determine from the experimental data. The trial and error method is not appropriate for the DFT calculations as the machine time demands grow quickly with the size of the periodic cell.

Here we present PairPotMCinator (Pair-Potential Monte Carlo -inator), an algorithm for a fast heuristic search of the reasonable configuration of molecules on a substrate with predefined periodicity. The calculation is based on the approximation by the pair potentials15,16 between all atoms in the structure. Hydrogen bonding is empirically implemented. The search of the energetic minimum is via a Monte Carlo chain of random changes of the structure - with parameters of the changes being added in stages. In several examples, we demonstrate that the algorithm can quickly generate approximate molecular structures which can be used as input for the DFT calculations.

Algorithm

The slab

Here, we consider molecular layers with structure commensurate with the underlying solid surface. The surface is usually reconstructed, its periodicity defined by vectors Inline graphic:

graphic file with name d33e230.gif

where Inline graphic are the vectors of the substrate lattice unit cell and Inline graphic represent the reconstruction periodicity. The unit cell of the slab with adsorbed molecules is given by vectors Inline graphic and, in addition to the periodicity of the molecular layer, it must reflect the symmetry of the surface reconstruction:

graphic file with name d33e247.gif

where Inline graphic, Inline graphic, Inline graphic are the periodicity matrices with respect to the molecular layer, the substrate lattice and to the surface reconstruction periodicity, respectively. The vectors Inline graphic represent the apparent periodicity of the molecular layer (see Fig. 1).

Figure 1.

Figure 1

(left) An illustrative STM image capturing both the molecular superstructure and the surface periodicity. (right) Schematic of a slab defined based on the mentioned image, with periodicity matrices: Inline graphic, Inline graphic, Inline graphic.

Vectors Inline graphic can typically be obtained from STM or AFM experiments. Sometimes, the apparent molecular periodicity must be multiplied to ensure that all Inline graphic are integers. An example of a surface without reconstruction is shown in Fig. 1, a cell with a more complex reconstructed surface is shown in Fig. 7a.

Figure 7.

Figure 7

Results of the pair-potential simulations applied on DPDPP and DTDPP molecules adsorbed on Si(111)-InInline graphic surface. (a) Construction of the supercell commensurate with the surface periodicity. (b) Organization of the DTDPP molecules from the pair-potential simulations (the van-der-Waals spheres) compared to results of DFT simulations (the wire-frame model)7. (c) Organization of the DPDPP molecules compared to STM image7.

Energy

The total energy of a molecular configuration is approximated by pair potentials and consists of two components:

  1. the interaction energy within a slab, and

  2. the interaction energy between a slab and its nearest-neighbor periodic copies.

graphic file with name d33e322.gif

Arrangement of the copies is used to define a symmetry of the system. To simulate 2D periodic systems, we use 8 copies as demonstrated in Fig. 2. Through the redefinition of the copies, systems with different symmetry can be simulated. As a limit case, non-periodic systems could be treated by omitting the nearest-neighbor periodic copies.

Figure 2.

Figure 2

An example of a possible random variation of the molecules in one trial. The image shows a slab and its 8 periodical copies with respect to which we calculate the total potential energy.

The energy within a slab includes molecule-molecule interactions, molecule-surface interactions, and molecular deformation energy (see Section Varying the molecules for details):

graphic file with name d33e331.gif

The term Inline graphic denotes the molecular deformation energy. It is defined as the difference between the molecule’s equilibrium (rest) energy and its energy after deformation. Each part of the molecule is considered as a separated rigid virtual molecule, these parts are bound together by constrains (rotational or completely free bonds, as described below). For simplicity, the molecular energy is calculated as the sum over all intramolecular atomic interactions using the same pair potentials as those we use for intermolecular interactions.

The energy between a slab and one of its nearest-neighbor periodic copies includes the energy between the molecules in the two slabs and between the molecules in the original slab and the surface in the copied slab.

graphic file with name d33e341.gif

The energy term Inline graphic from the formulas above is calculated as a sum over all interactions between the atoms in the molecule or surface given in the first argument and the atoms in the molecule or surface given in the second argument.

The surface is represented by a periodically repeated slab with defined atomic structure. No limitations are implied, so the surface can include defects such as steps or vacancies.

The following interactions between atoms are considered:

  • Electrostatic interaction with approximate atomic charges calculated for isolated molecules, we used Atomic Charge Calculator II17.

  • Van der Waals and Pauli interaction represented by the Buckingham potential with tabulated parameters, adopting the approach from Ref.15.

  • The hydrogen bonding interaction Inline graphic between the atoms selected as donors (D) and H atoms attached to acceptors (A), calculated using the formula
    graphic file with name d33e375.gif
    where r is the distance between the D and H atom, Inline graphic is the angle A - H - D, and Inline graphic eV, Inline graphic Å, Inline graphic ÅInline graphic18.

Monte Carlo simulation

The algorithm takes the slab and the parameters governing the simulation as an input, and, as an output, returns the same slab but with optimized molecular ordering. The algorithm can either initialize the molecules randomly on the surface of the slab or use the predefined positions if given.

In every iteration, n independent parallel copies of the previously calculated slab are created - randomly varying the molecules in each one (by moving, rotating, and deforming the molecules - see Fig. 2), and the potential energy is calculated as described above. We call each of those n parallel schemes a trial.

The trial with the smallest energy is then selected and the corresponding slab is used as the input for the next iteration. We call this single iteration a loop (see Fig. 3).

Figure 3.

Figure 3

(left) Graphical illustration of a loop. (right) graphical illustration of a cycle.

Next, we combine multiple such loops in a sequence and set parameters governing the degree to which the molecules are to be varied. This structure is called a stage. Finally, by combining multiple stages in sequence, we get a full cycle (see Fig. 3).

The algorithm goes through many such cycles and for each returns the calculated slab with relaxed molecular superstructure.

Varying the molecules

As mentioned in the previous section, in each trial, the algorithm varies the molecular ordering in the superstructure by moving, rotating, and deforming the molecules. Each molecule can be varied in the following ways:

  • translation in the direction perpendicular to the surface

  • translation in the plane parallel to the surface

  • rotation in the plane parallel to the surface

  • rotation in 3D

  • deformation - Predefined parts of the molecule can rotate separately while keeping the connecting bond lengths unchanged. Two types of such deformation are supported: a rotation around an axis between two atoms which connect the molecule part to the rest of the molecule, and a rotation around a random axis - see Fig. 4. The deformations are useful especially in the last stages to fine tune the molecular structures.

Figure 4.

Figure 4

(left) A rotation around an internal axis given by two atoms. (right) A rotation around a random axis.

Constraining molecular relaxations

In some circumstances, it might be beneficial to decrease the search space of possible molecular superstructures by binding a few selected degrees of freedom. This could significantly improve the convergence speed when the number of molecules inside the slab is too large - in which case we might, for example, bind the rotational degrees of freedom - ensuring that all molecules rotate in unison. This strategy can also be useful when the apparent molecular periodicity was multiplied to ensure that Inline graphic are integers. Consider again Fig. 1. Here, the unit cell of the molecular ordering (given by vectors Inline graphic) contains only one molecule, but the unit cell of the slab (given by vectors Inline graphic) stacks 5 of those together - thus ensuring that both Inline graphic and Inline graphic are integers. In this situation, we would bind both the rotational and translational degrees of freedom.

Results

Diketopyrrolopyrrole derivatives on graphite

Diketopyrrolopyrrole (DPP) derivatives are well studied molecules used in many industrial applications and a large body of research has gone into analyzing their properties. For the first test of our algorithm, we have chosen the supramolecular ordering of diphenylDPP (DPDPP) and dithienylDPP (DTDPP) derivatives on a graphite surface19. The structure models of molecules are shown in Figs. 5a and 6a. The study provides annotated data from a scanning tunneling microscope (STM) in solution, including the cell size of the superstructure, and corresponding DFT calculations. In our algorithm, we approximated the graphite surface by the topmost graphene layer.

Figure 5.

Figure 5

(a) The atomic structure of DPDPP molecule. (b) A graphene cell with the dimensions of the superstructure cell. (c) A slab identical to the unit cell of molecular superstructure. (d) Relaxed layer of molecules using the cell. (e) Relaxed structure with two different enantiomers using the doubled cell.

Figure 6.

Figure 6

(a) The atomic structure of DTDPP molecule. (b) Relaxed layer of DTDPP molecules using the cell from Fig 5b. (c) Relaxed structure with two different enantiomers using the doubled cell. (d) Relaxed structure with free rotation of thienyl rings.

On the graphite, the DPDPP molecules form “densely packed” parallel chains with the following superstructure unit cell dimensions: Inline graphic19. The following periodic cell falls into the experimentally observed range (Fig. 5b,c): Inline graphic, corresponding to the linear combination

graphic file with name d33e537.gif

where, again, Inline graphic are the basis vectors of the surface, Inline graphic are the basis vectors of the molecular superstructure, and Inline graphic are the basis vectors of the slab.

When considering a slab of those dimensions, we observed superstructures which mirror the experimental data (Fig. 5d).

The authors of the mentioned study also report what they call “orientational disorder”: A state in which parallel neighbouring chains can be made of molecules of different chirality. We reproduce these results with the following results (Fig. 5e): We considered a pair of two enantiomers in a cell twice as large in the direction of b. The results were comparable to the experimental data, as we observed the molecules in the two parallel chains of different enantiomers running under an angle of Inline graphic close to the reported Inline graphic. The slight difference can be due to imaging of the molecules in STM.

In the case of DTDPP molecules the authors observed two different superstructures19. The first mirrors the superstructure and unit cell dimensions observed in the previous case. The second is characterized by a greater spacing between chains.

When considering the original slab of the dimensions discussed in the previous section, we again observe superstructures that reproduce the experimental data (Fig. 6b). Next, we explore the state the authors call “orientational disorder”. In this case, however, we observed the molecules in the two parallel chains of different enantiomers running at an angle of Inline graphic (Fig. 6c) instead of reported Inline graphic. This can be again due to STM imaging of the molecules with higher contrast in positions near S atoms with a higher density of states.

Apart from seeing the same superstructure characterized by molecular chains separated by Inline graphicnm, as in the case of DPDPP molecules, the authors also report molecular chains separated by Inline graphicnm. They speculate as to the exact nature of the molecular ordering and provide DFT calculations that point to the fact that in those molecular chains, both thienyl rings of the DTDPP molecules rotate by 90 degrees. The resulting slab in this case is characterized by slightly different dimensions and contains two molecules.

To reproduce these results, we initialized two molecules plannarly and enabled them to deform their thienyl rings. In all cycles, the molecules tended to move out of their planar configuration by either rotating, moving vertically, or by deforming their internal structure. The most favourable energetical minima combined all 3 of those aspects (Fig. 6d).

DPP on Si(111)-InInline graphic

Next, we apply our algorithm to address a more challenging task, using the results obtained with DPP derivatives on Si(111)-InInline graphic7. On this surface (see Fig. 7), double layer of In atoms forms a quasi-rectangular structure (open green circles), which together with the 3-fold symmetry of the Si(111) substrate (vectors Inline graphic) results in Inline graphic symmetry (vectors Inline graphic) with matrix Inline graphic. The periodicity of the DPP layer is commensurate on the large supercell with matrix Inline graphic. The large supercell, defined by vectors Inline graphic in Fig. 7a, hosts 10 DPDPP or DTDPP molecules7. Without additional constraints, such an amount of free parameters results in a too complex potential landscape, making it difficult to find a global minimum. Because the molecules in the cell are aligned in two similar chains, with all molecules rotated to a similar degree, for preliminary simulations we can use a pair of molecules, each of different molecular row, as one supramolecule. As a substrate, we have used a rectangular grid of In atoms, representing the topmost layer of the Si(111)-InInline graphic surface.    

The results of the simulations for the DTDPP and DPDPP molecules are shown in Fig. 7b,c, respectively. The layout of the molecules over the STM image shows a perfect match. In the middle part of Fig. 7b, a result of DFT calculation7 is presented as a wire-frame model to be compared with the approximate result of our simulations (a van-der-Waals sphere model). Despite of the simplicity of the pair-potential based simulations, the structure is reproduced very well. This demonstrates that the algorithm can be useful as a generator of approximate structures which can serve as pre-relaxed inputs for computationally demanding DFT calculation.

Finally, we apply our approach to the larger dibithienyl-diketopyrrolopyrrole (BTDPP) molecules, the molecular structure is shown in Fig. 8a. It consist of four thienyl groups linked by bonds along which the groups are free to rotate, thus introducing additional degrees of freedom. After deposition on the Si(111)-InInline graphic , the molecules self-order in the superstructure too large for DFT calculations7. The supercell commensurate with the Si(111)-InInline graphic reconstruction would contain 12 molecules. However, using only topmost approximated layer of Indium allowed us to use a cell containing only two molecules (the cell is depicted in Fig. 8b). In the simulation, we have allowed rotations around all sigma bonds connecting the thienyl units. The lowest-energy structure is shown in Fig. 8b and together with STM image7 in Fig. 8c.

Figure 8.

Figure 8

(a) Structural model of BTDPP molecule. (b) Result of the pair-potential simulations of BTDPP ordering on the Si(111)-InInline graphic surface, compared in (c) to the STM result7. The periodic cell is indicated in (b).

Discussion

In the previous section, we demonstrated the potential applications of our approach on several selected problems: DPP molecules on graphite forming ordered layer in a solution, and DPP molecular superstructures on a 2D metal layer prepared under ultra-high vacuum conditions. However, the possible range of applications is much broader, encompassing various types of organic molecules on different substrates. As demonstrated in Supplementary section S1 online, the algorithm can be in some cases useful for other-then-molecular systems, like for Moiré structure of atomic bilayer on a substrate with smaller lattice constant. In all presented cases, the generated structures cannot be considered as substitution for established structure-relaxation methods, such as DFT, but as suitable candidates for inputs for these methods.

Regarding molecules, the application is not limited to rigid molecules only, as the deformations of the molecules are in a simplified way included in the code. One limitation is the condition of the absence of strong chemical bonds, which cannot be considered in our approximation. The second limitation is due to periodic conditions, which must be provided from the experiment. In principle, the code can be used for nonperiodic systems with a limited number of molecules by setting large supercells to prevent interaction with the periodically repeated molecules. The third limitation is given by the complexity of the space of free parameters. In too complex systems, the random search algorithm often ends in a local minima. Detailed analysis of the algorithm convergence can be found in Supplementary section S2 online. As demonstrated above, this can be solved in some cases by lowering the number of free parameters by introducing - at first stages of simulations - constrains consistent with experimental observations. If such physically meaningful constrains are not possible, the presence of too many local minima will restrain finding a reasonable structure.

The source code of PairPotMCinator is open for further improvements. As a substantial development, we foresee its combination with machine learning, which becomes efficient in the case of extensive DFT simulations14,20.

Conclusions

In conclusion, we have developed a tool for fast trial search of probable molecular structures on solid surfaces. The energy is calculated using heuristic pair potentials and periodic superstructures are taken into account. On several examples of structures reported in literature, we demonstrate that the algorithm can be used to generate fast approximate structures which may serve as inputs for accurate, but computationally demanding, DFT simulations. The source code is openly accessible on GitHub.

Supplementary Information

Author contributions

J.A. developed the code and wrote the manuscript, J.A. and P.K. analyzed the results. Both authors reviewed the manuscript.

Funding

The work has been supported by student faculty grant of Charles University and by ERC-CZ project no. LL2324 from Ministry of Education, Youth and Sports of the Czech Republic.

Data availability

The datasets generated and/or analysed during the current study are available in the GitHub repository https://github.com/antosjakub/PairPotMCinator .

Declarations

Competing interests

The authors declare no competing interests.

Footnotes

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary Information

The online version contains supplementary material available at 10.1038/s41598-026-49667-w.

References

  • 1.Zhang, H., Li, Y., Zhang, X., Zhang, Y. & Zhou, H. Role of interface properties in organic solar cells: from substrate engineering to bulk-heterojunction interfacial morphology. Mater. Chem. Front.4, 2863–2880. 10.1039/D0QM00398K (2020). [Google Scholar]
  • 2.Li, P. & Lu, Z.-H. Interface Engineering in Organic Electronics: Energy-Level Alignment and Charge Transport. Small Sci.1, 2000015. 10.1002/smsc.202000015 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 3.Georgakilas, V. et al. Functionalization of graphene: covalent and non-covalent approaches, derivatives and applications.. Chem. Rev.112, 6156–6214. 10.1021/cr3000412 (2012). [DOI] [PubMed] [Google Scholar]
  • 4.Inagaki, S. et al. Effects of adsorbed molecular ordering to the superconductivity of a two-dimensional atomic layer crystal. Phys. Rev. Mater.7, 024805. 10.1103/PhysRevMaterials.7.024805 (2023). [Google Scholar]
  • 5.Sagehashi, R., Kobayashi, T., Uchihashi, T. & Sakamoto, K. Tuning the Fermi surface of In/Si(111)-(√7 √3) by CuPc adsorption. Surf. Sci.705, 121777. 10.1016/j.susc.2020.121777 (2021). [Google Scholar]
  • 6.Yoshizawa, S. et al. Controlled Modification of Superconductivity in Epitaxial Atomic Layer-Organic Molecule Heterostructures. Nano Lett.17, 2287–2293. 10.1021/acs.nanolett.6b05010 (2017). [DOI] [PubMed] [Google Scholar]
  • 7.Kocán, P. et al. One-dimensional molecular nanostructures interacting with two-dimensional metals. Nanoscale Horiz.10, 915–921. 10.1039/D4NH00622D (2025). [DOI] [PubMed] [Google Scholar]
  • 8.Bartels, L. Tailoring molecular layers at metal surfaces. Nat. Chem.2, 87–95. 10.1038/nchem.517 (2010). [DOI] [PubMed] [Google Scholar]
  • 9.Kocán, P. et al. Stability of Partially Fluorinated Phthalocyanine Monolayers: Influence of Hydrogen Bonding Revisited. J. Phys. Chem. C124, 1973–1979. 10.1021/acs.jpcc.9b09723 (2020). [Google Scholar]
  • 10.Henneke, C., Felter, J., Schwarz, D., Stefan Tautz, F. & Kumpf, C. Controlling the growth of multiple ordered heteromolecular phases by utilizing intermolecular repulsion. Nat. Mater.16, 628–633. 10.1038/nmat4858 (2017). [DOI] [PubMed] [Google Scholar]
  • 11.Kang, J. H. & Zhu, X.-Y. Layer-by-Layer Growth of Incommensurate, Polycrystalline, Lying-Down Pentacene Thin Films on Au(111). Chem. Mater.18, 1318–1323. 10.1021/cm051990w (2006). [Google Scholar]
  • 12.France, C. B., Schroeder, P. G. & Parkinson, B. A. Direct Observation of a Widely Spaced Periodic Row Structure at the Pentacene/Au(111) Interface Using Scanning Tunneling Microscopy. Nano Lett.2, 693–696. 10.1021/nl025567n (2002). [Google Scholar]
  • 13.Meissner, M. et al. Flexible 2D Crystals of Polycyclic Aromatics Stabilized by Static Distortion Waves. ACS Nano10, 6474–6483. 10.1021/acsnano.6b00935 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Heinen, S., Schwilk, M., von Rudorff, G. F. & von Lilienfeld, O. A. Machine learning the computational cost of quantum chemistry. Mach. Learn. Sci. Technol.1, 025002. 10.1088/2632-2153/ab6ac4 (2020). [Google Scholar]
  • 15.Kröger, I. et al. Modeling intermolecular interactions of physisorbed organic molecules using pair potential calculations. J. Chem. Phys.135, 234703. 10.1063/1.3665923 (2011). [DOI] [PubMed] [Google Scholar]
  • 16.Wagner, C. et al. Repulsion between molecules on a metal: Monolayers and submonolayers of hexa- peri -hexabenzocoronene on Au(111). Phys. Rev. B81, 035423. 10.1103/PhysRevB.81.035423 (2010). [Google Scholar]
  • 17.Raček, T. et al. Atomic charge calculator ii: web-based tool for the calculation of partial atomic charges. Nucleic Acids Res.48, W591–W596. 10.1093/nar/gkaa367 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18.Kang, Y. K. Which Functional Form Is Appropriate for Hydrogen Bond of Amides?. J. Phys. Chem. B104, 8321–8326. 10.1021/jp000772h (2000). [Google Scholar]
  • 19.Fu, C., Beldon, P. J. & Perepichka, D. F. H-Bonding Control of Supramolecular Ordering of Diketopyrrolopyrroles. Chem. Mater.29, 2979–2987. 10.1021/acs.chemmater.6b05327 (2017). [Google Scholar]
  • 20.Huang, B., von Rudorff, G. F. & von Lilienfeld, O. A. The central role of density functional theory in the ai age. Science381, 170–175. 10.1126/science.abn3445 (2023). [DOI] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Data Availability Statement

The datasets generated and/or analysed during the current study are available in the GitHub repository https://github.com/antosjakub/PairPotMCinator .


Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES