Qautomata is a two dimensional quantum cellular automata.
Given a starting configuration containing some living cells and a set of rules, it computes the evolution of the universe.
We start with a universe containing one configuration with some living cells and a set of rules represented by an operator matrix.
During each step and for each configuration in the global state, we apply the rules locally on 2*2 squares that alternate at each step:
- On odd steps, the rules apply on each 2*2 square outlined in black (some cells are visually missing, but they are here in the computation):
This alternation allows the propagation of living cells in the entire universe.
We compute the next state of each local 2*2 square with at least one living cell using the operator matrix.
We obtain a list (with at least one element) of 2*2 square state with each element associated with a complex number.
This list is obtained by computing the product of the vector that represents the state of a local 2*2 square and the operator matrix.
- If there is only one element in the list, we update the configuration with the new 2*2 square state and multiply its amplitude by the complex number associated with the new 2*2 square state. (see visual example step 5-8)
- If there are several elements in the list, we split the configuration into superposed configurations, one for each element in the list. We then update each new configuration with one element of the list: we update the configuration with the new 2*2 square state and multiply its amplitude by the complex number associated with the new 2*2 square state. (see visual example step 0-1)
We then check for interference and the step is over. (see visual example step 4-5)
During the step we also compute the combined state of the universe that we will be used to visualize the universe in the UI.
qautomata-diagonal.mp4
If no state file is provided, draw living cells by clicking on dead cells or draw dead cells by clicking on living cells.
Button that starts the qautomata, only available while drawing.
Button that pauses the qautomata and give access to all other buttons.
Button that resets the qautomata to the starting state file.
Button that runs the qautomata (unpausing), steps will then be computed automatically.
Button that computes the next step of the qautomata.
Button that applies a measure to the qautomata.
Button to enable/disable the automatic measure.
Max number of superposed configurations after a step, if there is more (and auto measure is on) an automatic measure is applied.
Button to enable/disable the display of the rules squares.
Button to enable/disable the display of the probabilities on the combined state.
Button to display the combined state.
Button to display a given configuration.
qautomata-ui-demo.mp4
The project is divided into 3 parts:
- core: contains the data and computing part of the qautomata
- ui: desktop ui implemented with nannou, used to visualize and interact with the qautomata
- web: launch the ui into the web (not fully functional yet)
From the root of the repository run cargo run -p ui [state file]
To test the web ui:
- install
npm
andnode
> 18 - install
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- move to the web folder
cd ./web
- install deps
npm install
- run the web app
npm run start
To test the web application as a binary:
- from the root of the repository run
cargo run -p web
An instance of the qautomata, it contains:
- A global state
- A set of rules
- The parity of the current step
- The number of step elapsed since the beginning
- The combined state
A list of superposed configurations each associated with an amplitude.
A grid of cells.
An element of the grid of the configuration that can either be dead or alive.
A complex number associated with a configuration, it can be used to compute the probability associated with the configuration.
Probability of a configuration to be selected in case of a measure. It's the squared norm of the amplitude.
Randomly select a configuration from the global state, set its amplitude to 1 and remove all other configurations. The random selection is made with a density probability computed with the amplitudes of the configurations.
A set of rule for the universe, see Operator matrix.
A 16*16 unitary matrix used to compute the steps of the universe.
An instant of the universe.
When several configurations have exactly the same alive cells, they interfere and merge into one configuration with their amplitudes added.
It contains all cells that are alive in at least one configuration of the global state, each cell associated with a probability that is equal to the sum of the configuration probabilitiy of all the configurations in which the cell is alive.