The Cirq module that provides tools and access to SuperstaQ
Project description
This package is used to access SuperstaQ via a Web API through Cirq. Cirq programmers can take advantage of the applications, pulse level optimizations, and write-once-target-all features of SuperstaQ with this package.
Please note that Python version 3.7
or higher is required. cirq-superstaq and all of its
dependencies can be installed via:
python3 -m venv venv_cirq_superstaq
source venv_cirq_superstaq/bin/activate
pip install cirq-superstaq
# Run the following to install dev requirements (required if you intend to run checks locally)
pip install .[dev]
# Run the following to install neutral atom device dependencies.
pip install -r neutral-atom-requirements.txt
Creating and submitting a circuit through cirq-superstaq
import cirq
import cirq_superstaq as css
q0 = cirq.LineQubit(0)
q1 = cirq.LineQubit(1)
circuit = cirq.Circuit(cirq.H(q0), cirq.CNOT(q0, q1), cirq.measure(q0))
service = css.Service(
api_key="""Insert superstaq token that you received from https://superstaq.super.tech""",
verbose=True,
)
# Submitting a circuit to "ibmq_qasm_simulator". Providing the "dry-run" method parameter instructs SuperstaQ to simulate the circuit, and is available to free trial users.
job = service.create_job(circuit=circuit, repetitions=1, target="ibmq_qasm_simulator", method="dry-run")
print("This is the job that's created ", job.status())
print(job.counts())
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
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for cirq_superstaq-0.3.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 232f6eb1c0b96a24196d0aba34f61c59280cf308bef66643f5be1be2efbb707a |
|
MD5 | c4eb2abc96156536c7d7f03da5fab45f |
|
BLAKE2b-256 | 6691aba5b7a51efb76cce5c77f69fd21477ba66f3a9312f91cb6396914769d7b |