1 Introduction

There have been many advances in the ability to synthesize particles on colloidal scales with various interactions, greatly expanding the range and complexity of colloidal crystal structures possible via self-assembly [1]. At the same time, the concept of inverse design [2] has become increasingly important, as it tries to answer the question: Given that we can make so many different types of nanoparticles (NPs), what NPs should we make to achieve the self-assembly of a certain material with a specific structure and properties? The answer to this question could directly guide the development of experimental systems and potentially save time and effort by significantly reducing the trial and error process of standard forward discovery-based approaches.

In soft matter simulation, inverse design methods typically use isotropic pairwise interaction potentials—simplified models developed originally to describe interatomic interactions—to model colloidal interactions between spherical nanoparticles [3,4,5,6,7]. Various approaches to optimize isotropic pair potentials for different target structures have been reported in the literature, such as pair potential optimization through energy minimization [3, 4], artificial evolution algorithms [8, 9], inverse optimization methods that transform statistical models into the optimizer [10, 11], and relative entropy methods [5, 6]. Each of these methods has been used to target specific sets of crystal structures in 2D or 3D systems, e.g. square, hexagonal, honeycomb and kagome lattices in 2D, and 3D crystal structures ranging from the very simple (e.g. cP1–Po, cI2–W) to the complex (e.g. diamond structure, tP30–CrFe and cP54–\(K_4Si_{23}\) [3,4,5,6,7]. Here, we attempt to design isotropic interaction potentials for crystals using a previously reported method named ‘digital alchemy’ that has been implemented in molecular dynamics simulations (Alch-MD) [7, 12], where the thermodynamic ensemble is generalized to include fluctuating particle attributes. In this case, the generalized thermodynamic variables are tunable parameters that define the pair interactions and are allowed to fluctuate during the simulation. Running an MD simulation in an ‘alchemical’ ensemble allows the system to find the optimal pair interaction for a given structure at a given thermodynamic state point.

Digital alchemy was first implemented in Monte Carlo simulations to optimize particle shape for a target structure. Previous work applied the Alch-MD method [7] to two empirically defined isotropic pair interaction functions: the Oscillating Pair Potential (OPP) [13,14,15] and the Lennard–Jones–Gauss Potential (LJGP) [15, 16]. Other pair potentials, such as the Jagla potential [17, 18], the Fomin potential [19], and piecewise pair potentials [5] have also been explored for self-assembly of different structures using different inverse design approaches, and exhibited the ability to form 2D and 3D crystal structures at different thermodynamic state points. While these short-range, oscillatory forms of pairwise interaction potentials are relatively simple for simulations and thus ideal candidates for inverse design, they cover a very small portion of the design space available for an isotropic pairwise interaction potential. In such cases, failure to find a suitable pair potential (or a better potential) may arise simply because of the limited design space explored, and not because of issues associated with the inverse design method or the nature of the target structure. In some other cases where more complex forms of potentials are used, constraining pairwise interactions in Fourier space has been used to restrict the complexity of the potential function and smooth it out by filtering out the high frequency components in Fourier space [6, 20, 21].

In this work, we use a general oscillatory pair potential written as a Fourier series in real space (a “Fourier potential”) and apply the Alch-MD method to optimize isotropic pair interactions for 23 target crystal structures. This work is not aimed at finding realistic, experimentally feasible potentials for colloidal particles. Rather, our goal is to demonstrate issues inherent in inverse design using any type of isotropic pairwise interaction potential. Using the Fourier potential allows us to give the greatest number of degrees of freedom to an oscillatory pair potential to obtain the best case scenario in terms of design. In cases where we are unable to find a reliable pair potential parameterization for a given target crystal structure, we are then able to rule out the possibility that the approach failed due to too many constraints on the form of the potential. We show that out of these 23 structures, we can design pair potentials that allow only six of them to self-assemble (i.e. crystallize) from a liquid phase, and these structures are those for which the target structure and the ground state structure given by the found potential are the same. Although the optimized potentials obtained using inverse design by digital alchemy can stabilize the majority of the target structures (18 out of 23), reliable self-assembly from liquid phases cannot be observed with the optimized pair potentials for structures beyond those six. We show that this failure of inverse design occurs when optimized simple isotropic pair potentials for two similar but distinct structures are nearly identical, resulting in polymorphism and competition among crystal structures, such that no crystal is able to form [22]. In such cases, there is only one structure for which, simultaneously, the optimized pair potential is the “best” potential for the crystal structure and the crystal structure is, conversely, the “best” structure for the pair potential. We believe this work provides important guidance for future endeavors in inverse design of isotropic pair potentials for colloidal self-assembly.

Fig. 1
figure 1

Visualization of the unit cells of the 23 targeted crystal structures

2 Models and methods

2.1 Fourier potential

We used the software package HOOMD-blue [23, 24] to perform digital alchemy using molecular dynamics (Alch-MD) [7, 12] and a general pair potential written in terms of a Fourier series. The Fourier Potential (FP) is comprised of a short range repulsion and a slowly decaying nth order Fourier series:

$$\begin{aligned} V_{\text {Fourier}}(r)= & {} \frac{1}{r^{12}} + \frac{1}{r^{2}} \sum _{i=1}^{n} \left( a_i \cos \left( \frac{i \pi r}{R}\right) \right. \nonumber \\&\left. + b_i \sin \left( \frac{i \pi r}{R}\right) \right) \end{aligned}$$
(1)

with the following constraints to ensure that the Fourier term has a value of zero at a cutoff distance R:

$$\begin{aligned} a_1 = \sum _{i=2}^{n} {(-1)}^i (a_i) \end{aligned}$$
(2)

and additionally, we set

$$\begin{aligned} b_1 = 0. \end{aligned}$$
(3)

To explore the large design space effectively while still permitting complexity in ultimate form of the potential, we fixed the degree of the Fourier term to be 10 in this work. This gives a FP with 18 independent design parameters: [\(a_2\), \(a_3\), ..., \(a_{10}\), \(b_2\), \(b_3\), ..., \(b_{10}\)]. The particles are treated as point particles, and we set the cutoff \(R = 3\) in units of length \({\mathcal {D}}\) in all simulations, similar to that used in Ref. [15]. A cutoff of \(R = 3\) and FP degree = 10 usually produced a smooth pairwise interaction potential with one to three attractive wells. Such interaction potential shapes are, in principle, achievable using various colloidal synthesis techniques, e.g. using DNA functionalization.

2.2 Target structures

In this work, we chose a set of 23 crystal structures to target for inverse design of isotropic pair potentials. The unit cells for each of the 23 structures are shown in Fig. 1. The space group and number of Wyckoff positions for each crystal structure are listed in Table 1. The set of structures were selected to have a diverse representation of crystal structures that are both found in nature and observed in previous simulations using various forms of isotropic pairwise interactions [15, 25, 26]. In addition to distinct structures, the set includes some structures that, despite being different, have similar radial distribution functions (RDFs), as shown in Fig. 2 (left). The reason for this will become apparent in later sections.

Table 1 Space group and number of Wyckoff positions (obtained from [15, 25]) for all structures targeted in this work
Fig. 2
figure 2

(Left) RDFs for the 18 targeted crystal structures that were successfully stabilized, but only some of which self-assembled, using their optimized isotropic pair potentials. (Right) Similarity matrix for the RDFs at left. The similarity matrix has a value between 0 and 1, where 1 indicates the same RDF and 0 indicates no similarity. Each off-diagonal block represents the similarity score of two structures, and the blocks on the diagonal show the maximum similarity score for each structure when compared to all other structures considered in this work. The structures are ordered by the diagonal value, from the most distinctive structure to the least distinctive structure. For visual clarity, structure pairs with a similarity value of less than 0.4 are not shown in this figure

Examination of the RDFs of each target structure allows us to visually identify some similar features. One way to quantify these similarities is to calculate the overlap of two RDF curves and use the percentage of shared area under the curve as a similarity score. However, such a criterion could be too strict as only the RDF peaks that are at the exact same locations would contribute to the similarity score, while any RDF peaks that are closely but not identically positioned would not be considered. To address that, we used a Gaussian curve to smooth out the RDF data at each position using all nearby RDF peaks, where the new and smoothed RDF value at each position is a weighted average of all the RDF peak values around that position, with the weight inversely related to the distance from that given position as defined by the Gaussian curve. We then calculated the ratio of shared area under the Gaussian smoothed RDF curves for all possible pairs of structures. The similarity scores calculated in this way have values between 0 and 1, with 0 indicating that two RDFs (and, presumably, their corresponding structures) are completely different and 1 indicating that two RDFs are the same. We plot the similarity score summary in Fig. 2 (right) in the form of a similarity matrix, with the diagonal blocks showing the maximum similarity score for each structure when compared to all other structures considered in this work.

2.3 Simulation protocols

We performed all simulations at number density \(\phi \equiv \frac{N}{V} = 0.7\), where N is the number of point particles and V is the volume. We chose this density because it is close to the average density at which the self-assembled crystal structures formed using the Oscillating Pair Potential (OPP) in a previous study [15]; the OPP shares similar features with the FP used in this work, i.e. a short range repulsion and longer range (cutoff at \(R = 3\)) oscillatory interaction. We performed four main simulation steps for each of the target structures:

Step 1—Alch-MD step: We constructed the ideal crystal structures using a minimum of 1000 particles in a periodic box with symmetries matching that of the target crystal structures. In digital alchemy, we keep the structure fixed while running a MD simulation, simultaneously allowing the parameters of the pair potential to fluctuate in situ as the system tries to minimize its free energy in the alchemical ensemble. This thermodynamic optimization is achieved by simulating the fixed crystal in a generalized thermodynamic ensemble (an alchemical ensemble) where the number of particles N, system volume V, temperature T, and “alchemical potentials” \(\mu _i\) conjugate to the pair potential variables (coefficients \(a_i\) and \(b_i\)) are held fixed throughout the simulation. For a general and detailed derivation of the alchemical ensemble and its implementation in MD, we refer the reader to Ref. [7]. Because it is important that the structure not be “frozen”, as though at zero T, we attached each particle to its ideal position in the structure using a spring with an initial spring constant value of 128, which allows the particles to freely move about their equilibrium positions but not so much as to allow the structure to fall apart when the simulation begins. The springs are slowly weakened during optimization to ensure the structure remains stable without them.

For each of the 23 target crystal structures, we ran Alch-MD simulations with 10 replicas, each using a randomized initial set of FP parameters: [\(a_2, a_3, \ldots , a_{10}, b_2, b_3, \ldots , b_{10}\)] and corresponding alchemical potentials for \(6\times 10^5\) MD time steps in the NVT\(\mu _i\) ensemble at \(T^* = 0.1\) (we report the reduced temperature \(T^*=k_\mathrm{b}T/\varepsilon \), with units of energy \(\varepsilon \)), reducing the spring constant by half every \(6\times 10^4\) time steps. The initial forms of these 10 pair potentials, which were used for all target structures, are shown in Fig. 3. Because the 10 potential functions used for each target structures 10 replicates are so different, we can rule out any dependence on initial conditions. We used the final frame of each simulation to check if the system remained in the initial target structure and recorded the optimized pair potential at the end.

Fig. 3
figure 3

Initial potentials used for digital alchemy simulations

Step 2—Melting test step: If the target structure remained stable in step 1, we then ran a standard NVT simulation with HOOMD-blue using the last simulation frame of the system in step 1 and the corresponding optimized pair potential from step 1 with a temperature ramp from \(T^* = 0.1\) to \(T^* = 2.5\) to obtain the melting temperature. We identified the melting temperature by plotting the derivative of potential energy against temperature and used the temperature with the peak derivative as the melting temperature [27].

Step 3—Self-assembly step: After obtaining the melting temperature, we then ran self-assembly simulations via a temperature ramp using the last simulation frame of the system in step 1, performed a temperature ramp from \(T^* = 0.1\) to \(T^* = 0.2 + T_\mathrm{melting}\) in \(5\times 10^5\) time steps to melt the system, and then cooled it back to \(T^* = 0.1\) in \(4.5\times 10^6\) time steps to allow the system to self-assemble. We used the final frame to check if the self-assembled structure matches with the target structure.

Step 4—Crystal growth step: If the target crystal structure did not form in step 3 via self-assembly but was found stable during the Alch-MD optimization in step 1, we performed a crystal growth simulation where we combined two simulation boxes using the last frame in both step 1 (the target crystal structure) and step 3 (the final frame from self-assembly simulation) and put them next to each other in an extended simulation box. This artificially creates a crystal seed equivalent to 1/2 of the box. We then ran an NVT simulation around the melting temperature to test if the target crystal grew from the large, fixed seed using the optimized pair potential found in step 1. We used the final frame to identify whether the target crystal indeed grew from the seed. If it did, this means the optimized potential can, in principle, self-assemble the target structure, but was kinetically unable to do so in Step 3.

3 Results and discussion

The success rates for each target structure in steps 1, 3 and 4 for all 23 target crystals with 10 replicas, and a summary of the results, are shown in Fig. 4. In the summary figure, success is defined by at least 50% of the 10 replicates for each target structure remaining in the target crystal structure.

Fig. 4
figure 4

(Top left) Alch-MD step success rate by structure. (Top right) Self-assembly step success rate by structure. (Bottom left) Crystal growth step success rate by structure. (Bottom right) Summary of results. a Alchemy run result for each target structure after alchemy optimization with decaying spring constant. A success label indicates that after the alchemy run, the last frame of the simulation is still identified as the target structure. This suggests that the alchemy method can at least find an optimized pair interaction that stabilizes the target crystal structure. b Self-assembly result for each target structure with the optimized potential. A success label indicates that when using the optimized pair potential, we can get the target crystal to self-assemble from a disordered liquid phase. c Growth competition result between the target structure and the self-assembled frame with the optimized potential. A success label indicates that using the optimized pair potential, we can get the target crystal structure to grow in a simulation box

For 18 of the 23 target structures, digital alchemy with the Fourier potential found a parameterization of the pair potential that stabilized the target structure. However, only four of the 18 optimized pair potentials resulted in successful self-assembly in step 3 into the target crystal structure (cP1–Po, cI2–W, cP8–\(Cr_3Si\) and hP1–\(Ca_{0.15}Sn_{0.85}\)). Two more crystal structures (cF4–Cu and cI16–Si) were obtained in Step 4 when seeded with the target crystals used to optimize their pair potentials. To check for the convergence of all six successful cases, we plot the 10 final optimized pair potentials for each of the six successfully targeted structures in Fig. 5 (left). As can be seen by enlarging the figure, all replicates for a given successfully targeted structure converged to the same optimized FP. We plot the optimized pair potentials for these six ‘successful’ target crystal structures and their corresponding RDFs in Fig. 5 (right). We see that these six RDFs are distinct relative to each other, suggesting that for unique target structures, Alch-MD applied to the FP has a higher chance of finding a successful pair potential.

Fig. 5
figure 5

(Left) Optimized potentials for the six successfully targeted structures. (Right) RDFs for comparison with optimized pair potentials for each of the six structures. The potentials are shifted vertically for visual clarity

Fig. 6
figure 6

Eight structures in the same similarity group that yield very similar cP8–\(Cr_3Si\)-forming potentials. Left: RDFs and optimized pair potentials using Alch-MD for each structure. Right: Comparison of their potential energies

However, comparison of the RDFs of the 18 successfully stabilized target crystal structures (Fig. 2) shows that many of the RDFs are similar to each other. When we compare the structural similarity results and the structures for which an optimal pair potential was found through digital alchemy, we see that the six successfully targeted crystal structures are either unique structures with low similarity scores (Fig. 2 (right)) against all other targeted structures (cP1–Po, cF4–Cu and hP1–\(Ca_{0.15}Sn_{0.85}\)) or they are the only successfully targeted structure among a group of crystal structures that share similar RDFs (cP8–\(Cr_3Si\), cI2–W and cI16–Si). This suggests that the Alch-MD method using the FP is more effective in finding optimized potentials for structurally unique crystals. We expect that this same conclusion applies to any inverse method of obtaining a pair potential for a target structure. In other words, when an inverse design method like Alch-MD is applied to a set of structures that are very similar to each other in terms of their RDFs, merely optimizing an isotropic pair potential—regardless of method—has inherently limited power to tailor for the nuanced differences of each crystal structure, and is likely to result in very similar potentials for the whole set of similar crystal structures. This is because the potential energy for these isotropic pair interacting systems can be written as [28]:

$$\begin{aligned} U = \frac{N^2}{2V}\int \limits _{0}^{\infty }u(r)g(r)4\pi r^2 \text {d}r \end{aligned}$$
(4)

and optimizing pair potentials (u(r)) for structures with similar RDFs (g(r)) will inevitably lead to similar pair potentials. Such an optimized potential will then only lead to the self-assembly of one of the target structures in the best case scenario (as is the case for all eight cP8–\(Cr_3Si\)-like structures, as shown in Fig. 6). We further analyze the case among the eight cP8–\(Cr_3Si\)-like structures (cP8–\(Cr_3Si\), tP30–CrFe, hP7–\(Zr_4Al_3\), cP20–Mn, cI52–\(Cu_5Zn_8\), cF24–\(MgCu_2\), hP12–\(MgZn_2\) and hP24–\(MgNi_2\)). While the Alch-MD optimization finds eight almost identical pair potentials that can stabilize all of these eight structures, cP8–\(Cr_3Si\) remains the lowest energy structure for all of these optimized potentials, as is shown by both the self-assembly result and the calculated potential energy comparison using each optimized pair potential for the corresponding target structure and cP8–\(Cr_3Si\), as shown in Fig. 6.

Fig. 7
figure 7

RDFs and final optimized pair potentials (left) and potential energies (right) after Alch-MD runs for the two structurally similar structures: cI2–W and tI2–Pa

Fig. 8
figure 8

RDFs and final optimized pair potentials (left) and potential energies (right) after Alch-MD run for the two structurally similar structures: cI16–Si and cP54–\(K_4Si_{23}\)

We see the same result in the other two pairs of similar structures: (cI2–WtI2–Pa pair) and (cI16–SicP54–\(K_4Si_{23}\) pair). The optimized potentials within each pair of similar structures remain similar, in Figs. 7 (left) and 8 (left), respectively. The successfully assembled structure has the lowest energy of the pair, as shown in Figs. 7 (right) and 8 (right), for cI2–W and cI16–Si, respectively.

For the three cases (cP4–Li, hP3–\(AlB_2\) and tI2–CdHg), where Alch-MD does not find the optimal potential even though the structure targeted is unique among all the structures considered in this work, we find that the self-assembly simulations usually result in denser crystals. The target structures are still effectively stabilized in step 1 with their optimized potentials, but when no density constraint is applied, the systems are inclined to form more energetically favored high-density configurations during assembly.

4 Conclusions

In this work, we presented the use of Alch-MD with an isotropic pair potential expressed as a Fourier series of degree 10 to inversely design pairwise interaction potentials for 23 different target crystal structures. We found that in six out of 23 cases, our method optimized pair interactions that led to the self-assembly of the target crystal structures. Importantly, for these six, the optimal pair potential found for each structure is also the pair potential for which the target structure has the lowest potential energy at zero temperature. For other cases, however, while most of the optimized pair potentials stabilized the target crystal structures, the structures are not the lowest energy structures for their optimized pair potentials, and a lower energy structure either at the same or higher density is thermodynamically preferred. This demonstrates the importance of not only finding the “best” potential for a given structure, but also ensuring that the structure is the “best” one for that potential.

Our results show the inherent limitation of inverse design using simple isotropic pair potentials, where it becomes difficult to tailor the potential to address the nuanced differences between structures with very similar RDFs. As is well known, the RDF provides only a coarse description of a crystal structure.The same is true for isotropic pair potentials, which do not account for the non-isotropic features of the target crystal structures. Yet RDFs and isotropic pair potentials are still widely used in attempts at inverse design. To address these limitations and refine the pairwise interaction potentials that will self-assemble different structures that were not successful in this work, we advise identifying other structural features that can further differentiate structures with similar RDFs. For example, introducing design features such as binary or type-specific interactions [25, 29,30,31], or patchy interactions with specific directional constraints [32,33,34,35] may be required to optimize and design interactions that will permit crystal self-assembly and be experimentally attainable.