qiskit-qrack-provider


Nameqiskit-qrack-provider JSON
Version 0.12.4 PyPI version JSON
download
home_pagehttps://github.com/vm6502q/qiskit-qrack-provider
SummaryQiskit Qrack Provider - Qrack High-Performance GPU simulation for Qiskit
upload_time2024-11-18 21:37:38
maintainerNone
docs_urlNone
authorDaniel Strano
requires_pythonNone
licenseApache 2.0
keywords qiskit qrack pyqrack simulator quantum addon backend
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # qiskit-qrack-provider

This repository contains a Qrack provider for Qiskit. You must [install PyQrack](https://pypi.org/project/pyqrack/) to use it.

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:
```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!)

----

License: [Apache License Version 2.0](https://github.com/vm6502q/qiskit-qrack-provider/blob/master/LICENSE),
Copyright (c) Daniel Strano and the Qrack contributors 2017-2024. All rights reserved.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/vm6502q/qiskit-qrack-provider",
    "name": "qiskit-qrack-provider",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "qiskit qrack pyqrack simulator quantum addon backend",
    "author": "Daniel Strano",
    "author_email": "dan@unitary.fund",
    "download_url": "https://files.pythonhosted.org/packages/a3/46/577e7c7c434091f605fbaa688f1556d1b253f6132f8986a384cf8611b210/qiskit_qrack_provider-0.12.4.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\nQrack 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`.\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\n----\n\nLicense: [Apache License Version 2.0](https://github.com/vm6502q/qiskit-qrack-provider/blob/master/LICENSE),\nCopyright (c) Daniel Strano and the Qrack contributors 2017-2024. All rights reserved.\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "Qiskit Qrack Provider - Qrack High-Performance GPU simulation for Qiskit",
    "version": "0.12.4",
    "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": "5d19a5af2fbe0e3e81f26677fe820eebf20ec621cc57a07a64c21b64d3d9fb22",
                "md5": "37724acfc100dfe6b6316a314362993c",
                "sha256": "2ab2ba09c8ceff023e90ac5b36c63107c9027bd99516917c188b2c1b76571592"
            },
            "downloads": -1,
            "filename": "qiskit_qrack_provider-0.12.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "37724acfc100dfe6b6316a314362993c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 21387,
            "upload_time": "2024-11-18T21:37:37",
            "upload_time_iso_8601": "2024-11-18T21:37:37.054519Z",
            "url": "https://files.pythonhosted.org/packages/5d/19/a5af2fbe0e3e81f26677fe820eebf20ec621cc57a07a64c21b64d3d9fb22/qiskit_qrack_provider-0.12.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a346577e7c7c434091f605fbaa688f1556d1b253f6132f8986a384cf8611b210",
                "md5": "78a63d25aa8b132548c4c338fc8d1d7c",
                "sha256": "f7741db621ecb24d19da079ed967ce0a4dd7a03301e20bdd6a1ee8f124d387b2"
            },
            "downloads": -1,
            "filename": "qiskit_qrack_provider-0.12.4.tar.gz",
            "has_sig": false,
            "md5_digest": "78a63d25aa8b132548c4c338fc8d1d7c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 19336,
            "upload_time": "2024-11-18T21:37:38",
            "upload_time_iso_8601": "2024-11-18T21:37:38.777333Z",
            "url": "https://files.pythonhosted.org/packages/a3/46/577e7c7c434091f605fbaa688f1556d1b253f6132f8986a384cf8611b210/qiskit_qrack_provider-0.12.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-18 21:37:38",
    "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"
}
        
Elapsed time: 0.61214s