### Reciprocal interactions

We contemplate *m* desired buildings with every being a random permutation of *M* elements or tiles. For simplicity, allow us to organize the primary *q* buildings in a queue that we label as *S*^{(1)} to *S*^{(q)}, which defines the shifting sequence. The purpose is to outline an interplay matrix that allows the self-assembly of every goal construction and the belief of the shifting sequence. We assume that every pair of neighbouring tiles within the desired buildings has a selected interplay and outline these reciprocal interactions imposed by buildings as

$${U}_{Asquare B}^{{{{rm{r}}}}}=left{start{array}{ll}-varepsilon ,quad &{{{rm{if}}}}Asquare Bin {{{{mathcal{I}}}}}^{{{{rm{r}}}}}, 0,quad &{{{rm{in any other case}}}},finish{array}proper.$$

(1)

in items of the thermal power *ok*_{B}*T*, the place □ ∈ {, /} represents a selected reciprocal interplay (Fig. 1b). Furthermore, ({{{{mathcal{I}}}}}^{{{{rm{r}}}}}equiv {I}^{{{{rm{r}}}}}({S}^{(1)})cup {I}^{{{{rm{r}}}}}({S}^{(2)})cup cdots cup {I}^{{{{rm{r}}}}}({S}^{(m)})) is the set of all the precise interactions between the tiles imposed by *m* desired buildings, the place *I*^{r}(*S*^{(ℓ)}) is the set of all the precise interactions within the construction *ℓ*, specifically,

$${I}^{{{{rm{r}}}}}({S}^{(ell )})=mathop{bigcup}limits_{start{array}{c}leftlangle alpha ,beta rightrangle finish{array}},{S}_{alpha }^{(ell )}sq. {S}_{beta }^{(ell )},$$

(2)

the place *α* and *β* are the representatives of lattice coordinates (*i*, *j*) working over the closest neighbours, and □ ∈ {, /}. To explain the configuration area of the system, we will outline a Potts configuration variable *σ*_{α} = 0, 1, 2,…*M*, with *σ*_{α} = 0 representing an empty slot and the others describing the corresponding tile species. Utilizing the interplay potential and configuration variables, one can outline a (classical generalized) Hamiltonian for the system as

$${{{mathcal{H}}}}=mathop{sum}limits_{leftlangle alpha ,beta rightrangle }{U}_{{sigma }_{alpha }sq. {sigma }_{beta }}^{{{{rm{r}}}}}-mu ,n,$$

(3)

the place *μ* is the chemical potential of the tiles (assumed to be the identical for all of the species), (n={sum }_{alpha }left(1-{delta }_{0,{sigma }_{alpha }}proper)) representing the overall variety of tiles in each given configuration and □ ∈ {, /}. As standard, the chemical potential controls the typical density of tiles within the system.

The reciprocal interplay *U* asserts that two elements particularly work together if the interplay is favoured a minimum of by one of many buildings^{6,7}. This easy interplay rule makes multifarious self-assembly mannequin an associative reminiscence able to retrieving saved buildings ranging from an preliminary seed or any comparable set off. With an applicable tuning of the mannequin parameters (power scale *ε*, variety of elements *M*, variety of memorized patterns *m* and chemical potential *μ*), one can obtain an equilibrium self-assembly machine paying homage to the Hopfield neural community^{6,33,40}.

### Non-reciprocal interactions

The addition of a non-reciprocal flavour to particular interactions turns the equilibrium multifarious self-assembly mannequin into the non-equilibrium multifarious self-organization mannequin with a brand new shape-shifting property. Impressed by latest numerous bodily fashions with non-reciprocal interactions^{18,19,20,21,22,23,24,25,26}, we introduce non-reciprocal interactions between the tiles as follows. We outline

$${R}_{Ablacksquare{B}}^{{{{rm{nr}}}}}=left{start{array}{ll}lambda ,quad &{{{rm{if}}}},A,blacksquare{B}in {{{{mathcal{I}}}}}^{{{{rm{nr}}}}}, 0,quad &{{{rm{in any other case}}}},finish{array}proper.$$

(4)

the place ■ ∈ {↘, ↖, ↗, ↙} represents all of the doable particular non-reciprocal interactions (Fig. 1c). The set of all such interactions between the tiles wanted to understand the shifting sequence {*S*^{(1)} → *S*^{(2)}, *S*^{(2)} → *S*^{(3)}…*S*^{(q−1)} → *S*^{(q)}} is denoted by ({{{{mathcal{I}}}}}^{{{{rm{nr}}}}}equiv {I}^{{{{rm{nr}}}}}({S}^{(1)}to {S}^{(2)})cup {I}^{{{{rm{nr}}}}}({S}^{(2)}to {S}^{(3)})cup cdots cup {I}^{{{{rm{nr}}}}}({S}^{(q-1)}to {S}^{(q)})). Right here *I*^{nr}(*S*^{(ℓ)} → *S*^{(ℓ+1)}) is the set of particular non-reciprocal interactions wanted for the belief of the *S*^{(ℓ)} → *S*^{(ℓ+1)} transition, which is outlined as

$$start{array}{l}{I}^{{{{rm{nr}}}}}({S}^{(ell )}to {S}^{(ell +1)})=mathop{bigcup}limits_{start{array}{c}i,jend{array}},left{,{S}_{i-1,j}^{(ell )}swarrow {S}_{i,j}^{(ell +1)},proper. left.{S}_{i,j}^{(ell +1)}nearrow {S}_{i+1,j}^{(ell )},,{S}_{i,j}^{(ell +1)}searrow {S}_{i,j-1}^{(ell )},,{S}_{i,j+1}^{(ell )}nwarrow {S}_{i,j}^{(ell +1)},proper}.finish{array}$$

(5)

The uneven interplay matrix *R*^{nr} accommodates these particular non-reciprocal interactions which might be favoured by a minimum of one of many transitions.

### Monte Carlo simulation

The introduction of non-reciprocal interactions into the multifarious self-assembly mannequin renders the issue to have inherent non-equilibriumness. As such, a trustworthy therapy of the stochastic dynamics would require the usage of an applicable grasp equation formalism. To assist spotlight the reference to the equilibrium multifarious self-assembly mannequin, nevertheless, we’ve chosen to make use of a generalized Monte Carlo scheme wherein we’ve included the non-reciprocal interactions within the spirit of kinetic Monte Carlo algorithms. Our particular implementation could be justified with the belief of separation of timescales between the method of self-assembly and shape-shifting transitions.

Within the lattice realization of our mannequin, the entire system is outlined as a sq. lattice of measurement (2sqrt{M}occasions 2sqrt{M}), wherein the specified buildings within the type of two-dimensional sq. lattices of measurement (sqrt{M}occasions sqrt{M}) can be embedded. We make use of the totally heterogeneous and zero-sparsity situation, that’s, every element ought to seem solely as soon as in every construction^{7}, and thus, every construction is a random permutation of the tiles within the sq. lattice. We comply with a generalized model of the grand canonical Monte Carlo simulation as would have been applied for the Hamiltonian ({{{mathcal{H}}}}), with the next generalization within the acceptance fee of each step. At every Monte Carlo step, a random lattice level (*i*, *j*) is chosen and its element *σ*_{i,j} is modified to a different random element *σ*′ with likelihood

$$p=min left{1,exp left({{varLambda }}-{{Delta }}{{{mathcal{H}}}}proper)proper},$$

(6)

the place

$${{{varLambda }}}_{i,j}={R}_{{sigma }_{i-1,j}swarrow {sigma }^{prime}}^{{{{rm{nr}}}}}+{R}_{{sigma }^{prime}nearrow {sigma }_{i+1,j}}^{{{{rm{nr}}}}}+{R}_{{sigma }^{prime}searrow {sigma }_{i,j-1}}^{{{{rm{nr}}}}}+{R}_{{sigma }_{i,j+1}nwarrow {sigma }^{prime}}^{{{{rm{nr}}}}}.$$

(7)

Evidently, within the restrict *λ* → 0, this mannequin reduces to the equilibrium multifarious self-assembly mannequin as outlined in different work^{6,7}.

### Error calculation

The error of meeting is calculated because the fraction of additional tiles connected to the sample or the fraction of tiles lacking from the specified patterns. The error is outlined as 1 − *O*, the place *O* stands for overlap and is calculated as follows: (1) we discover the biggest linked cluster of the tiles *L*; (2) we then assemble *A* = *L* ∪ *S*^{(i)}, that’s, the union of the specified construction as positioned on the centre of the lattice *S*^{(i)} and *L*; (3) we calculate *O*_{i} = ∣*A* ∩ *S*^{(i)}∣/∣*A*∣. The error of self-assembly is *e*_{i} = 1 − *O*_{i}, which is outlined for a single desired construction. If a sequence is encoded within the system and if the system is initialized with one of many patterns on this sequence, then for sufficiently robust *λ*, we anticipate to look at shifts. Consequently, one must repeat step (3) for every of the patterns within the sequence and outline error as ({{{rm{error}}}}=min {{overline{e}}_{i}} _{i}), the place *i* runs over all of the patterns in that sequence.

### Colouring

We’ve got used a conference for colouring the ultimate configurations on the finish of the simulations to have the ability to visually observe the self-assembled buildings in addition to transition dynamics. The colouring conference works as follows. First, we assign unbiased colors to every of the *m* desired buildings. Within the ultimate configuration on the finish of the simulation, a lattice level is both empty, which is then colored white, or it’s stuffed with a tile, which ought to then be colored. A tile is colored with respect to its nearest neighbours, and consequently, it will probably take solely one of many *m* colors equivalent to the *m* desired buildings. For instance, allow us to contemplate a tile that has 4 neighbouring tiles particularly interacting with it. Since all the precise interactions are initially extracted from the saved buildings, every of those 4 interactions can belong to 1 (or extra) of the saved buildings. For the tile into consideration, we choose the color of the construction that has the utmost contribution to its set of interactions with the neighbours. Within the case of a tie, we randomly select a color from the colors of the competing buildings. Within the case when the tile makes particular bonds with none of its neighbours, then it ought to randomly inherit the color from one of many buildings. In a number of the figures with many snapshots, to distinguish the liquid from chimera buildings, we’ve colored each tile if it particularly interacts with a minimum of one of many neighbours.

### Brownian dynamics simulation

A extra reasonable mannequin is launched within the Supplementary Data. We outline a field with a aspect size of ({N}_{x},{N}_{y},{N}_{z}=(2times sqrt{M},2times sqrt{M},2times sqrt{M}+1)), which accommodates the pool of tiles that endure stochastic movement. To make the comparability between this simulation and the Monte Carlo simulation, we implement the directional interactions on small cubic tiles that endure translational Brownian movement in discrete area and discrete time. Tiles are regionally interacting with excluded quantity interactions in your entire field. Additionally they work together with particular reciprocal and non-reciprocal interactions within the interplay area. The interplay area has the identical measurement of a sample positioned in the course of the field. At *t* = 0, we place an preliminary seed in the course of the field. Tiles that attain the floor of the preliminary seed at *z* = *z*_{seed} ± 1 work together with the tile within the seed and substitute it (supplied the excluded quantity situation is fulfilled) with a fee that follows the identical likelihood as outlined within the case of the kinetic Monte Carlo simulation, specifically, (p=min {1,{mathrm{e}}^{{{varLambda }}-{{Delta }}{{{mathcal{H}}}}}}) . Be aware that the belief of the existence of a area for the interactions is to keep away from the nucleation of one other construction that may result in the depletion of tiles, which might consequently forestall shifting. We anticipate this assumption to not be restrictive, since for bigger techniques, the nucleation time in different areas might be longer than the time wanted for a retrieval or shift in an present seeded cluster and there might be sufficient tiles to nucleate many copies of the identical construction at totally different locations.