QCGPU is a high performance, hardware accelerated quantum computer simulator written with Rust and OpenCL.

  • Simulation of arbitrary quantum algorithms
  • Optional simulation of decoherence
  • Optimized for maximally entangled states
  • Accelerated with GPUs, FPGAs and other OpenCL devices
  • Example implementations of Grover, Deutsch-Jozsa, Bernstein-Vazirani and Shors algorithm
  • Implements Hadamard, Pauli and phase gates, with support for arbitrary gates
  • Support for arbitrary controlled gates
extern crate qcgpu;

use qcgpu::State;

fn main() {
    // Create a 2 qubit register on the OpenCL Device #1
    let mut state = State::new(2, 1);

    // Apply a  Hadamard Gate to the 1st qubit
    state.h(0); // Zero Indexed

    // Apply a CNOT gate, with the control as the 1st qubit, and target as the 2nd
    state.cx(0, 1);

    // Measure 1000 times and print the results
    println!("Measured: {:?}", state.measure_many(1000));
}