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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file qiskit_qrack_provider-0.11.1.tar.gz
.
File metadata
- Download URL: qiskit_qrack_provider-0.11.1.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62ed3424302aac186db28fa09e3e416d4f8ee062ee9a2c490ab8653b3542e8ab |
|
MD5 | fc71b8f96c2755e3cc735cc36f85d7a1 |
|
BLAKE2b-256 | 9517cafee81b336674dfdae7829253a14797886d12e1a3ba01557a5596ed99fa |
File details
Details for the file qiskit_qrack_provider-0.11.1-py3-none-any.whl
.
File metadata
- Download URL: qiskit_qrack_provider-0.11.1-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8eae2d0687ccd39575216cf4616e76da2e11bad46e6eb6809e529f924bb8296 |
|
MD5 | 829eb6b2792b0207af09b1713847d9e3 |
|
BLAKE2b-256 | 38180edbbdc93195a8e9728cab25b05d8120b67c32bcf511ebe573178a62b5e6 |