Skip to main content

qiskit-qrack-provider

This repository contains a Qrack provider for Qiskit. You must install PyQrack to use it.

Performance can benefit greatly from following the Qrack repository "Quick Start" and "Power user considerations."

Qrack is a GPU-accelerated simulator with optional pure-CPU and CPU/GPU-hybrid simulation, scaling from minimalist systems to multiple GPUs for high performance, with novel near-Clifford, Schmidt-decomposition, quantum binary decision diagram (QBDD), light-cone optimization, state vector, and other simulation techniques. This repository provides the Qrack QasmSimulator.

This provider is based on and adapted from work by the IBM Qiskit Team and QCGPU's creator, Adam Kelly. Attribution is noted in content files, where appropriate. Original contributions and adaptations were made by Daniel Strano of the VM6502Q/Qrack Team.

To use, in Qiskit:

from qiskit.providers.qrack import Qrack

backend = Qrack.get_backend('qasm_simulator')

For example, for use with unitaryfund/mitiq, creating a (noiseless) executor can be as simple as follows:

from qiskit.providers.qrack import Qrack

def executor(circuit, shots=1000):
    """Executes the input circuit and returns the noisy expectation value <A>, where A=|0><0|.
    """
    # Use the Qrack QasmSimulator backend, (but it's specifically noiseless)
    ideal_backend = Qrack.get_backend('qasm_simulator')

    # Append measurements
    circuit_to_run = circuit.copy()
    circuit_to_run.measure_all()

    # Run and get counts
    print(f"Executing circuit with {len(circuit)} gates using {shots} shots.")
    job = ideal_backend.run(circuit_to_run, shots=shots)
    counts = job.result().get_counts()

    # Compute expectation value of the observable A=|0><0|
    return counts["0"] / shots

Generally, you will need to adapt the above executor snippet to your particular purpose.

(Happy Qracking! You rock!)


License: Apache License Version 2.0, Copyright (c) Daniel Strano and the Qrack contributors 2017-2024. All rights reserved.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qiskit_qrack_provider-1.7.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qiskit_qrack_provider-1.7.0-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file qiskit_qrack_provider-1.7.0.tar.gz.

File metadata

  • Download URL: qiskit_qrack_provider-1.7.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for qiskit_qrack_provider-1.7.0.tar.gz
Algorithm Hash digest
SHA256 56dd6d9957d45f0d0f9609980d43843e3ce688d355b45498b14e4d0cc188524d
MD5 fc14f3e0dbf0976934cd3c0d16185fcb
BLAKE2b-256 c46d77e880543bce955b413d32a4d6b6e620c9113a5e3390986b5c3e590c1334

See more details on using hashes here.

File details

Details for the file qiskit_qrack_provider-1.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for qiskit_qrack_provider-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 347176add3e23299360cfb2bd35a1dfb58ff3a012925385e0d4d3fd0b1462777
MD5 08eb6970fba024b9b8f2d7e57bf79c2e
BLAKE2b-256 6dbdd23dee50393b29835bc63c03480a44e17c907ffce3ea01ccd2a04f96bf70

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page