# Quantum Genetic Algorithms for Generative 3D Creations

Alain Lioret, Kamal Hennou, Armand Dailly, Jean-Baptiste Ejarque, Louis

Foschiani, Arnaud Jourdain, Juan Maubras

► To cite this version:

Alain Lioret, Kamal Hennou, Armand Dailly, Jean-Baptiste Ejarque, Louis Foschiani, et al. Quantum Genetic Algorithms for Generative 3D Creations. Generative Art Conference 2023, Dec 2023, Rome, France. hal-04398399

HAL Id: hal-04398399

https://univ-paris8.hal.science/hal-04398399v1

Submitted on 18 Jan 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

Public Domain
# Quantum Genetic Algorithms for Generative 3D Creations

Alain Lioret

Université Paris 8
e-mail:
[alainlioret@gmail.com](mailto:alainlioret@gmail.com)

Kamal Hennou

ESGI Digital Lab
e-mail:
[hennou@myges.fr](mailto:hennou@myges.fr)

Armand Dailly

ESGI Digital Lab
e-mail:
[armanddailly@gmail.com](mailto:armanddailly@gmail.com)

Jean-Baptiste Ejarque

ESGI Digital Lab
e-mail: [jbejarque@gmail.com](mailto:jbejarque@gmail.com)

Louis Foschiani

ESGI Digital Lab
e-mail:
[foschial@gmail.com](mailto:foschial@gmail.com)

Arnaud Jourdain

ESGI Digital Lab
e-mail:
[arnaudjourdain111@gmail.com](mailto:arnaudjourdain111@gmail.com)

Juan Maubras

ESGI Digital Lab
e-mail:
[juan.maubras@outlook.fr](mailto:juan.maubras@outlook.fr)

## Abstract

This article presents an experimental generative artistic work based on bio-inspired algorithms, more specifically quantum genetic algorithms.

## 1. Introduction

Since the discovery of fractal geometry by Benoît Mandelbrot (Mandelbrot & Mandelbrot, 1982), it has become clear that much of the world around us is better described by fractal geometry than by Euclidean geometry. This is true of trees, plants, mountains, rivers, clouds, the distribution of planets in the universe, human lungs, and so many other things that make up the world we live in. Other very interesting algorithms are used to better model the world, notably cellular automata, developed by a number of major researchers (Stephen Wolfram

(Wolfram, 1984), John Conway (Conway, s. d.), Christopher Langton (Langton, 1984) in particular).

<figure><img src="image_1.png" /><figcaption>Figure 1: Quantum Cellular Automata (Lioret, 2021)</figcaption></figure>

The other great discovery that interests us here is that of quantum mechanics, which also gave us a new vision of the world at the beginning of the 20th century. Without going into too much detail, this new physics, which perfectly describes the microscopic world, is based on principles that are very confusing for humans: superposition of
states (elementary particles can be in
several places at once), entanglement
(particles can be linked by instantaneous
information systems, breaking the barrier
of the speed of light), teleportation
(information from one particle can be
teleported to another particle). We will
use these hypotheses to explore new
avenues of computational creativity.
Because with the advent of quantum
computing, users and artists are now
able to play with theories in very practical
ways.

Here, we'll be experimenting with fractal
art, quantum art, cellular automata art
and some of the major scientific concepts
that link these three worlds. And this will
lead us on to some experiments in
quantum fractal art and quantum cellular
automata, which we find interesting from
both a conceptual and aesthetic point of
view. This article shows some generative
experiments using Genetic Algorithms
based on Quantum Cellular Automata
(Arrighi, 2019), Quantum Fractals
(Nottale, 1989), Cellular Fractal
Automata (Willson, 1984) and Quantum
Cellular Automata with Fractal
Structures (Farrelly, 2020).

## 2. Quantum Genetic Algorithm

Genetic algorithms (GAs) are
evolutionary algorithms inspired by
Darwinian natural selection. They are
heuristic optimization methods that use
simulated genetic mechanisms like
mutation and crossover, as well as
population dynamics such as
reproduction and selection. In the last
decade, the concept of emulating
quantum computers has led to a new

class of GAs known as Quantum Genetic
Algorithms (QGAs).

In the late 1980s, genetic algorithms
gained popularity for optimization and
machine learning. The Nobel Prize-
winning physicist Richard Feynman
proposed the concept of a quantum
computer, which operates on the
principles of quantum mechanics. The
intriguing idea of designing a genetic
algorithm to run on a quantum computer
emerged but posed the question of its
feasibility.

<figure><img src="image_2.png" /><figcaption>Figure 2 : Richard Feynman, father of
quantum computing</figcaption></figure>

Genetic Algorithms are search algorithms grounded in Darwinian natural selection and genetic mechanisms found in organisms. In a Simple Genetic Algorithm (SGA), solutions are encoded as chromosomes, which are arrays of information. Typically, the process starts with a randomly generated initial population of chromosomes. The algorithm then iteratively evolves this population to find an optimal solution.

