Skip to main content

No project description provided

Project description

Stability Client verify process License Code style: Black Python Qiskit

Quantum Serverless client

Client part of quantum serverless project. Installable python library to communicate with provisioned infrastructure.

Table of Contents

  1. Installation
  2. Usage

Installation

pip install quantum_serverless

or local installation from source

pip install -e .

Usage

from quantum_serverless import QuantumServerless, run_qiskit_remote, get

# 1. let's annotate out function to convert it 
# to function that can be executed remotely
# using `run_qiskit_remote` decorator
@run_qiskit_remote()
def my_qiskit_function():
    # Doing compute things here!
    return "Computed result"


# 2. Next let's create out serverless object to control 
# where our remote function will be executed
serverless = QuantumServerless()

# 3. create serverless context
with serverless: # or serverless.provider("<NAME_OF_AVAILABLE_PROVIDER>")
    # 4. run our function and get back reference to it
    # as now our function it remote one
    function_reference = my_qiskit_function()
    # 4.1 or we can run N of them in parallel
    N = 4
    function_references = [my_qiskit_function() for _ in range(N)]

    # 5. to get results back from reference
    # we need to call `get` on function reference
    print(get(function_reference))
    print(get(function_references))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quantum_serverless-0.0.1.tar.gz (11.9 kB view hashes)

Uploaded Source

Built Distribution

quantum_serverless-0.0.1-py3-none-any.whl (20.1 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