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.12.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

qiskit_qrack_provider-0.12.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for qiskit_qrack_provider-0.12.0.tar.gz
Algorithm Hash digest
SHA256 26bd3f7857a8c3f65022ef07354c4662875f4da065b61f2635ede4ff34ce2237
MD5 f6aa8be3578ecf8a505e65d997a1db53
BLAKE2b-256 de72d139e7ef88335f7db3009c8a2a9f05d88b8816a482dafb852170d91c2936

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qiskit_qrack_provider-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73084d202dc747969df20071c19381be2a3b0cf33924ebc7641501b1da6b1e48
MD5 5379e10dae6adee28fb3b22cff265dbc
BLAKE2b-256 a30367e772d5d9425958b9ab52fea41f198a8395f7c7b86994cde4c3f9bff94d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page