plaquette-ibm-backend


Nameplaquette-ibm-backend JSON
Version 0.0.2.post0 PyPI version JSON
download
home_page
SummaryPlugin connecting plaquette to the IBM Quantum Systems and Simulators
upload_time2023-12-13 16:51:24
maintainer
docs_urlNone
author
requires_python>=3.10
license
keywords quantum error correction
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ``plaquette-ibm-backend-``: connecting ``plaquette`` to IBM Quantum
===================================================================

``plaquette-ibm-backend`` is an easy-to-install plugin that allows using IBM Quantum
remote systems and simulators with `plaquette <https://docs.plaquette.design/>`_.

Installation
------------

``plaquette-ibm-backend`` is a pure Python package, so it can be easily installed via
``pip``::

   pip install plaquette-ibm-backend


Example
-------

First, authenticate to IBM Quantum by providing a token. This can be done for
example via

.. code-block:: python

    from qiskit_ibm_provider import IBMProvider
    IBMProvider.save_account("<Your token>")

.. note::

    To specify a custom hub/group/project, the ``instance`` argument can be
    passed to ``save_account``.

For further ways of authentication refer to the IBM Quantum and Qiskit documentation.

Once the account has been saved, a quantum circuit generated from a code in
plaquette can be run easily on a remote simulator provided by IBM by specifying
the ``"ibm"`` backend and the name of an IBM system:

.. code-block:: python

    import plaquette
    from plaquette.circuit import Circuit
    from plaquette.codes import Code
    from plaquette.errors import QubitErrorsDict
    from plaquette.circuit.generator import generate_qec_circuit

    # Select a code we'd like to simulate
    code = Code.make_repetition(distance=3)

    # Generate the quantum circuit of the code
    logical_operator = "X"
    circuit = generate_qec_circuit(code, {}, {}, logical_operator, n_rounds=1)

    # Select an IBM Quantum system or simulator by specifying its name during
    # device creation
    system_name = "ibm_kyoto"
    dev = plaquette.Device("ibm", system_name=system_name)
    dev.run(circuit)
    samples, _ = dev.get_sample()

.. code-block:: pycon

    >>> samples
    array([0, 0, 1, 0, 1, 0, 1, 0, 1, 1], dtype=uint8)


.. important::

   Not *all* circuits supported by ``plaquette`` can be run on IBM Quantum
   systems and simulators, as some ``plaquette`` instructions cannot be
   converted to ``OpenQASM 3.0`` (e.g., any circuit with "error instructions"
   cannot be converted). When creating a ``plaquette`` device with an IBM
   backend, the plugin will leave unsupported instructions out of the circuit
   during conversion to ``OpenQASM``.

Need help? Want to contribute?
------------------------------

``plaquette-ibm`` is under heavy development, so it might have some rough corners that need
polishing. If you encounter something you think (or the docs say) should work but does
not, just open an `issue <https://github.com/qc-design/plaquette-ibm/issues/new>`_
or, if you also want to share a solution, a
`pull request <https://github.com/qc-design/plaquette-ibm/compare>`_! See
our `development standard <https://docs.plaquette.design/dev/index.html>`_ to
have an idea of how to match your suggestions to the codebase.

