A simple Quantum Gate Simulator implemented in C++, paired with a Node.js-based GUI Visualizer for an interactive experience.
The simulator allows you to store and apply various quantum gates to qubit states and provides a visual interface to see the results of quantum operations in action.
This project is divided into two main parts:
- Implements basic quantum mechanics concepts such as qubit state representation and quantum gate operations.
- Provides a set of common quantum gates:
- Identity
- Pauli-X, Pauli-Y, Pauli-Z
- Hadamard
- Phase (S)
- T-Gate
- Uses manual matrix operations (without external libraries like Eigen) to evolve quantum states.
- A frontend interface that communicates with the C++ simulator.
- Allows users to drag and drop gates onto qubits, build circuits, and see the resulting state evolution.
- Visualizes quantum states using:
- Bloch spheres
- Probability histograms
- Quantum Gate Storage – Manage and apply common gates easily.
- State Evolution – Apply operations on qubits and observe transformations.
- Extensible Backend – Future support for multi-qubit systems and advanced gates (like CNOT).
- Interactive GUI – User-friendly Node.js frontend with drag-and-drop interface.
- Separation of Concerns – C++ handles computation, Node.js handles visualization.
- C++ Compiler (e.g.,
g++) - Node.js (>= 16.0.0)
- npm (comes with Node.js)
# Navigate to the backend folder
cd backend
# Compile the simulator
g++ main.cpp -o simulator
# Run the simulator
./simulator# Navigate to the frontend folder
cd frontend
# Install dependencies
npm install
# Start the GUI
npm startThe frontend will connect with the backend to visualize quantum gate operations.
- Start the C++ backend (
./simulator). - Run the Node.js GUI (
npm start). - Open the interface in your browser (default:
http://localhost:3000). - Drag and drop gates onto qubits, then visualize state changes.
Example workflow:
- Initialize a |0⟩ qubit
- Apply a Hadamard gate → get a superposition state
- Apply a Pauli-Z gate → observe phase flip on the Bloch sphere
We welcome contributions! To get started:
- Fork the repository
- Create a new branch for your feature/bugfix
- Commit your changes with clear messages
- Push your branch and submit a Pull Request (PR)
Please ensure:
- Code is well-documented
- New features include usage examples or tests
qubitverse/
│── .github/workflows/
│ └── cmake-single-platform.yml
│
│── qubitverse/
│ ├── simulator/ # C++ quantum gate simulator
│ │ ├── dep/
│ │ ├── gates/
│ │ ├── lexer/
│ │ ├── parser/
│ │ └── simulator/
│ │
│ └── visualizer/ # Node.js GUI visualizer
│ ├── public/
│ ├── src/
│ ├── eslint.config.js
│ ├── index.html
│ ├── package.json
│ └── vite.config.js
│
│── .clang-format
│── .clang-tidy
│── .clangd
│── .gitignore
│── CMakeLists.txt
│── compile.rc
│── CONTRIBUTING.md
│── LICENSE
│── README.md
- Add multi-qubit support
- Implement CNOT and controlled gates
- Improve visualization with real-time animations
- Add export/import of circuits
- Provide a hosted live demo
This project is licensed under the MIT License.
See the LICENSE file for details.
- Inspired by basic concepts of Quantum Computing.
- Educational references: Nielsen & Chuang – Quantum Computation and Quantum Information.
- Open-source tools and the developer community.