.. Strangeworks Python SDK documentation master file, created by sphinx-quickstart on Fri Jan 22 18:44:30 2021. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Strangeworks SDK Qiskit Extension ========================================================= .. image:: https://img.shields.io/pypi/v/strangeworks_qiskit.svg :target: https://pypi.python.org/pypi/strangeworks_qiskit :alt: 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 Strangeworks SDK Qiskit Extension is installed using pip :: pip install strangeworks_qiskit Test your installation by running the following :: $ python >>> import strangeworks_qiskit >>> print(strangeworks_qiskit.__version__) Authentication -------------- Authenticate using the ``strangeworks.authenticate()`` method :: $ python >>> import strangeworks >>> strangeworks.authenticate(api_key="") Basic Usage ----------- The SDK provides a Qiskit extension that can be used to run quantum circuits on the Strangeworks platform. .. code-block:: python from qiskit import QuantumCircuit import strangeworks from strangeworks_qiskit import StrangeworksProvider # 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")) strangeworks.set_resource_for_product("resource-slug", "product-slug") # Create a quantum circuit qc = QuantumCircuit(2, 2) qc.h(0) qc.cx(0, 1) qc.measure([0, 1], [0, 1]) # Create a Strangeworks provider provider = StrangeworksProvider() # Create a backend backend = provider.get_backend("ibmq_qasm_simulator") # Run the circuit job = qiskit.execute(qc, backend, shots=100) print(f"status: {job.status()}") # Get the results r = job.result() print(f"result: {r}") Python SDK Module Reference --------------------------- .. toctree:: :maxdepth: 4 :caption: Contents: strangeworks_qiskit