Strangeworks SDK Qiskit Runtime Extension

PyPI

The service uses the Strangeworks API accessed through the Strangeworks python SDK. For more information on the general python sdk see our docs.

To get started you will need to install the SDK and authenticate using your API key. Your API key can be found on the dashboard page of the Strangeworks platform at https://portal.strangeworks.com.

Installation

The Peptide design SDK is installed from a private git repo using pip

pip install strangeworks-qiskit-runtime

Test your installation by running the following

$ python
>>> import strangeworks_qiskit_runtime
>>> print(strangeworks_qiskit_runtime.__version__)

Authentication

Authenticate using the strangeworks.authenticate() method

$ python
>>> import strangeworks
>>> strangeworks.authenticate(api_key="<your-api-key>")

Basic Usage

The SDK provides a Qiskit extension that can be used to run quantum circuits on the Strangeworks platform.

import qiskit
import strangeworks
from qiskit_ibm_runtime import Session

from strangeworks_qiskit_runtime import (
    StrangeworksQiskitRuntimeService,
    StrangeworksSampler,
)

# Authenticate with the Strangeworks API and set the resource for the
# product (this is only needed for products with more than one resource)
strangeworks.authenticate(api_key=os.getenv("STRANGEWORKS_API_KEY"))

service = StrangeworksQiskitRuntimeService(channel="ibm_quantum")

session = Session(service=service, backend="ibmq_qasm_simulator")
sampler = StrangeworksSampler(session=session)

circuit = qiskit.QuantumCircuit(2)
circuit.h(0)
circuit.cx(0, 1)
circuit.measure_all()

job = sampler.run(circuit, shots=1000)

result = job.result()

Python SDK Module Reference