We begin with a brief description of the model for quantum artificial life20, whose most important elements are the quantum living units or individuals. Each of them is expressed in terms of two qubits that we call genotype and phenotype. The genotype contains the information describing the type of living unit, an information that is transmitted from generation to generation. The state of the phenotype is determined by two factors: the genetic information and the interaction between the individual and its environment. This state, together with the information it encodes, is degraded during the lifetime of the individual.

The goal of the proposed model is to reproduce the characteristic processes of Darwinian evolution, adapted to the language of quantum algorithms and quantum computing. The self-replication mechanism is based on two partial quantum cloning events, an operation that entangles either the genotype or the phenotype with a blank state and copies a certain expectation value of the original qubit in both of the outcome qubits. In this set of experiments, the self-replication consists in duplicating the expectation value of σ z in the genotype, in a blank state that will be transformed in the genotype of the individual in the next generation19. The process is completed by copying again σ z of the new genotype in another blank state that will be transformed in the phenotype of the new individual. The next subprotocol in the algorithm is the interaction between the individuals and the environment, which emulates the aging of living units until an asymptotic state that represents its death. This evolution is encoded in a dissipative dynamics that couples a bath with each of the phenotype qubits, with σ = |0〉〈1| as Lindblad operator. The effective lifetime, i.e., the time the phenotype needs to arrive to the dark state of the Lindbladian up to a given error, depends implicitly on the genotype. The protocol also accounts for mutations, performed via random single qubit rotations in the genotype qubits or via errors in the self-replication process20. The final ingredient is the interaction between individuals, which conditionally exchange the phenotypes depending on the genotypes20. This behavior is achieved via a four-qubit unitary operation, where genotypes and phenotypes play the role of control and target qubits, respectively. The conjunction of these components leads to a minimal but consistent Darwinian quantum scenario. The protocol may be enriched when including spatial information, either quantum or classical, or increasing the model complexity by considering a larger set of observables.

The first step for this implementation is to express each of the building blocks of the previous paragraph in terms of the quantum gates available in the superconducting circuit architecture of IBM cloud quantum computer34. Since we have selected σ z as the observable to clone, every partial quantum cloning event requires the realization of a U CNOT gate, that can be directly performed in the experiment. Regarding the interaction with the environment, we have adapted our protocol, because the experimental device does not allow to realize a conditional projection of the quantum state to the |0〉 in the phenotypes. The alternative we propose is to implement the transition between the basis states as a sequence of small rotations in σ y for the phenotype qubits, \({e}^{-i{\sigma }_{y}\theta }\), with θ tuned according to the duration of each simulated time step. We have employed u 2 (ϕ, λ) and u 3 (θ, ϕ, λ) available in the experimental platform, to implement the single qubit gates.

$${u}_{2}(\varphi ,{\rm{\lambda }})=\frac{1}{\sqrt{2}}(\begin{array}{cc}1 & -{e}^{i{\rm{\lambda }}}\\ {e}^{i\varphi } & {e}^{i({\rm{\lambda }}+\varphi )}\end{array})\,{u}_{3}(\theta ,\varphi ,{\rm{\lambda }})=(\begin{array}{cc}\cos \,\frac{\theta }{2} & -{e}^{i{\rm{\lambda }}}\,\sin \,\frac{\theta }{2}\\ {e}^{i\varphi }\,\sin \,\frac{\theta }{2} & {e}^{i(\varphi +{\rm{\lambda }})}\,\cos \,\frac{\theta }{2}\end{array})$$ (1)

