Qubit Toaster backend for Qiskit: run Qiskit code on Quantastica "Qubit Toaster" simulator
Project description
Qubit Toaster backend for Qiskit
Allows running Qiskit code on Qubit Toaster - a high performance quantum circuit simulator.
More goodies at https://quantastica.com
Install
pip install quantastica-qiskit-toaster
Usage
Import ToasterBackend into your Qiskit code:
from quantastica.qiskit_toaster import ToasterBackend
Replace Aer.get_backend
with ToasterBackend.get_backend
.
Example
from qiskit import QuantumRegister, ClassicalRegister
from qiskit import QuantumCircuit, execute, Aer
from quantastica.qiskit_toaster import ToasterBackend
qc = QuantumCircuit()
q = QuantumRegister(2, "q")
c = ClassicalRegister(2, "c")
qc.add_register(q)
qc.add_register(c)
qc.h(q[0])
qc.cx(q[0], q[1])
qc.measure(q[0], c[0])
qc.measure(q[1], c[1])
# Instead:
#backend = Aer.get_backend("qasm_simulator")
# Use:
backend = ToasterBackend.get_backend("qasm_simulator")
# OR:
# backend = ToasterBackend.get_backend("statevector_simulator")
job = execute(qc, backend=backend)
job_result = job.result()
print(job_result.get_counts(qc))
Details
Syntax
ToasterBackend.get_backend(backend_name = None)
Arguments
backend_name
can be:
-
qasm_simulator
only counts will be returned -
statevector_simulator
both counts and state vector will be returned
If backend name is not provided then it will act as qasm_simulator
That's it. Enjoy! :)
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 Distribution
Built Distribution
Close
Hashes for quantastica-qiskit-toaster-0.9.16.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70fbfa077138765990c30b8efda55128c882c561582ce98570b2b0a78206bfb1 |
|
MD5 | 34162bb8fe6a07ce1eb8ef50ae5cd800 |
|
BLAKE2b-256 | 63edfdf42b23a689871ae0632d505963fa75ae6e264f4a468bf973f6366969c4 |
Close
Hashes for quantastica_qiskit_toaster-0.9.16-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5696785e9210670fcbf1412acd70c9116cf49bea7e091fb8f293f6b4697ee4b |
|
MD5 | ae0194b99ddc8e9a29ae5ca2c5e8bdaa |
|
BLAKE2b-256 | 9f1792f19a4f6a4c42b614e0552ecacdcc3788c9ee0b0dba5a78a01d056991c1 |