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 ciruict 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 LatticeCode
from plaquette.errors import QubitErrorsDict
from plaquette.circuit.generator import generate_qec_circuit
# Select a code we'd like to simulate
code = LatticeCode.make_repetition(n_rounds=1, size=3)
# Generate the quantum circuit of the code
logical_operator = "X"
circuit = generate_qec_circuit(code, {}, {}, logical_operator)
# Select an IBM Quantum system or simulator by specifying its name during
# device creation
system_name = "simulator_stabilizer"
dev = plaquette.Device("ibm", system_name=system_name)
dev.run(circuit)
samples, _ = dev.get_sample()
>>> samples
array([0, 1, 1, 1, 0, 0, 0, 0, 0, 0], 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
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 Distributions
Built Distribution
File details
Details for the file plaquette_ibm_backend-0.0.1a0-py2.py3-none-any.whl
.
File metadata
- Download URL: plaquette_ibm_backend-0.0.1a0-py2.py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c7b4ab4cc424ec585206dcbb8e103f0626fda5f7b23cfc33f17fbfc5cf4231b |
|
MD5 | 143c605f6382095befca6ff7fcfaa223 |
|
BLAKE2b-256 | a22cce4b9406a1bbb08b3114ff3875dca1bde194e244ad26ea27f7b73d526c42 |