Skip to content

gabchx/quantum-emulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quantum-emulator

Homemade quantum emulator, made with Rust & Python for resources benchmark.

Usage

Go to qe.gab.cx

qe

• Drag and drop gates from the toolbox.
• Add qubits on Qubit +.
• Load exemple algorithme on Examples ::.
• Export to code on Code <>.
• Remove qubits or gates by double clicking.

Tip

On rendering bugs : Unzoom + ctrl-R

Exemple using Deutsch-Jozsa Algorithm

Given an n-bit Oracle (“black box”) function, we don’t know exactly what is inside but we know it is either constant (i.e., always return 0 or 1 whenever it’s queried) or balanced (i.e., 50% return 0 and 50% return 1).
The objective is to determine whether that oracle is constant or balanced with minimum queries.
We need to query at least twice to solve this problem with a classical solution. If we get the same output twice, we can’t conclude and need to ask again, up to N/2 + 1 queries, where N = 2^n is the number of all realizable bit strings from n bits input of the Oracle.
However, this problem becomes trivial to solve with a quantum solution. For this, we use Deutsch-Jozsa Algorithm

Capture d’écran 2024-10-14 à 18 56 19

As the result is 1111 (with 0% of measuring 0000), we can conclude that the given oracle is balanced as expected. If the result is 0000 (with 100% of measuring 0000), that function will be constant.

About Bloch sphere visualisation

When qubits are entangled, their states are interconnected, so you can't represent them individually on Bloch spheres—doing so doesn't capture the whole picture. However, visualizing each qubit on a Bloch sphere can still be helpful when qubits aren't entangled, or for understanding certain parts of the system. This kind of visualization shows each qubit's state and phase, giving insights into how they're behaving, but it won’t fully represent the complex relationships between qubits in the hole entangled system.

image

Developpment

Backend Python

Features to do

• Implement measurement gate.
• Add the possibility to add a custom gate.
• Add control over other gate.
• Optimize Rust variable size.
• Fixe few front bugs.

Quickstart

Using docker (recommended)

 docker-compose up --build

http://127.0.0.1:8000/home

Using rust and python separatly on your machine (for developpment)

# Rust backend + expose frontend
cd quantum_emulator
cargo install --path .
cargo run
# Python backend
cd quantum_emulator
poetry install
poetry run app

To install docker compose

https://docs.docker.com/compose/install/ tips: use Docker Desktop for Windows and Mac

To install rust

prefer install rust-up
linux/mac : curl -sSl '=https' https://sh.rustup.rs | sh
tips: make sure to add the rust-analyzer extension to your VSCode

To install poetry

https://python-poetry.org/docs/#installing-with-the-official-installer

About

Homemade quantum emulator, made with Rust.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors