The Cirq module that provides tools and access to Superstaq.
Project description
cirq-superstaq
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.
cirq-superstaq
is available on PyPI and can be installed with:
pip install cirq-superstaq
Please note that Python version 3.8
or higher is required. For further installation instructions, see here.
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.infleqtion.com""",
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, 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 Distribution
cirq-superstaq-0.5.8.tar.gz
(58.3 kB
view hashes)
Built Distribution
Close
Hashes for cirq_superstaq-0.5.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca3f78c3bdb4600f6c5a59c49c3e925f3b11998d2e61d9f7d2e968056313e9d9 |
|
MD5 | 27d7c44d631d4f8d5bc7cbd49746cf92 |
|
BLAKE2b-256 | 70bff9de6498ed5094e8867d79b83cfcfcab9e30d3a4563c041212a89a2f5b77 |