Want to simply share feedback or you're unsure how to do something? Open a new
`discussion <https://github.com/qc-design/plaquette/discussions/new/choose>`_!

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "plaquette-ibm-backend",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "Quantum error correction",
    "author": "",
    "author_email": "QC Design GmbH <software@qc.design>",
    "download_url": "",
    "platform": null,
    "description": "``plaquette-ibm-backend-``: connecting ``plaquette`` to IBM Quantum\n===================================================================\n\n``plaquette-ibm-backend`` is an easy-to-install plugin that allows using IBM Quantum\nremote systems and simulators with `plaquette <https://docs.plaquette.design/>`_.\n\nInstallation\n------------\n\n``plaquette-ibm-backend`` is a pure Python package, so it can be easily installed via\n``pip``::\n\n   pip install plaquette-ibm-backend\n\n\nExample\n-------\n\nFirst, authenticate to IBM Quantum by providing a token. This can be done for\nexample via\n\n.. code-block:: python\n\n    from qiskit_ibm_provider import IBMProvider\n    IBMProvider.save_account(\"<Your token>\")\n\n.. note::\n\n    To specify a custom hub/group/project, the ``instance`` argument can be\n    passed to ``save_account``.\n\nFor further ways of authentication refer to the IBM Quantum and Qiskit documentation.\n\nOnce the account has been saved, a quantum circuit generated from a code in\nplaquette can be run easily on a remote simulator provided by IBM by specifying\nthe ``\"ibm\"`` backend and the name of an IBM system:\n\n.. code-block:: python\n\n    import plaquette\n    from plaquette.circuit import Circuit\n    from plaquette.codes import Code\n    from plaquette.errors import QubitErrorsDict\n    from plaquette.circuit.generator import generate_qec_circuit\n\n    # Select a code we'd like to simulate\n    code = Code.make_repetition(distance=3)\n\n    # Generate the quantum circuit of the code\n    logical_operator = \"X\"\n    circuit = generate_qec_circuit(code, {}, {}, logical_operator, n_rounds=1)\n\n    # Select an IBM Quantum system or simulator by specifying its name during\n    # device creation\n    system_name = \"ibm_kyoto\"\n    dev = plaquette.Device(\"ibm\", system_name=system_name)\n    dev.run(circuit)\n    samples, _ = dev.get_sample()\n\n.. code-block:: pycon\n\n    >>> samples\n    array([0, 0, 1, 0, 1, 0, 1, 0, 1, 1], dtype=uint8)\n\n\n.. important::\n\n   Not *all* circuits supported by ``plaquette`` can be run on IBM Quantum\n   systems and simulators, as some ``plaquette`` instructions cannot be\n   converted to ``OpenQASM 3.0`` (e.g., any circuit with \"error instructions\"\n   cannot be converted). When creating a ``plaquette`` device with an IBM\n   backend, the plugin will leave unsupported instructions out of the circuit\n   during conversion to ``OpenQASM``.\n\nNeed help? Want to contribute?\n------------------------------\n\n``plaquette-ibm`` is under heavy development, so it might have some rough corners that need\npolishing. If you encounter something you think (or the docs say) should work but does\nnot, just open an `issue <https://github.com/qc-design/plaquette-ibm/issues/new>`_\nor, if you also want to share a solution, a\n`pull request <https://github.com/qc-design/plaquette-ibm/compare>`_! See\nour `development standard <https://docs.plaquette.design/dev/index.html>`_ to\nhave an idea of how to match your suggestions to the codebase.\n\nWant to simply share feedback or you're unsure how to do something? Open a new\n`discussion <https://github.com/qc-design/plaquette/discussions/new/choose>`_!\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Plugin connecting plaquette to the IBM Quantum Systems and Simulators",
    "version": "0.0.2.post0",
    "project_urls": {
        "Bug Tracker": "https://github.com/qc-design/plaquette-ibm-backend/issues",
        "Homepage": "https://docs.plaquette.design/projects/ibm-backend"
    },
    "split_keywords": [
        "quantum",
        "error",
        "correction"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39778352e15418ab12f51a0681cbe5e4b767cdacb63256ee1ccfbc0e8e3fa9cd",
                "md5": "c710610e4a574b84de6b12b849878f8a",
                "sha256": "c0849c98b6dd1f54cc432d72825d1c0bf965f0abad02f01547f2ea88aad22129"
            },
            "downloads": -1,
            "filename": "plaquette_ibm_backend-0.0.2.post0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c710610e4a574b84de6b12b849878f8a",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.10",
            "size": 9819,
            "upload_time": "2023-12-13T16:51:24",
            "upload_time_iso_8601": "2023-12-13T16:51:24.720722Z",
            "url": "https://files.pythonhosted.org/packages/39/77/8352e15418ab12f51a0681cbe5e4b767cdacb63256ee1ccfbc0e8e3fa9cd/plaquette_ibm_backend-0.0.2.post0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-13 16:51:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "qc-design",
    "github_project": "plaquette-ibm-backend",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "plaquette-ibm-backend"
}
        
Elapsed time: 0.16510s