/qgate

Qgate, Quntum circuit simulator

Primary LanguagePythonApache License 2.0Apache-2.0

Qgate

Announcement

Qgate has moved to NVIDIA AI Technology Center (NVAITC) in 11/2019.

Develpoment is still ongoing as an NVAITC activity.

Development for version 0.3 has been already closed. Please refer to the slides, QGATE 0.3: QUANTUM CIRCUIT SIMULATOR. The source code is planned to be open sourced from NVAITC repository.

Develpment of version 0.4 is in progress with enhanced optimizations and advanced multi GPU supports.

If you are intersted in Qgate, please contact smorino(at)nvidia.com". I can send packages for your evaluation.

This repository is kept for 0.2 release, but no further updates will be made.

Qgate 0.2

Quantum circuit simulator

Version 0.2.2 has been released on 1/26/2020.

Qgate 0.2.2 is a bug-fix release. Please see the version history in the bottom of this page.

Please visit Qgate documentation (Quick start guide) for usages.

Prerequisite

  • Qgate depends on numpy(>=1.14) and PLY(>=3.10). Please install them in advance.

# install numpy
$ pip install numpy
# install PLY
$ pip install ply

or

# move to qgate directory
cd qgate
# install by using requirements.txt
pip install -r requirements.txt

Build / Install

  • To build, CUDA toolkit is required. Please install CUDA 9 or later.
  • setup.py assumes CUDA toolkit is under /usr/local/cuda
  • Please checkout the 0.2 branch which includes tha latest fixes for 0.2.x.
# checkout the 0.2 branch
git checkout 0.2
# move to your source directory
cd qgate
# build
python setup.py bdist_wheel --plat-name manylinux1_x86_64
# install
pip install dist/qgate-*-*-manylinux1_x86_64.whl

Wheels for Python 2.7, 3.5, 3.6, 3.7 and 3.8 are available from links below. These packages have been built with CUDA 10 on Ubuntu 16.04 (2.7, 3.5) and on Ubuntu 18.04 (3.6, 3.7, 3.8), and are expected to work on other linux distros.

NVIDIA driver requirement

NVIDIA Driver 410.48 or later is required to use prebuilt wheels,

If CUDA 9 (R384) driver is installed and you want to stay at R384, please visit 4. CUDA Compatilbility platform. Drivers of 384.111 or later are able to run CUDA 10 applications.

Run

Please go to the example directory, and run scripts.

# move to examples
cd examples
# run example scripts
python gate_tests.py

Version history

0.2.2(1/26/2020)

  • Fixes for memory allocation issues with multiple GPUs

  • Fix for wrong Rz gate definition in native runtimes.

0.2.1(10/17/2019)

  • Fixes for Expi(theta)(paulis), measure(ref, paulis), prob(ref, paulis) operators.

  • Fixes for sampling pool on CUDA.

  • New script interface from 0.3 is added in qgate.script.script2.

    Script updating tool is also added in qgate.tools.update_script.

0.2

New

  • Dynamic Qubit Grouping

    dynamically adding/removing qubits to/from state vectors

  • Multi-GPU

    Using device memories in multiple GPUs to run bigger circuits.

    Prerquisite is GPUDirectP2P. To get performance, NVLink is required.

  • SamplingPool

    Efficent and fast sampling by using pre-calculated probability vector.

  • Blueqat plugin (preliminary)

  • OpenQASM parser (preliminary)

    Parsing OpenQASM to dynamically create circuits or generate python source code to define circuits.

    (Currently macro and opaque are not implemented.)

Fixes/Changes

  • Global phases of U3 and U2 gates are adjusted for consistency with Qgate gate set.

  • The name of global phase gate is changed from Expia to Expii.

  • The matrix for U2 gate was numerically incrrect. It was fixed and tested.

0.1

  • The first release.