Skip to main content

Plugin connecting plaquette to the IBM Quantum Systems and Simulators

Project description

plaquette-ibm-backend is an easy-to-install plugin that allows using IBM Quantum remote systems and simulators with plaquette.

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

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

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:

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()
>>> samples
array([0, 0, 1, 0, 1, 0, 1, 0, 1, 1], dtype=uint8)

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 or, if you also want to share a solution, a pull request! See our development standard 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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

plaquette_ibm_backend-0.0.2.post0-py2.py3-none-any.whl (9.8 kB view hashes)

Uploaded Python 2 Python 3

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