The gate u 3 (θ, 0, 0) acting on genotype qubits can be used for the mutation events. Ideally, and in order to emulate their randomness both in the phase θ and in the presence or absence of the event, we could design the experimental runs following a classical program. For making the procedure tractable, we could discretize the range of θ in n values, and divide the total experimental runs in n + 1 groups to account for each of the different possibilities. The weight, or number of runs for each group, would depend on our selection for the mutation rate as well as on the random parameters obtained with the external program. However, constrained by the flexibility of the experimental device, we propose a less realistic but pragmatic procedure: assume that the mutations will only be of a specific θ and therefore eliminate a source of randomness and diversity in the protocol. The single-qubit gate accounting for the mutations will be σ x . Regarding the randomness in the presence or absence of mutation events, we will have to adapt our algorithm to perform the mutations in groups of 1024 experimental runs, and achieve the mutation rate accordingly. The last subprotocol, the inter-individual interactions, requires the implementation of the interaction gate U I , whose effect is to exchange two pairs of quantum levels, while leaving the rest unaltered, as U I |xxyy〉 = |xyyx〉 and U I |xyyx〉 = |xxyy〉, for {x, y} ∈ {0, 1}. The challenge is to decompose U I in terms of the gates offered by the experimental setup. Our solution is given by \({U}_{I}={S}_{23}{U}_{12}({\mathbb{1}}\otimes F){U}_{12}{S}_{23}\), with \(F={U}_{43}{C}_{34}{C}_{24}{U}_{23}{C}_{34}^{\dagger }{U}_{43}{U}_{23}\). Here, the first and second subindices denote the control and target qubit respectively, U is the controlled-not gate, S is the SWAP gate and C is the controlled square root of not gate. These can be rewritten in terms of the controlled-not gate as S ij = U ij U ji U ij and \({C}_{12}=(T\otimes P{u}_{3}(\,-\,\pi /4,0,\mathrm{0)}){U}_{12}({\mathbb{1}}\otimes {u}_{3}(\pi \mathrm{/4,0,0)}){U}_{12}({\mathbb{1}}\otimes {P}^{\dagger })\), with \(P=\sqrt{{\sigma }_{z}}\) and \(T=\sqrt{P}\). An additional relation to point out is that the control target behavior in the controlled-not gate can be exchanged by introducing Hadamard gates, U 21 = (H ⊗ H)U 12 (H ⊗ H). This is a useful formula for designing the quantum circuit in an experimental platform that only allows a single direction for the implementation of the U CNOT .

Experiments

Interaction between two individuals

We start with a quantum circuit designed for reproducing the dynamics of two interacting individuals. Two precursor genotypes are initialized in \(|\psi {\rangle }_{{g}_{1}}=\,\cos \,\frac{\pi }{8}\mathrm{|0}\rangle +\,\sin \,\frac{\pi }{8}\mathrm{|1}\rangle \) and \(|\psi {\rangle }_{{g}_{2}}=\,\cos \,\frac{3\pi }{8}\mathrm{|0}\rangle +\,\sin \,\frac{3\pi }{8}\mathrm{|1}\rangle \) with u 3 . Afterwards, both individuals are completed by copying the genotype qubits in blank states via U CNOT gate, \(|\psi {\rangle }_{1}=\,\cos \,\frac{\pi }{8}\mathrm{|00}\rangle +\,\sin \,\frac{\pi }{8}\mathrm{|11}\rangle \) and \(|\psi {\rangle }_{2}=\,\cos \,\frac{3\pi }{8}\mathrm{|00}\rangle +\,\sin \,\frac{3\pi }{8}\mathrm{|11}\rangle \). In terms of θ 1 = π/8 and θ 2 = 3π/8, the complete state, |ψ 1 〉 ⊗ |ψ 2 〉, reads

$$|\psi \rangle =\,\cos \,{\theta }_{1}\,\cos \,{\theta }_{2}\mathrm{|0000}\rangle +\,\cos \,{\theta }_{1}\,\sin \,{\theta }_{2}\mathrm{|0011}\rangle +\,\sin \,{\theta }_{1}\,\cos \,{\theta }_{2}\mathrm{|1100}\rangle +\,\sin \,{\theta }_{1}\,\sin \,{\theta }_{2}\mathrm{|1111}\rangle .$$

We now apply the interaction gate U I to conclude this building block,

$${U}_{I}|\psi \rangle =\,\cos \,{\theta }_{1}\,\cos \,{\theta }_{2}\mathrm{|0000}\rangle +\,\cos \,{\theta }_{1}\,\sin \,{\theta }_{2}\mathrm{|0110}\rangle +\,\sin \,{\theta }_{1}\,\cos \,{\theta }_{2}\mathrm{|1001}\rangle +\,\sin \,{\theta }_{1}\,\sin \,{\theta }_{2}|1111\rangle .$$

Notice that the interaction fully exchanges the phenotypes, 〈σ z 〉 2 and 〈σ z 〉 4 , that are now equal to the opposite genotype, \({\langle {\sigma }_{z}\rangle }_{1}={\cos }^{2}{\theta }_{1}-{\sin }^{2}{\theta }_{1}={\langle {\sigma }_{z}\rangle }_{4}\) and \({\langle {\sigma }_{z}\rangle }_{3}={\cos }^{2}{\theta }_{2}-{\sin }^{{\rm{2}}}\,{\theta }_{2}={\langle {\sigma }_{z}\rangle }_{2}\).

The experiment is planned to reduce the total errors induced by the use of two-qubit gates. Consequently, we have reordered the initial Hilbert space |g 1 p 1 g 2 p 2 〉, where g i is genotype and p i is phenotype, as |p 2 g 2 p 1 g 1 〉 and assigned each of these qubits to the experimental ones |Q 0 Q 1 Q 2 Q 3 〉. See Fig. 1 for the remaining quantum circuit diagram.

