Introduction
Quantum computing can be pretty abstract. As a result, it's rather challenging to get the imagination going when dealing with qubits, quantum circuits and quantum states. As people get started using quantum computing, one of the biggest challenges is visualizing the complex mathematics underlying quantum states. Typically, we rely on the Bloch sphere and Q-sphere. However, given the richness of the field of complex numbers, there are plenty of more interesting ways to represent quantum information.
There are two types of notebooks demonstrating how quantum computing can be visualized using fractals:
quantum-fractals-one-complex-number folder: You'll find 1- and 2-qubit notebooks showing how to create fractals based on one complex number, both in the ideal case, mimicking running on a fault-tolerant quantum computer with a simulator and after running on a real quantum computer!
quantum-fractals-multiple-complex-numbers folder: You'll find a 1-qubit notebook showing how to create even more astonishing fractals based on two complex numbers (the statevector's complex amplitudes) with a quantum simulator and after running on a real quantum computer. The second notebook makes it possible to create fractal animations and relate them to rotations on the Bloch sphere.
Read more about the project in the
- Qiskit blog post (the first blog with fractals based on one complex number)
- LinkedIn blog post (the latest blog with fractals based on multiple complex numbers)
Getting started
- Install Qiskit locally.
- Notebooks in the quantum-fractals-one-complex-number folder: Run the 1- or 2-qubit notebook with the default quantum circuit yielding both the ideal simulated fractal as well as the fractal generated after running on a real quantum computer.
In the current version nice fractals may be achieved when either the 1-qubit quantum circuit statevector isn't on the axes of the Bloch sphere or you generate a 2-qubit quantum circuit involving all four computational basis states. Both can be checked in the notebooks.
Notebooks in the quantum-fractals-multiple-complex-numbers folder: Run the 1-qubit plots notebook with the default quantum circuit yielding both ideal simulated fractals as well as the fractals generated after running on a real quantum computer.
Run the animation notebook with the default quantum circuit resulting in four animations; RZ rotations on the Bloch sphere, fractal animations generated with one complex number and two variations of Julia set mating.
You may need to experiment with different gates, phases and circuits in order to obtain a circuit that generates beautiful fractals. - Get familiar with the tutorial for the IBM Quantum Composer.
- You can also choose to write the qiskit code and not use the Composer.
Acknowledgments
This project is in honor of my late professor, Erik Mosekilde, who inspired me with his persona and his teachings and works on chaos theory, bifurcations, fractals and Turing patterns.
This work is licensed under a Creative Commons Attribution 4.0 International License.