Giter Club home page Giter Club logo

dquantumsim's Introduction

Build with Make Testing

dQuantumSim - Distributed Quantum Simulator

This project implements a parallel and scalable quantum simulator based on the state vector approach. We extend the capabilities of quantum simulation by distributing the workload amongst various computer nodes and take advantage of combined shared memory.

This project is implemented in C++17. MPI is used for inter-process communication amongst computer nodes.

Features

This simulator supports a subset of the OpenQASM 2.0 quantum assembly specification.
The following gate operations are implemented:

  • Pauli X gate
  • Pauli Y gate
  • Pauli Z gate
  • Hadamard gate
  • Principle Square Root of X gate
  • Principle Square Root of Y gate
  • Principle Square Root of Z gate (S gate)
  • T gate
  • Controlled X gate
  • Controlled Z gate
  • Toffoli gate

How to Run

Git, gcc, make and openmpi are required

# Clone this repository
$ git clone [email protected]:luisrmendes/dQuantumSim.git

# Go into the repository
$ cd dQuantumSim

# Compile
$ make -j5

# Run
$ mpirun --mca opal_warn_on_missing_libcuda 0 -np <number_of_processes> ./dqsim <openqasm_file>

Example with Grover's Algorithm

mpirun --mca opal_warn_on_missing_libcuda 0 -np 2 ./dqsim openqasmTests/q3_grovers.openqasm

We provide an example of an implementation of Grover's algorithm using three qubits in the "openqasmTests" folder (q3_grovers.openqasm), alongside many other test examples.

# ---------- Grover's Algorithm in 3 qubits ----------

# Initialize 3 qubit circuit
qreg q[3];

h q[0];
h q[1];
h q[1];
cx q[0],q[1];
h q[1];
h q[0];
x q[0];
h q[1];
x q[1];
h q[1];
cx q[0],q[1];
h q[1];
x q[0];
h q[0];
x q[1];
h q[1];

dquantumsim's People

Contributors

luisrmendes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.