Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
*.egg-info

# Binary files
main
build/
build/*
main
*.mojopkg

debug.mojo
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Makefile that forward every target to `pixi run`
.PHONY: %
%:
@pixi run $@ $(ARGS)
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ This project reimplements and extends the ideas from the following tutorial pape
> *Michael J. McGuffin, Jean-Marc Robert, and Kazuki Ikeda*
> Published: 2025-06-09 on [arXiv:2506.08142v1](https://arxiv.org/abs/2506.08142v1) (last accessed: 2025-06-12)

---

## 🎯 Project Objectives

* **Mojo Implementation:** Re-implement the approach from the paper in Mojo for more Pythonic readability and maintainability.
* **Mojo Implementation:** Re-implement the approach from the paper in Mojo for more Pythonic synthax and better readability.
* **Learning by Doing:** Gain hands-on experience with quantum circuit simulation to better understand the capabilities and limitations of classical simulation.
* **Performance & Safety:** Leverage Mojo's strong static typing and compilation for blazing-fast and safe operations.
* **Hardware Acceleration:** Utilize Mojo’s universal GPU programming support to accelerate simulations.

---

## ⚙️ Environment Setup

Expand All @@ -34,7 +32,16 @@ pixi install
pixi run mojo build src/main.mojo && ./main
```

---

## 🔥 Current Implementation(s)

The current implemtnation uses State Vector which is an efficient method for simulating
with high precision smaller scale qubits system of 20-30 qubits. It also allow for
easily accessible gradient computations.

Another possible implemenation would be using Tensor Network, this method is effective
for large circuits, however with less precision in the calculations and with more
expensive gradients computations.

## 📄 License

Expand Down
26 changes: 26 additions & 0 deletions TODOs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# TODOs

A pure state is represented by a ket vector, e.g., $ |\psi\rangle = \alpha|0\rangle + \beta|1\rangle $, where $ \alpha $ and $ \beta $ are complex numbers satisfying the normalization condition $ |\alpha|^2 + |\beta|^2 = 1 $.

## Ordered by Priority (5 ↑) / Difficulty (5 ↓)

- 5 / 1 : density matrix calculcation from state vectors

- 5 / 5 : Extend qubitWiseMultiply() to 2 and multiple qubits gates (Test it)

- 4 / 3 : Implement measurement gates

- 4 / 5 : Implement the computation of statistics: (6.5 and 6.6)

- 3 / 2 : Use a separate list for things that are not real gate to not slow down the main run logic

- 3 / 3 : Implement naive implementation of the functions
- matrix multiplication (but starting from right or smart)
- partial trace

- 3 / 4 : Compile time circuit creation?

- 3 / 2 : Reproduce table from page 10

- 2 / 4 : qubitWiseMultiply() but for multiple qubits gates applied to non-adjacent qubits

Loading