# Quantum artificial life

Quantum artificial life is the application of quantum algorithms with the ability to simulate biological behavior. Quantum computers offer many potential improvements to processes performed on classical computers, including machine learning and artificial intelligence. Artificial intelligence applications are often inspired by the idea of mimicking human brains through closely related biomimicry. This has been implemented to a certain extent on classical computers (using neural networks), but quantum computers offer many advantages in the simulation of artificial life. Artificial life and artificial intelligence are extremely similar, with minor differences; the goal of studying artificial life is to understand living beings better, while the goal of artificial intelligence is to create intelligent beings.
In 2016, Alvarez-Rodriguez et al. developed a proposal for a quantum artificial life algorithm with the ability to simulate life and Darwinian evolution. In 2018, the same research team led by Alvarez-Rodriguez performed the proposed algorithm on the IBM ibmqx4 quantum computer, and received optimistic results. The results accurately simulated a system with the ability to undergo self-replication at the quantum scale.

## Artificial life on quantum computers

The growing advancement of quantum computers has led researchers to develop quantum algorithms for simulating life processes. Researchers have designed a quantum algorithm that can accurately simulate Darwinian Evolution. Since the complete simulation of artificial life on quantum computers has only been actualized by one group, this section shall focus on the implementation by Alvarez-Rodriguez, Sanz, Lomata, and Solano on an IBM quantum computer.
Individuals were realized as two qubits, one representing the genotype of the individual and the other representing the phenotype. The genotype is copied to transmit genetic information through generations, and the phenotype is dependent on the genetic information as well as the individual's interactions with their environment. In order to set up the system, the state of the genotype is instantiated by some rotation of an ancillary state ($|0\rangle \langle 0|$). The environment is a two-dimensional spatial grid occupied by individuals and ancillary states. The environment is divided into cells that are able to possess one or more individuals. Individuals move throughout the grid and occupy cells randomly; when two or more individuals occupy the same cell they interact with each other.

### Self replication

The ability to self-replicate is critical for simulating life. Self-replication occurs when the genotype of an individual interacts with an ancillary state, creating a genotype for a new individual; this genotype interacts with a different ancillary state in order to create the phenotype. During this interaction, one would like to copy some information about the initial state into the ancillary state, but by the no cloning theorem, it is impossible to copy an arbitrary unknown quantum state. However, physicists have derived different methods for quantum cloning which does not require the exact copying of an unknown state. The method that has been implemented by Alvarez-Rodriguez et al. is one that involves the cloning of the expectation value of some observable. For a unitary $U$ which copies the expectation value of some set of observables ${\mathsf {X}}$ of state$\rho$ into a blank state$\rho _{e}$, the cloning machine is defined by any $(U,\rho _{e},{\mathsf {X}})$ that fulfill the following:
$\forall \rho \forall X\in {\mathsf {X}}$ ${\bar {X}}={\bar {X_{1}}}={\bar {X_{2}}}$
Where ${\bar {X}}$ is the mean value of the observable in $\rho$ before cloning, ${\bar {X_{1}}}$ is the mean value of the observable in $\rho$ after cloning, and ${\bar {X_{2}}}$ is the mean value of the observable in $\rho _{e}$ after cloning. Note that the cloning machine has no dependence on $\rho$ because we want to be able to clone the expectation of the observables for any initial state. It is important to note that cloning the mean value of the observable transmits more information than is allowed classically. The calculation of the mean value is defined naturally as:
${\bar {X}}=Tr[\rho X]$, ${\bar {X_{1}}}=Tr[RX\otimes I]$, ${\bar {X_{2}}}=Tr[RI\otimes X]$ where $R=U\rho \otimes \rho _{e}U^{\dagger }$
The simplest cloning machine clones the expectation value of $\sigma _{z}$ in arbitrary state $\rho =|\psi \rangle \langle \psi |$ to $\rho _{e}=|0\rangle \langle 0|$ using$U=CNOT$. This is the cloning machine implemented for self-replication by Alvarez-Rodriguez et al. The self-replication process clearly only requires interactions between two qubits, and therefore this cloning machine is the only one necessary for self replication.

