Skip to content

Git-Math/qautomata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Qautomata

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.

How does it work

Automata algorithm

Start

We start with a universe containing one configuration with some living cells and a set of rules represented by an operator matrix.

Step computation

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 even steps, the rules apply on each 2*2 square outlined in black:

6-6-square-even

  • 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):

6-6-square-odd

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.

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.

Visual example

qautomata-diagonal.mp4

UI

Draw

If no state file is provided, draw living cells by clicking on dead cells or draw dead cells by clicking on living cells.

Start button

Button that starts the qautomata, only available while drawing.

Pause button

Button that pauses the qautomata and give access to all other buttons.

Reset button

Button that resets the qautomata to the starting state file.

Run button

Button that runs the qautomata (unpausing), steps will then be computed automatically.

Step button

Button that computes the next step of the qautomata.

Measure button

Button that applies a measure to the qautomata.

Auto measure button

Button to enable/disable the automatic measure.

Max superposed configurations before measure int

Max number of superposed configurations after a step, if there is more (and auto measure is on) an automatic measure is applied.

Show rules squares

Button to enable/disable the display of the rules squares.

Show numbers button

Button to enable/disable the display of the probabilities on the combined state.

Combined state button

Button to display the combined state.

Configurations buttons

Button to display a given configuration.

Demo

qautomata-ui-demo.mp4

Developpement

Dependencies

Architecture

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)

How to run

UI

From the root of the repository run cargo run -p ui [state file]

Web

To test the web ui:

  • install npm and node > 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

Glossary

Universe

An instance of the qautomata, it contains:

Global state

A list of superposed configurations each associated with an amplitude.

Configuration

A grid of cells.

Cell

An element of the grid of the configuration that can either be dead or alive.

Amplitude

A complex number associated with a configuration, it can be used to compute the probability associated with the configuration.

Configuration probability

Probability of a configuration to be selected in case of a measure. It's the squared norm of the amplitude.

Measure

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.

Rules

A set of rule for the universe, see Operator matrix.

Operator matrix

A 16*16 unitary matrix used to compute the steps of the universe.

Step

An instant of the universe.

Interference

When several configurations have exactly the same alive cells, they interfere and merge into one configuration with their amplitudes added.

Combined state

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.

About

Quantum cellular automata

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published