Each generation of chromosomes is
evaluated to determine their fitness,
reflecting the quality of the solution they
encode. The fittest chromosomes are
selected as the "parents" for the next
generation, simulating natural selection. The new generation is then produced through genetic mechanisms like crossover and mutation. (Lahoz-Beltra, 2016)

### 3. Comparison of Genetic Algorithm and Quantum Genetic Algorithm

It's interesting to compare a classical genetic algorithm with a quantum genetic algorithm. Zakaria Laboudi and Salim Chikhi, compares Conventional Genetic Algorithms (CGA) with Quantum Genetic Algorithms (QGA). Evolutionary computation, the basis for genetic algorithms, has been a part of computer science for over four decades, originating in the 1970s with John Holland. Quantum computation, combining information science and quantum physics, gained prominence with algorithms from Shor and Grover for factorization and database search, respectively. QGA represents a fusion of GA principles with quantum computing, aiming to enhance the exploration of search spaces.

Laboudi focuses on comparing the computational capabilities of GA and QGA, particularly using the classic 0/1 knapsack problem as a test case. (Laboudi & Chikhi, 2012)

<figure><img src="image_3.png" /><figcaption>Figure 3: Comparison of Classical Genetic Algorithm and Quantum Genetic Algorithm</figcaption></figure>

### 4. RQGA: Reduced Quantum Genetic Algorithms

The Reduced Quantum Genetic Algorithm (RQGA) is a Python program demonstrating how to implement a 'true' quantum genetic algorithm, based on a fitness quantum gate and Grover's search algorithm. It is used for educational and research purposes. The RQGA was introduced as a fully quantum method to run genetic algorithms on a quantum computer, presenting a new methodology for this type of algorithms. As its name suggests, the RQGA aims to be a quantum version of the classical evolutionary process in a simplified setup. There has also been a proposal for a circuit level implementation of the RQGA using Python and Qiskit, with the main goal of analyzing the circuit complexity from various perspectives.
The Reduced Quantum Genetic Algorithm (RQGA) was proposed by Udrescu, Prodan & Vlăduțiu in 2006. Mihai Udrescu explores the application of genetic algorithms (GAs) within the quantum computing framework to solve the NP-hard graph coloring problem. Genetic algorithms, which are inspired by natural selection, have been adapted in the form of a Reduced Quantum Genetic Algorithm (RQGA). This adaptation leverages quantum computing's capabilities to potentially solve problems more efficiently than classical algorithms.

The RQGA specifically addresses both vertex and edge coloring of graphs and is also capable of determining the chromatic number, which is the minimum number of colors needed to color a graph without any two adjacent vertices sharing the same color. The authors propose a method that can solve the graph coloring problem in $O(N1/2)O(N1/2)$ time, which is significant given that graph coloring is known to be a computationally intensive task.

Ardelean and Udrescu's implementation is tested in a quantum simulation environment. Their work details the algorithm's convergence and performance metrics, suggesting that the RQGA is a robust tool for tackling this class of problems. The research presents a compelling case for the application of quantum principles to evolutionary algorithms, potentially opening new

avenues for solving other complex computational problems.

This work demonstrates the ongoing integration of quantum computing principles into broader computer science applications, highlighting the quantum genetic algorithm's potential to outperform its classical counterparts in specific instances. The study's findings contribute to the growing body of knowledge supporting quantum computing's role in addressing and solving NP-hard problems. (Ardelean & Udrescu, 2022)

## 5. Quantum Art

A number of artists have seized on quantum theories to experiment with their art. These include the work of Julian Voss-Andreae, Libby Heaney, Alain Lioret and Omar Costa Hamido (Hamido, 2021).

Some of these artists only used analogies with the principles of quantum mechanics, whereas more recently, the emergence of quantum computing has made it possible to work directly and practically with its concepts. This is how artist-researchers such as James Wootton (Wootton, 2020), Russell Huffman and Alain Lioret (Lioret, 2016) laid the foundations for the first true quantum artworks.
<figure><img src="image_4.png" /><figcaption>Figure 4: Quantum Sculptures by Julian Voss Andreae</figcaption></figure>

**6. Towards new experiments in computational creativity**

We have embarked on a journey of artistic experimentation utilizing a quantum genetic algorithm. This advanced algorithm has been applied to the deformation of mesh structures, infusing them with new, unexpected forms. Moreover, we extended its application to fractal objects and shapes generated by cellular automata, exploring the boundary between algorithmic precision and creative expression. Below is the algorithm that we employed in our quest to meld science and art:

QGA Algorithm :

- Create a population of randomly initialized qubits by applying a Hadamard gate.

- Measure and evaluate its correspondence with the desired result

- Retrieve the N best elements according to their correspondence with the desired result

- Mutation of previously selected elements using a flip on the X-gate and the application of a Hadamard gate

- Repeat for the defined number of generations

- Recovery of the best elements

<figure><img src="image_5.png" /><figcaption>Figure 5: Genetic quantum deformation of a mesh made with QGA</figcaption></figure>

