Simulate and create beautiful plots of quantum cellular automata, inspired by classical elementary cellular automata. Given some rule from the Wolfram Code, the translation into a quantum framework follows the method presented in [1].
Before running the code for the first time, install all dependencies by running the instantiation script from the project directory
$ cd QuantumGameOfLife.jl/
$ julia instantiate.jlThe instantiation script is also called from the cli script to make sure everything is set up correctly every time.
List all available parameters with
$ julia cli.jl --helpCreate and show a plot
$ julia cli.jl --showUse different initial state vectors
$ julia cli.jl --show --initial-state blinker triple_blinkerUse a superposition of initial state vectors
$ julia cli.jl --show --initial-state blinker triple_blinker --superpositionPlot additional measurement information
$ julia cli.jl --show --plot expect sse rounded cbe autocorrelationWrite to different file formats
$ julia cli.jl --show --file-formats svg png pdfTry the TDVP algorithm (This command was used to create the plot at the top)
$ julia cli.jl --show --initial-state single --algorithm tdvp1 --num-cells 33 --max-bond-dim 5 --num-steps 350 --sweeps-per-time-step 10 --plot classical expect sse rounded autocorrelation cbe --step-size 0.4 --file-formats svgPlots are saved in the plots directory by default, which can be changed with the --plotting-file-path argument. (Make sure to create the specified directory first if it does not already exist.)
$ julia cli.jl --show --plotting-file-path plots2Provide a Wolfram code via the rule parameter to create quantum analogues to classical elementary cellular automata and compare the results to the classical case. Use a distance of 1 to get equivalents to elementary cellular automata where the rule labels the corresponding Wolfram code.
$ julia cli.jl --show --plot classical expect --distance 1 --rule 108
$ julia cli.jl --show --plot classical expect --distance 1 --rule 30
$ julia cli.jl --show --plot classical expect --distance 1 --rule 150Use higher distances and extend the Wolfram code to larger numbers
$ julia cli.jl --show --plot classical expect --distance 2 --rule 2266898040Use periodic boundary conditions
$ julia cli.jl --show --periodic-boundariesJulia uses a just-in-time compiler which takes extra time when code is executed the first time to compile functions before executing them. Subsequent executions will reuse the compiled functions and run a lot faster, even with different input parameters. However, when using the CLI script, the compiled functions are lost between executions and have to be recompiled every time.
To prevent that, you might want to work from inside the julia REPL, especially if you plan to run many quick simulations.
To do so, make sure that your working directory is the project root directory and open the julia REPL
$ cd QuantumGameOfLife.jl/
$ juliathen, include the instantiation file and use the project.
julia> include("instantiate.jl")
julia> using QuantumGameOfLifeAfterwards, you can use the same command line options as with the CLI by passing them to the start function. To see the effect, compare the runtimes of two consecutive executions of the same function.
julia> @time QuantumGameOfLife.start()
julia> @time QuantumGameOfLife.start()
julia> @time QuantumGameOfLife.start("--show --plot classical expect --distance 1 --rule 150")[1] Benjamin Decker. “Creating a Quantum Analogue to an Arbitrary Classical Elementary Cellular Automaton”. en. MA thesis. Technical University of Munich, 2024-10. URL: https://mediatum.ub.tum.de/1756463