No project description provided
Project description
Quantum Serverless client
Client part of quantum serverless project. Installable python library to communicate with provisioned infrastructure.
Table of Contents
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
Release history Release notifications | RSS feed
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.2.tar.gz
(12.0 kB
view hashes)
Built Distribution
Close
Hashes for quantum_serverless-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84b47f770ccbe453c4e388b32e54ed7e7553dc774b4c50a4482f7e275f7ae87c |
|
MD5 | 7009bad596ab679525a694da5de0ada6 |
|
BLAKE2b-256 | ab769fe90778f5631cb08aa72ffd0fed62b9487aaf712911b4c2be9565ae2dec |