← Back to Projects

Quantum Circuit Simulators

Quantum Computing • In Progress (Started Fall 2022) • Research Project

Quantum Python Qiskit Algorithms 🔧 Active Dev

Project Overview

I'm building a Python-based quantum circuit simulator from scratch — implementing fundamental quantum gates, state vector manipulation, and visualization tools. The goal is to support well-known quantum algorithms like Grover's search and Shor's factorization, making it useful both as a learning tool and as a testbed for quantum algorithm development. It's still a work in progress, but the core architecture is taking shape.

Why I'm Building This

Understanding quantum computing really requires hands-on experience with circuits, but access to real quantum hardware is limited and expensive. Most existing simulators abstract away the implementation details I actually want to dig into. I wanted to build something that lets me explore quantum mechanics at the gate level. Specifically, I need it to:

  • Accurately represent quantum state evolution through unitary transformations
  • Handle multi-qubit entanglement and measurement operations
  • Provide clear visualization of quantum states and circuit operations
  • Scale efficiently for circuits with up to 15 qubits (still working on this)

Technical Approach

Quantum State Representation

The simulator represents quantum states as complex-valued vectors in the computational basis. For an n-qubit system, the state vector holds 2^n complex amplitudes, stored as NumPy arrays for efficient linear algebra operations. This part is working well.

Gate Implementation

I'm implementing fundamental quantum gates as unitary matrices. Here's where things stand:

  • Single-qubit gates: Pauli X/Y/Z, Hadamard, Phase (S, T), Rotation gates (Rx, Ry, Rz) — mostly done
  • Two-qubit gates: CNOT, SWAP, Controlled-Z, Controlled-Phase — in progress
  • Multi-qubit gates: Toffoli (CCX), Controlled-SWAP (Fredkin) — partially implemented
  • Custom gates: Support for arbitrary unitary matrices — planned

Quantum Algorithms

Grover's Algorithm: Currently implementing the quantum search algorithm with Oracle construction for arbitrary search problems. I'm verifying the quadratic speedup against classical search, targeting databases up to 2^10 elements.

Shor's Algorithm: Working on the modular exponentiation circuits and Quantum Fourier Transform needed for integer factorization. This is the most complex piece — targeting factorization of small integers as a proof of concept first.

Also on the roadmap:

  • Deutsch-Jozsa algorithm for function property testing
  • Quantum teleportation protocol with Bell state preparation
  • Bernstein-Vazirani algorithm for hidden string finding
  • Quantum Phase Estimation (QPE) for eigenvalue computation

Current Architecture

Module Structure (WIP)

I'm organizing the simulator into modular components. The structure is still evolving but currently looks like:

  • QuantumRegister: Manages qubit initialization and state vector — stable
  • QuantumCircuit: Builds and executes quantum circuits — active development
  • GateLibrary: Collection of quantum gates and operations — growing
  • Measurement: Quantum measurement in the computational basis — basic version working
  • Visualization: Renders circuits and probability distributions — early stage

Optimization — What I'm Exploring

  • Lazy evaluation of gate sequences to reduce intermediate computations
  • Sparse matrix representations for larger quantum states (needed as qubit count grows)
  • Parallel processing for independent qubit operations — haven't tackled this yet
  • Memoization of frequently used gate matrices

Visualization (Early Stage)

  • Basic circuit diagrams with Matplotlib — working but rough
  • Bloch sphere visualization for single-qubit states — in progress
  • Probability distribution histograms — next up
  • State vector amplitude and phase representation — planned
  • Animation of quantum state evolution — stretch goal

Current Progress

~10 Qubits

Stable so far (targeting 15)

15+

Gates Implemented

2 of 5

Algorithms Underway

Ongoing

Validation vs Qiskit

I'm actively cross-checking results against IBM Qiskit as I go, which has been a great sanity check — and a source of some humbling bugs. The core simulation engine is holding up well, but the algorithm layer still needs a lot of work before I'd call it reliable.

Technologies & Tools

Language

Python 3.10+

Computation

NumPy, SciPy

Visualization

Matplotlib, Seaborn

Validation

Qiskit, Cirq

Testing

Pytest, unittest

Documentation

Sphinx, Jupyter

What I'm Learning Along the Way

  • How surprisingly tricky it is to maintain numerical precision in quantum simulations — floating point errors compound fast
  • Tensor product operations and Kronecker products for multi-qubit systems are elegant but expensive at scale
  • How quantum algorithm complexity differs fundamentally from classical thinking — it keeps requiring me to unlearn intuitions
  • The exponential resource cost of classically simulating quantum systems makes it very clear why real hardware matters
  • Practical limitations of NISQ devices — good motivation for building error models later

What's Next

  • Finish Shor's algorithm implementation and validate against known results
  • Build out noise models to simulate realistic quantum hardware behavior
  • Explore tensor network methods for efficient large-scale simulation
  • Add support for parameterized quantum circuits (PQC) for variational algorithms
  • Sketch out a web-based interface for interactive circuit design
  • Possibly connect to real quantum hardware backends (IBM Quantum, AWS Braket) down the line
  • Look into quantum error correction code implementations