Skip to main content

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

cirq_superstaq-0.3.6-py3-none-any.whl (39.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page