# qiskit-qrack-provider
This repository contains a Qrack provider for Qiskit. You must [install PyQrack](https://pypi.org/project/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:
```python
from qiskit.providers.qrack import Qrack
backend = Qrack.get_backend('qasm_simulator')
```
For example, for use with [unitaryfund/mitiq](https://github.com/unitaryfund/mitiq), creating a (noiseless) `executor` can be as simple as follows:
```python
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!)
Raw data
{
"_id": null,
"home_page": "https://github.com/vm6502q/qiskit-qrack-provider",
"name": "qiskit-qrack-provider",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "qiskit qrack pyqrack simulator quantum addon backend",
"author": "Daniel Strano",
"author_email": "dan@unitary.fund",
"download_url": "https://files.pythonhosted.org/packages/87/3d/829d4b205d83967a6e46b3cf498db2313c8cebe98167d05fcd18473033af/qiskit-qrack-provider-0.10.0.tar.gz",
"platform": null,
"description": "# qiskit-qrack-provider\n\nThis repository contains a Qrack provider for Qiskit. You must [install PyQrack](https://pypi.org/project/pyqrack/) to use it.\n\nThe underlying Qrack simulator is a high-performance, GPU-accelarated, noiseless simulator, by design. This repository provides the Qrack `QasmSimulator`.\n\nThis 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.\n\nTo use, in Qiskit:\n```python\nfrom qiskit.providers.qrack import Qrack\n\nbackend = Qrack.get_backend('qasm_simulator')\n```\n\nFor example, for use with [unitaryfund/mitiq](https://github.com/unitaryfund/mitiq), creating a (noiseless) `executor` can be as simple as follows:\n```python\nfrom qiskit.providers.qrack import Qrack\n\ndef executor(circuit, shots=1000):\n \"\"\"Executes the input circuit and returns the noisy expectation value <A>, where A=|0><0|.\n \"\"\"\n # Use the Qrack QasmSimulator backend, (but it's specifically noiseless)\n ideal_backend = Qrack.get_backend('qasm_simulator')\n\n # Append measurements\n circuit_to_run = circuit.copy()\n circuit_to_run.measure_all()\n\n # Run and get counts\n print(f\"Executing circuit with {len(circuit)} gates using {shots} shots.\")\n job = ideal_backend.run(circuit_to_run, shots=shots)\n counts = job.result().get_counts()\n\n # Compute expectation value of the observable A=|0><0|\n return counts[\"0\"] / shots\n```\n\nGenerally, you will need to adapt the above `executor` snippet to your particular purpose.\n\n(Happy Qracking! You rock!)\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "Qiskit Qrack Provider - Qrack High-Performance GPU simulation for Qiskit",
"version": "0.10.0",
"project_urls": {
"Homepage": "https://github.com/vm6502q/qiskit-qrack-provider"
},
"split_keywords": [
"qiskit",
"qrack",
"pyqrack",
"simulator",
"quantum",
"addon",
"backend"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c0968047884805d0147b0513543b5f3a686bcd0d86ecc8074f7c848e44add9c8",
"md5": "34a88666fc4508e1ff412417843b1f14",
"sha256": "454a12d2c59664272b662081ccc9c3dbc19c82a610c15052c15e9bfb02997650"
},
"downloads": -1,
"filename": "qiskit_qrack_provider-0.10.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "34a88666fc4508e1ff412417843b1f14",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 21250,
"upload_time": "2024-02-20T13:45:15",
"upload_time_iso_8601": "2024-02-20T13:45:15.485067Z",
"url": "https://files.pythonhosted.org/packages/c0/96/8047884805d0147b0513543b5f3a686bcd0d86ecc8074f7c848e44add9c8/qiskit_qrack_provider-0.10.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "873d829d4b205d83967a6e46b3cf498db2313c8cebe98167d05fcd18473033af",
"md5": "37e1780f6f3771f77d49e52f3f2fb929",
"sha256": "0bcb14dcba0150cd623df3b9c910374bf42c56971076587009bb6f8c9e599502"
},
"downloads": -1,
"filename": "qiskit-qrack-provider-0.10.0.tar.gz",
"has_sig": false,
"md5_digest": "37e1780f6f3771f77d49e52f3f2fb929",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 18945,
"upload_time": "2024-02-20T13:45:17",
"upload_time_iso_8601": "2024-02-20T13:45:17.575488Z",
"url": "https://files.pythonhosted.org/packages/87/3d/829d4b205d83967a6e46b3cf498db2313c8cebe98167d05fcd18473033af/qiskit-qrack-provider-0.10.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-20 13:45:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "vm6502q",
"github_project": "qiskit-qrack-provider",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "qiskit-qrack-provider"
}