Quantastica quantum simulator tools
Project description
Qubit Toaster backend for Qiskit
Allows running Qiskit code on Qubit Toaster - a high performance quantum circuit simulator.
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.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38c5b98b7aa62c0911edc1aea9bbd5d58b7ccef0f9ea4730ff1389cfb3bceaa9 |
|
MD5 | 06a58a9377f1fae07f4414d503e444b7 |
|
BLAKE2b-256 | cddac5933af3e0f4385c174f5eab145fb0feab87ca67d2aedf34d8b5749d3982 |
Close
Hashes for quantastica_qiskit_toaster-0.9.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc4a3941b7c660ed57c4eb16af7ff4ee5e9a0a6364ce2a245e26a8c59f829721 |
|
MD5 | d85c080b80531b3dfc0b8ddf67ec8167 |
|
BLAKE2b-256 | a371c53e53e5108b6921e096f71a60ddd6890d181374fd7e3ee51b563a1ddc2e |