Figure 1 Quantum circuit diagram for the protocol of two interacting individuals. Squares with a continuous line denote the phase values of u 3 gate, while squares with a dashed line denote the phase values of u 2 gate, both in units of π. When possible we reduce the expression to the value of θ and avoid writing the additional phases. Full size image

The results, in Table 1, agree with the ideal case with a 71.58% fidelity according to \(F(p,q)={\sum }_{j}\,\sqrt{{p}_{j}{q}_{j}}\), that compares the probability distribution obtained when measuring in the computational basis with the theoretical prediction. Therefore, this result is valid, but not equivalent to the one that is expected when the complete wave function is considered, which is hindered by the use of full tomography and computed via \(F({\rho }_{1},{\rho }_{2})={\rm{Tr}}\sqrt{\sqrt{{\rho }_{1}}{\rho }_{2}\sqrt{{\rho }_{1}}}\)36. The expectation values extracted from the data show a reasonable overlap between p 1 and g 2 , as expected and a considerable distance between g 1 and p 2 .

Table 1 Interaction between two individuals. Full size table

Interaction with the environment

In this round of experiments we test the combination of partial quantum cloning events and dissipation. A precursor genotype is initialized in \(|\psi {\rangle }_{{g}_{1}}=\,\cos \,\frac{\pi }{3}\mathrm{|0}\rangle +\,\sin \,\frac{\pi }{3}\mathrm{|1}\rangle \), and the individual completed with a first partial quantum cloning event via U CNOT and a blank state, \(|\psi {\rangle }_{1}=\,\cos \,\frac{\pi }{3}\mathrm{|00}\rangle +\,\sin \,\frac{\pi }{3}\mathrm{|11}\rangle \). Then, a single qubit rotation, u 3 (π/8, 0, 0), is applied in the phenotype, that substitutes the dissipation in a discrete manner, losing its exponential character. The course of time is simulated by this gate, by implementing one of them for every simulated time step. Subsequently, a second individual is created in a complete self-replication event with two partial quantum cloning operations. To conclude, u 3 (π/8, 0, 0), is implemented again on both genotypes associated with a next time step. We assign the Hilbert space of the simulating device as |Q 0 Q 1 Q 2 Q 4 〉 → |p 2 g 2 g 1 p 1 〉 to maximize the efficiency of the protocol. See Fig. 2 for the quantum circuit diagram. The results, shown in Table 2, account for similar probability distributions between the ideal and the real data with a fidelity of 91.18%, as before computed only for the computational basis.

Figure 2 The initialization of a genotype before three partial quantum cloning events. The first of these will produce an initial individual and the remaining two will replicate it into a second one. The protocol continues with single-qubit gates that emulate the dissipation. The squares denote u 3 (θ, ϕ, λ) gates where the number indicates the value of θ. Full size image

Table 2 Self-replication and interaction with the environment in the σ z basis. Full size table

For the self-replication instance, there is an additional property of the model that only arises when measuring some purely quantum correlations of the system. The partial quantum cloning operation entangles the qubits which are involved on it, transmitting 〈σ x 〉 of the original state into 〈σ x ⊗ σ x 〉. Note that this data can be extracted from the experiment when measuring on the σ x basis, which is done by introducing a Hadamard gate in every entry before projecting. Therefore, one has to compute 〈σ z ⊗ σ z ⊗ σ z ⊗ σ z 〉 in the new basis, to retrieve 〈σ x ⊗ σ x ⊗ σ x ⊗ σ x 〉. This technique is based on the equality Tr[σ x ρ] = Tr[σ z HρH], since σ x = Hσ z H. Even if the calculation for the fidelity yields a satisfactory 93.45%, the value of 〈σ x ⊗ σ x ⊗ σ x ⊗ σ x 〉 still shows a sizable error with respect to the ideal one, as we show in Table 3.

Table 3 Self-replication and interaction with the environment in the σ x basis. Full size table

Even if this implementation does not coincide with the time evolution presented in the original model, it is able to emulate its results when only focusing on the σ z or σ x basis, but not to compare both measurements in general. Accordingly, if the lifetimes of each living qubits undergo a similar dynamics to the ones proposed in the model, the effect of the environment on the correlations cannot be correctly reproduced, and viceversa, unless the gates are specifically selected for a given precursor genotype. The theoretical value of 〈σ x ⊗ σ x ⊗ σ x ⊗ σ x 〉 for a system that only undergoes self-replication events and dissipation decreases as \(\langle {\sigma }_{x}\rangle {e}^{-\gamma ({t}_{1}+{t}_{2})/2}\), with 〈σ x 〉 calculated over the precursor genotype and t i being the time between self-replication events. For the variant of the single qubit gates analyzed here, the theoretical value goes as 〈σ x 〉 cosθ 1 cosθ 2 , where θ i indicate the phase of each u 3 (θ i , 0, 0). This part of the dissipative dynamics should match with the evolution of 〈σ z 〉, so the following set of equations should be fulfilled:

