Damavand is a quantum circuit simulator. It can run on laptops or High Performance Computing architectures, such CPU distributed architectures or multi GPU distributed architectures.

Overview

damavand-main

Damavand is a code that simulates quantum circuits. In order to learn more about damavand, refer to the documentation.

Development status

  1. Core features:
  • single node CPU multithreading ✔️
  • single node GPU ✔️
  • multiple nodes CPU multithreading ✔️
  • single node multiple GPUs ✔️
  • multiple nodes multiple GPUs ✔️
  1. pypi ✔️
  2. README.md ✔️
  3. Documentation 🛠️ (under construction)

Installation

From pypi

pip3 install damavand

From sources

git clone https://github.com/previsionio/damavand.git
cd damavand/
python3 setup.py install

Example

Damavand can be executed with different "apply methods". These refer to the algorithms used to update a quantum state by applying a given quantum gate. The different apply methods are:

  1. brute_force brute matrix vector multiplication (requires a lot of memory).
  2. shuffle smart implementation of matrix vector multiplication where the matrix is the result of a series of kronecker products (requires less memory but is still a bit slow).
  3. multithreading runs on a single node multi CPUs.
  4. gpu runs on a single node single GPU.
  5. distributed_cpu runs on a multiple nodes multiple CPUs.
  6. distributed_gpu runs on a single node multiple GPUs or on multiple nodes multiple GPUs.

The default apply_method is multithreading. this can be changes by providing it as an option to the Circuit builder, as shown in the following example:

from damavand import Circuit

# initialize MPI
from mpi4py import MPI

num_qubits = 1
circuit = Circuit(num_qubits, apply_method="distributed_gpu")

circuit.add_hadamard_gate(0)

circuit.forward()
circuit.measure()

num_samples=10
samples = circuit.sample(num_samples)

observables = circuit.extract_expectation_values(samples)

Slurm workload run:

Here is a simple slurm example that shows how to run a simulation on 2 nodes, with multithreading.

#!/bin/bash

#SBATCH --job-name=two_nodes
#SBATCH --qos=qos_cpu-dev
#SBATCH --ntasks=2
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=40
#SBATCH --output=two_nodes.listing
#SBATCH --time=5:00

module purge

module load openmpi/3.1.4
module load cuda/10.2

srun python3 two_nodes.py

Run sbatch run.sh to lounch the script

Pennylane Integration

Damavand is linked to pennylane PennyLane, a library with many tools to approach qubit based and continuous-variable based quantum architectures.

The plugin that allows this can be found here.

With this plugin, one can use pennylane with the damavand.qubit backend.

dev = qml.device("damavand.qubit", wires=10, apply_method="gpu")

Sun rising on mount damavand

damavand-sunrise

You might also like...
High-performance automatic differentiation of LLVM.
High-performance automatic differentiation of LLVM.

The Enzyme High-Performance Automatic Differentiator of LLVM Enzyme is a plugin that performs automatic differentiation (AD) of statically analyzable

RustFFT is a high-performance FFT library written in pure Rust.

RustFFT is a high-performance FFT library written in pure Rust. It can compute FFTs of any size, including prime-number sizes, in O(nlogn) time.

A Machine Learning Framework for High Performance written in Rust
A Machine Learning Framework for High Performance written in Rust

polarlight polarlight is a machine learning framework for high performance written in Rust. Key Features TBA Quick Start TBA How To Contribute Contrib

A high performance python technical analysis library written in Rust and the Numpy C API.

Panther A efficient, high-performance python technical analysis library written in Rust using PyO3 and rust-numpy. Indicators ATR CMF SMA EMA RSI MACD

A proof-of-concept for building Orbiter spaceflight simulator addons in Rust

Orbiter spacecraft addon development in Rust This project is a proof of concept for creating a spacecraft addon for the Orbiter spaceflight simulator

Rust based Cross-GPU Machine Learning

HAL : Hyper Adaptive Learning Rust based Cross-GPU Machine Learning. Why Rust? This project is for those that miss strongly typed compiled languages.

A real-time implementation of
A real-time implementation of "Ray Tracing in One Weekend" using nannou and rust-gpu.

Real-time Ray Tracing with nannou & rust-gpu An attempt at a real-time implementation of "Ray Tracing in One Weekend" by Peter Shirley. This was a per

Ecosystem of libraries and tools for writing and executing extremely fast GPU code fully in Rust.

Ecosystem of libraries and tools for writing and executing extremely fast GPU code fully in Rust.

Ecosystem of libraries and tools for writing and executing fast GPU code fully in Rust.

The Rust CUDA Project An ecosystem of libraries and tools for writing and executing extremely fast GPU code fully in Rust Guide | Getting Started | Fe

Releases(v0.2.0)
Owner
prevision.io
prevision.io
Open deep learning compiler stack for cpu, gpu and specialized accelerators

Open Deep Learning Compiler Stack Documentation | Contributors | Community | Release Notes Apache TVM is a compiler stack for deep learning systems. I

The Apache Software Foundation 8.9k Jan 4, 2023
Signed distance functions + Rust (CPU & GPU) = ❤️❤️

sdf-playground Signed distance functions + Rust (CPU & GPU) = ❤️❤️ Platforms: Windows, Mac & Linux. About sdf-playground is a demo showcasing how you

Patryk Wychowaniec 5 Nov 16, 2023
High performance distributed framework for training deep learning recommendation models based on PyTorch.

PERSIA (Parallel rEcommendation tRaining System with hybrId Acceleration) is developed by AI platform@Kuaishou Technology, collaborating with ETH. It

null 340 Dec 30, 2022
How to: Run Rust code on your NVIDIA GPU

Status This documentation about an unstable feature is UNMAINTAINED and was written over a year ago. Things may have drastically changed since then; r

null 343 Dec 22, 2022
Wonnx - a GPU-accelerated ONNX inference run-time written 100% in Rust, ready for the web

Wonnx is a GPU-accelerated ONNX inference run-time written 100% in Rust, ready for the web. Supported Platforms (enabled by wgpu) API Windows Linux &

WebONNX 354 Jan 6, 2023
PyQIR is a set of APIs for generating, parsing, and evaluating Quantum Intermediate Representation (QIR).

PyQIR PyQIR is a set of APIs for generating, parsing, and evaluating Quantum Intermediate Representation (QIR). It consists of the following component

QIR Alliance 37 Dec 31, 2022
ThRust is a software framework for thermodynamic and probabilistic computing.

ThRust ThRust is a Rust crate that provides a framework for thermodynamic and probabilistic computing. This package currently supports the following f

Chase Zimmerman 6 Apr 26, 2023
Kuintessence - Open Source HPC Computing Orchestration System

Kuintessence is an advanced computing orchestration system designed to revolutionize HPC workload and cluster management, to empower HPC users by allowing them to concentrate on their scientific ideas rather than getting bogged down by HPC environment complications, and enhance research productivity to its fullest potential.

National Supercomputing Center in Jinan 4 Aug 31, 2023
MesaTEE GBDT-RS : a fast and secure GBDT library, supporting TEEs such as Intel SGX and ARM TrustZone

MesaTEE GBDT-RS : a fast and secure GBDT library, supporting TEEs such as Intel SGX and ARM TrustZone MesaTEE GBDT-RS is a gradient boost decision tre

MesaLock Linux 179 Nov 18, 2022
High-performance runtime for data analytics applications

Weld Documentation Weld is a language and runtime for improving the performance of data-intensive applications. It optimizes across libraries and func

Weld 2.9k Jan 7, 2023