In our continuous exploration of the intersection between technology and art, we have implemented a variant using the Reduced Quantum Genetic Algorithm (RQGA). This cutting-edge algorithm has been adeptly adapted to manipulate mesh deformations, introducing a novel dimension to our digital sculptures. Furthermore, we have employed this variant to shape fractals and patterns emerging from cellular automata, pushing the envelope of generative art. This initiative harnesses the RQGA, integrating its sophisticated mechanisms into our creative toolkit:

RQGA Algorithm

- Initialize a circuit containing n qubits

- We set each qubit in superposition state with a Hadamard gate

- We modify the state of each qubit starting from a random angle between 0 and pi / n, (pi / n can be increased if we wish a slower evolution between each
generation), modifying the state of our qubits in a random way allows us to observe the evolution of other genes than the one we wish and thus observe a more natural evolution.

- We apply Grover's algorithm to select the gene we want our population to evolve towards

- We observe the result after 1 generation; if required, we can apply Grover's algorithm several times to simulate evolution over several generations.

We present here a collection of creations crafted with both the quantum genetic algorithm and its variant, the RQGA. These pieces represent a fusion of algorithmic complexity and artistic vision, showcasing the transformative power of mesh deformation and the intricate beauty of fractal and cellular automata-generated objects. Each creation is a testament to the seamless synergy between advanced computation and the boundless realm of art, illustrating the rich possibilities that emerge when these two worlds collide.

<figure><img src="image_6.png" /><figcaption>Figure 6: quantum structure of a Burger</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Figure 7: Quantum Fractal Creation made with QCA Algorithm (2023)</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>Figure 8: Quantum Fractal Creation made with RQCA Algorithm (2023)</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>Figure 9: Quantum Mesh Creation made with RQCA Algorithm (2023)</figcaption></figure>
<figure><img src="image_10.png" /><figcaption>Figure 10: Quantum Mesh Creation made with QCA Algorithm (2023)</figcaption></figure>

## 7. Future Works

These first quantum genetic algorithm experiments are very interesting and enable us to create 3D generative forms with innovative creation processes. The method used here remains fairly simple, and it would be very interesting to introduce Machine Learning concepts to further explore the possibilities offered by complex space computations where bio-inspired algorithms and quantum computation meet.

Looking ahead, we envision future works where animation becomes a central element, bringing our algorithmic creations to life. By incorporating motion, we aim to explore the temporal evolution of forms, where meshes unfold and fractals breathe, all orchestrated by the RQGA. This dynamic layer will add a new dimension of interactivity and realism, inviting viewers to witness the dance of pixels and vertices, a choreography guided by the sophisticated rules of quantum genetics. These animated artworks will not only captivate the eye but will also stir contemplation on the fluid nature of digital artistry.

## References :

Ardelean, S. M., & Udrescu, M. (2022). Graph coloring using the reduced quantum genetic algorithm. PeerJ Computer Science, 8, e836.

Arrighi, P. (2019). An overview of quantum cellular automata. Natural Computing, 18(4), 885-899. https://doi.org/10.1007/s11047-019-09762-6

Conway, J. (s. d.). The game of life. 1970. Scientific American, 223.

Farrelly, T. (2020). A review of quantum cellular automata. Quantum, 4, 368.

Hamido, O. C. (2021). Adventures in Quantumland. University of California, Irvine.

https://search.proquest.com/openview/ddf8288bf4490f2a9c3b8094710ce68d/1?pq-origsite=gscholar&cbl=18750&diss=y

Laboudi, Z., & Chikhi, S. (2012). Comparison of genetic algorithm and quantum genetic algorithm. Int. Arab J. Inf. Technol., 9(3), 243-249.

Lahoz-Beltra, R. (2016). Quantum genetic algorithms for computer scientists. Computers, 5(4), 24.

Langton, C. G. (1984). Self-reproduction in cellular automata. Physica D: Nonlinear Phenomena, 10(1-2), 135-144.

Lioret, A. (2016). Quantum art. Proceedings of the Joint Symposium on Computational Aesthetics and Sketch Based Interfaces and Modeling and Non-
Photorealistic Animation and Rendering,
135-139.

https://diglib.eg.org/bitstream/handle/10.2
312/exp20161072/135-139.pdf

Mandelbrot, B. B., & Mandelbrot, B. B. (1982). The fractal geometry of nature (Vol. 1). WH freeman New York. http://users.math.yale.edu/~bbm3/web_pdfs/encyclopediaBritannica.pdf

Nottale, L. (1989). FRACTALS AND THE
QUANTUM THEORY OF SPACETIME.
International Journal of Modern Physics
A, 04(19), 5047-5117.
https://doi.org/10.1142/S0217751X89002
156

Willson, S. J. (1984). Cellular automata can generate fractals. Discrete Applied Mathematics, 8(1), 91-99.

Wolfram, S. (1984). Cellular automata as models of complexity. Nature, 311(5985), 419-424.

Wootton, J. R. (2020). Procedural generation using quantum computation. International Conference on the Foundations of Digital Games, 1-8. https://doi.org/10.1145/3402942.3409600