.. 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 VQE Extension ========================================================= .. image:: https://img.shields.io/pypi/v/strangeworks_vqe.svg :target: https://pypi.python.org/pypi/strangeworks_vqe :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 Peptide design SDK is installed from a private git repo using pip :: pip install strangeworks-vqe Test your installation by running the following :: $ python >>> import strangeworks_vqe >>> print(strangeworks_vqe.__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 import strangeworks from strangeworks_vqe.sdk import StrangeworksVQE import strangeworks_vqe.utils as utils strangeworks.authenticate(api_key=" ", store_credentials=False) sw_vqe = StrangeworksVQE(resource_slug=" ") nqubits = 4 Jz = 0.5 Jxy = 1 H = utils.get_Heisenberg_PauliSumOp(nqubits, Jz, Jxy) maxiter = 20 shotsin = 100 optimizer = "NELDER_MEAD" ansatz = "RealAmplitudes" problem_params = { "maxiter": maxiter, "shotsin": shotsin, "nqubits": nqubits, "optimizer": optimizer, # optional "ansatz": ansatz, # optional } backend = "ibmq_qasm_simulator" sw_job = sw_vqe.run(backend, H, problem_params) result = sw_vqe.get_results(sw_job,calculate_exact_sol=True, display_results=True) Python SDK Module Reference --------------------------- .. toctree:: :maxdepth: 4 :caption: Contents: strangeworks_vqe