Skip to content

General-purpose SDKs

qcgpu-rust

Maintained by QCGPU

High Performance Tools for Quantum Computing

PythonMIT
qcgpu-rust illustration

Resource snapshot

Category

General-purpose SDKs

Stars

449

Last pushed

Jul 6, 2023Updated 3y ago

Open issues

5

What it is

qcgpu-rust is maintained by QCGPU and sits in the General-purpose SDKs lane of the open-source quantum map.

High Performance Tools for Quantum Computing It commonly appears alongside qiskit-qiskit, projectq-framework-projectq in example workflows.

Last verified by Qtangl generator on May 27, 2026

Who it's for

Developers who want a broad entry point for building circuits, experimenting with algorithms, and integrating quantum workflows into larger applications.

What you can build or learn

  • Prototype end-to-end circuit workflows without committing to a niche backend too early.
  • Learn how the project represents circuits, gates, jobs, and results.
  • Compare how a major ecosystem frames practical quantum development.

Code samples

Examples from the repository.

Bell State (examples/bell_state.py)
# -*- coding: utf-8 -*-
"""
Bell State / EPR Pair
=====================
The Bell State, also known as the EPR pair (after Einstein, Podosky and Rosen)
is the simplest example of entanglement.
The Bell State is defined as the maximally entangled quantum state of two qubits.
"""
def bell_state():
    import qcgpu
    print("Creating Bell State")
    state = qcgpu.State(2)
    state.h(0)
    state.cx(0, 1)
    print("Measurement Results:")
    print(state.measure(samples = 1000))
if __name__== "__main__":
  bell_state()
Bernstein Vazirani (examples/bernstein_vazirani.py)
# -*- coding: utf-8 -*-
"""
Bernstein-Vazirani Algorithm
============================
This algorithm finds a hidden integer :math:`a \in \{ 0, 1\}^n` from
an oracle :math:`f_a` which returns a bit :math:`a \cdot x \equiv \sum_i a_i x_i \mod 2`
for an input :math:`x \in \{0,1\}^n`.
A classical oracle returns :math:`f_a(x) = a \dot x \mod 2`, while the quantum oracle
must be queried with superpositions of input :math:`x`'s.
To solve this problem classically, the hidden integer can be found by checking the
oracle with the inputs :math:`x = 1,2,\dots,2^i,2^{n-1}`, where each
query reveals the :math:`i`th bit of :math:`a` (:math:`a_i`).
This is the optimal classical solution, and is :math:`O(n)`. Using a quantum oracle and the
Bernstein-Vazirani algorithm, :math:`a` can be found with just one query to the oracle.
The Algorithm
-------------
1. Initialize :math:`n` qubits in the state :math:`\lvert 0, \dots, 0\rangle`.
2. Apply the Hadamard gate :math:`H` to each qubit.
3. Apply the inner product oracle.
4. Apply the Hadamard gate :math:`H` to each qubit.
5. Measure the register
From this procedure, we find that the registers measured value is equal to that of
the original hidden integer.
"""
def bernstein_vazirani():
    import qcgpu
    num_qubits = 7 # The number of qubits to use
    a = 101 # The hidden integer, bitstring is 1100101
    register = qcgpu.State(num_qubits) # Create a new quantum register
    register.apply_all(qcgpu.gate.h()) # Apply a hadamard gate to each qubit
    # Apply the inner products oracle
    for i in range(num_qubits):
        if a & (1 << i) != 0:
            register.z(i)
    register.apply_all(qcgpu.gate.h()) # Apply a hadamard gate to each qubit
    results = register.measure(samples=1000) # Measure the register (sample 1000 times)
    print(results)
if __name__== "__main__":
  bernstein_vazirani()
Deutsch-Jozsa (examples/deutsch-jozsa.py)
import qcgpu
# 3 qubits, f(x) = x_0 NOT x_1 x_2
# Balanced
balanced_state = qcgpu.State(3)
balanced_state.apply_all(qcgpu.gate.h())
# Oracle U_f
balanced_state.h(2)
balanced_state.z(0)
balanced_state.cx(1, 2)
balanced_state.h(2)
balanced_state.apply_all(qcgpu.gate.h())
outcomes = balanced_state.measure(samples = 1000)
if int(max(outcomes, key=outcomes.get)) == 0:
    print('constant')
else:
    print('balanced')
# 3 qubits, f(x) = 0
# Constant
constant_state = qcgpu.State(3)
constant_state.apply_all(qcgpu.gate.h())
# Oracle is equivalent to the identity gate, 
# thus has no effect on the state
constant_state.apply_all(qcgpu.gate.h())
outcomes = constant_state.measure(samples = 1000)
if int(max(outcomes, key=outcomes.get)) == 0:
    print('constant')
else:
    print('balanced')

Plays well with

License

MIT

SPDX identifier detected from the repository metadata or license files.

Repository README

Preview from the project README.

Rendered as Markdown inside a scrollable preview. Long READMEs stay contained; expand or open on GitHub for the full document.

~86 words · about 1 min readOpen on GitHub

QCGPU

Open Source, High Performance & Hardware Accelerated, Quantum Computer Simulator. Read the research paper.

Features:

  • Written with OpenCL. Accelerated your simulations with GPUs and other accelerators, while still running cross device and cross platform.
  • Simulation of arbitrary quantum circuits
  • Includes example algorithm implementations
  • Support for arbitrary gate creation/application, with many built in.

Installing

This library is distributed on PyPI and can be installed using pip:

$ pip install qcgpu

For more information read the full installing docs.

Activity

Latest release

—

Watchers

18

Python support

—

Learn digest

Get monthly updates when library entries change.

Monthly digest: new library entries, updated flagships, and one editorial pick.

Related resources

Keep exploring nearby tools.

quantumlib

Cirq

Python framework for creating, editing, and running Noisy Intermediate-Scale Quantum (NISQ) circuits.

PythonApache-2.0Flagship

4,971 stars · Updated 3mo ago

XanaduAI

pennylane

PennyLane is an open-source quantum software platform for quantum computing, quantum machine learning, and quantum chemistry.

PythonApache-2.0FlagshipQtangl relevant

3,229 stars · Updated 3mo ago

QISKit

qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.

PythonApache-2.0FlagshipQtangl relevant

7,412 stars · Updated 3mo ago

Qiskit

qiskit-terra

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.

PythonApache-2.0

7,412 stars · Updated 3mo ago

Microsoft

QuantumKatas

Tutorials and programming exercises for learning Q# and quantum computing

Jupyter NotebookMITFlagshipArchive

4,862 stars · Updated 2y ago

QuantumBFS

Yao.jl

Extensible, Efficient Quantum Algorithm Design for Humans.

JuliaApache-2.0Flagship

1,032 stars · Updated 3mo ago