$$\begin{array}{c}{e}^{-\gamma ({t}_{1}+{t}_{2})/2}\langle {\sigma }_{x}\rangle =\,\cos \,{\theta }_{1}\,\cos \,{\theta }_{2}\langle {\sigma }_{x}\rangle \\ 1-2{e}^{-\gamma ({t}_{1}+{t}_{2})}\mathrm{(1}-a)=\mathrm{(2}a-\mathrm{1)}\,\cos \,{\theta }_{1}\\ 1-2{e}^{-\gamma {t}_{2}}\mathrm{(1}-a)=\mathrm{(2}a-\mathrm{1)}\,\cos \,{\theta }_{2}\end{array}$$ (2)

where a is the |0〉〈0| component in the precursor genotype. Given that there is no solution for θ 1 and θ 2 which is independent of a, the method of single-qubit gates for mimicking the dissipation is not valid as a general protocol, because it has to be tuned for each case. Nevertheless, the important quantum feature of the model, the existence of quantum correlations, and their role as witnesses of the interactions between quantum living units can correctly be represented with the approach followed here, even if their time dependence is different to the one presented in the original model.

In more practical terms, the implementations summarized in Tables 2 and 3 are realistic, but not compatible between them, because both can be associated to dissipative dynamics but with different representative parameters, as we have seen in Eq. (2). Furthermore, we believe that the ideal realization of the experiment will soon be feasible at least for a small number of individuals. Our proposal for introducing the dissipation is to exploit the natural decoherence present in quantum platforms and use error correction protocols only in the genotype qubits. This phenotype-genotype asymmetry in the decay probability is the key element in the emulation of the interaction between individuals and environment.

The implementation of mutations requires to combine the outcome of different designs of quantum circuit diagrams and, therefore, experimental runs. In this case, we consider that a mutation event, which can affect both individuals, is simulated with a σ x . The complete result is achieved when gathering data from 4 different groups of experiments, that correspond to the cases of mutation on the first genotype, mutation on the second genotype, mutation on both genotypes and no mutation. We have performed 1024 experimental runs for each of the three cases with mutations and 8192 runs for the no-mutation rate. These results have been combined with the ones shown in Table 2, that coincide with the no-mutation case, with the goal of reducing the mutation rate for each individual, which takes a final value of 2/19. Table 4 contains the agreggated data of the mutation experiments. In IVb the mutation occurs before the self-replicating event, therefore affecting the second individual, in IVc the mutation can only occur after the second individual has been created, and IVd contains both mutations. See the illustration of this process in Fig. 3. See Table 4 for the measured data with a fidelity of 94.86% with respect to the ideal case in the σ z basis.

Table 4 Self-replication, interaction with the environment and mutations. Full size table

Figure 3 Visualization of the ideal processes in experiments I and IV. We depict the individuals as combinations of two diamonds that represent the genotype and phenotype qubits. The color in the genotype qubit, the upper diamond of each pair, depends on the value of σ z as indicated in the color bar. The color in the phenotype qubit is the same as in the genotype one, as the color is meant to be showing the genetic information. Moreover, the opacity of this color is modified according to the expectation value of σ z being limited by the value of 1 that corresponds to the blank qubits. In both cases the right arrow separates two consecutive time steps. Following these clarifications, we can see the exchange of phenotypes in I and the self-replication followed by different mutation possibilities in IV. Full size image

Realization of the complete model of quantum artificial life

The last round of experiments is devoted to the reproduction of the aggregate of properties in the quantum artificial life algorithm. In order to maintain the fidelity in values that allow us to claim that the experiment is indeed behaving according to the protocol, we restrict our analysis to the case of two interacting individuals, which undergo mutations and dissipation. Then, the quantum circuit diagram, shown in Fig. 4, is an upgraded version of the one shown in Fig. 1 that includes u 3 (π/8, 0, 0) for simulating the dissipation in the phenotypes. For the mutations, we follow the same strategy as in the previous subsection, combining the data generated with different quantum circuit diagrams each of them emulating a specific case of the presence or absence of mutation instances. In particular, 3 rounds of 8192 runs emulating the no-mutation case and 1024 runs for each of the mutation cases determine a mutation rate of 2/27. The post-processing of the data, in Table 5, matches the ideal probability distribution in the computational basis with a fidelity of 93.94%.

Figure 4 Quantum circuit diagram for the complete quantum artificial life protocol. Squares with a continuous line denote the phase values of u 3 gate, while squares with a dashed line denote the phase values of u 2 gate, both in units of π. When possible we reduce the expression to the value of θ and avoid writing the additional phases. Full size image