Skip to main content

Qiskit Qrack Provider - Qrack High-Performance GPU simulation for Qiskit

Project description

qiskit-qrack-provider

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

The underlying Qrack simulator is a high-performance, GPU-accelarated, noiseless simulator, by design. 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!)

Project details


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-0.4.10.tar.gz (23.6 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-0.4.10-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file qiskit-qrack-provider-0.4.10.tar.gz.

File metadata

  • Download URL: qiskit-qrack-provider-0.4.10.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for qiskit-qrack-provider-0.4.10.tar.gz
Algorithm Hash digest
SHA256 c310e00070363f9c0bfce0f38767c8bb80f715b32aaa584218132ab167d66845
MD5 c836e7909c931df8e9a503226aba20a6
BLAKE2b-256 88772060c3a0f06b676c853222508ffaaf4a3d9fffe30bf25bec135147b7087e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qiskit_qrack_provider-0.4.10-py3-none-any.whl
Algorithm Hash digest
SHA256 45c7a3a85b50f1532f26975f2f3ebd0fdff12ce49e5b3bd20e36b7f6dbc751cc
MD5 81ad5d0698a9da268f407c344aca6517
BLAKE2b-256 42748b3e20fc56c0a522fe0351d0689e76a513df5efab7e1fbdd281297834d1f

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 Pingdom Monitoring Sentry Error logging StatusPage Status page