Skip to content

qfizik/platform_client_library_python

 
 

Repository files navigation

logo

QC Ware Platform Client Library (Python)

This package contains functions for easily interfacing with the QC Ware Platform from Python.

PyPI version Downloads Downloads CircleCI Documentation Status

Installation

This documentation is for the latest (prerelease) version of QCWare's Forge client, which at present relies on some internal packages. It is "baked into" QCWare's Jupyterhub notebooks, but local installation will have to wait until Quasar, our circuit-model library, is publicly available.

Ordinarily, you would install as follows:

To install with pip:

pip install qcware

Or, to install from source:

git clone https://github.com/qcware/platform_client_library_python.git
cd platform_client_library_python
pip install -e .

Sign up for an API key at https://forge.qcware.com to access Forge. Please see our documentation.

Using QC Ware Forge

From your Forge dashboard, you will have access to many notebooks with detailed tutorials and examples. Below we will show a few Hello World examples.

Optimization

Consider the following optimization problem:

x=\min^{x \in {0, 1}^3}(x_0x_1+2x_0x_2-x_1x_2+x_0-3x_1)

We can solve this with the qcware software package. First, create a QUBO representation (see the notebooks for details).

Q = {(0, 1): 1, (0, 2): 2, (1, 2): -1, (0, 0): 1, (1, 1): -3}

Next, choose a backend (formerly _solver_). For example, to solve the problem with D'Wave's quantum annealer, set the backend argument to 'dwave'.

backend = 'dwave'

Finally, configure the QCWare library and call the solver (note! configuration has changed; see below. You no longer need to supply your api key with every call)

import qcware
qcware.config.set_api_key('your_api_key_here')
result = qcware.optimization.solve_binary(Q=Q, backend=backend)
print(result)

Please see the documentation and notebooks for more details.

About

The Python client library for the QC Ware Platform

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%