### Interactions

Interactions occur between individuals when the two take up the same space on the environmental grid. The presence of interactions between individuals provides an advantage for shorter-lifespan individuals. When two individuals interact, exchanges of information between the two phenotypes may or may not occur based on their existing values. When both individual's control qubits (genotypes) are alike, no information will be exchanged. When the control qubits differ, the target qubits (phenotype) will be exchanged between the two individuals. This procedure produces a constantly changing predator-prey dynamic in the simulation. Therefore, long-living qubits, with a larger genetic makeup in the simulation, are at a disadvantage. Since information is only exchanged when interacting with an individual of different genetic makeup, the short-lived population has the advantage.

### Mutation

Mutations exist in the artificial world with limited probability, equivalent to their occurrence in the real world. There are two ways in which the individual can mutate: through random single qubit rotations and by errors in the self-replication process. There are two different operators that act on the individual and cause mutations. The M operation causes a spontaneous mutation within the individual by rotating a single qubit by parameter θ. The parameter θ is random for each mutation, which creates biodiversity within the artificial environment. The M operation is a unitary matrix which can be described as:
$M={\begin{pmatrix}\cos(\theta )&sin(\theta )\\sin(\theta )&-cos(\theta )\end{pmatrix}}$
The other possible way for mutations to occur is due to errors in the replication process. Due to the no-cloning theorem, it is impossible to produce perfect copies of systems that are originally in unknown quantum states. However, quantum cloning machines make it possible to create imperfect copies of quantum states, in other words, the process introduces some degree of error. The error that exists in current quantum cloning machines is the root cause for the second kind of mutations in the artificial life experiment. The imperfect cloning operation can be seen as:
$U_{M}(\theta )=\mathrm {I} _{4}+{\frac {1}{2}}{\begin{pmatrix}0&0\\0&1\end{pmatrix}}\otimes {\begin{pmatrix}-1&1\\1&-1\end{pmatrix}}(cos\theta +isin\theta +1)$
The two kinds of mutations affect the individual differently. While the spontaneous M operation does not affect the phenotype of the individual, the self-replicating error mutation, UM, alters both the genotype of the individual, and its associated lifetime.
The presence of mutations in the quantum artificial life experiment is critical for providing randomness and biodiversity. The inclusion of mutations helps to increase the accuracy of the quantum algorithm.

### Death

At the instant the individual is created (when the genotype is copied into the phenotype), the phenotype interacts with the environment. As time evolves, the interaction of the individual with the environment simulates aging which eventually leads to the death of the individual. The death of an individual occurs when the expectation value of $\sigma _{z}$ is within some $\epsilon$ of 1 in the phenotype, or, equivalently, when $\rho _{p}=|0\rangle \langle 0|$
The Lindbladian describes the interaction of the individual with the environment: ${\dot {\rho }}=\gamma (\sigma \rho \sigma ^{\dagger }-{\frac {1}{2}}\sigma ^{\dagger }\sigma \rho -{\frac {1}{2}}\rho \sigma ^{\dagger }\sigma )$ with $\sigma =I\otimes |0\rangle \langle 1|$ and without$\rho =\rho _{g}\otimes \rho _{p}$. This interaction causes the phenotype to exponentially decay over time. However, the genetic material contained in the genotype does not dissipate which allows for genes to be passed on to subsequent generations. Given the initial state of the genotype:
$\rho _{g}={\begin{pmatrix}a&b-ic\\b+ic&1-a\\\end{pmatrix}}$
The expectation values of the genotype and phenotype can be described as:
$\langle \sigma _{z}\rangle _{g}=2a-1$,$\langle \sigma _{z}\rangle _{p}=1-2e^{\gamma t}(1-a)$. Where 'a' represents a single genetic parameter. From this equation, we can see that as 'a' is increased, the life expectancy decreases. Equivalently, the closer the initial state is to $|1\rangle \langle 1|$, the greater the life expectancy of the individual.
When $\langle \sigma _{z}\rangle _{p}=1-\epsilon$, the individual is considered dead, the phenotype is used as the ancillary state for a new individual. Thus, the cycle continues and the process becomes self-sustaining.