GithubHelp home page GithubHelp logo

qiskit / qiskit-serverless Goto Github PK

View Code? Open in Web Editor NEW
58.0 58.0 27.0 45.42 MB

A programming model for leveraging quantum and classical resources

Home Page: https://qiskit.github.io/qiskit-serverless/

License: Apache License 2.0

Makefile 0.37% Python 98.00% Smarty 0.66% Shell 0.34% Dockerfile 0.38% HTML 0.25%
cloud python qiskit qiskit-serverless quantum-computing

qiskit-serverless's Introduction

Qiskit

License Current Release Extended Support Release Downloads Coverage Status PyPI - Python Version Minimum rustc 1.70 Downloads DOI

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.

This library is the core component of Qiskit, which contains the building blocks for creating and working with quantum circuits, quantum operators, and primitive functions (Sampler and Estimator). It also contains a transpiler that supports optimizing quantum circuits, and a quantum information toolbox for creating advanced operators.

For more details on how to use Qiskit, refer to the documentation located here:

https://docs.quantum.ibm.com/

Installation

Warning

Do not try to upgrade an existing Qiskit 0.* environment to Qiskit 1.0 in-place. Read more.

We encourage installing Qiskit via pip:

pip install qiskit

Pip will handle all dependencies automatically and you will always install the latest (and well-tested) version.

To install from source, follow the instructions in the documentation.

Create your first quantum program in Qiskit

Now that Qiskit is installed, it's time to begin working with Qiskit. The essential parts of a quantum program are:

  1. Define and build a quantum circuit that represents the quantum state
  2. Define the classical output by measurements or a set of observable operators
  3. Depending on the output, use the primitive function sampler to sample outcomes or the estimator to estimate values.

Create an example quantum circuit using the QuantumCircuit class:

import numpy as np
from qiskit import QuantumCircuit

# 1. A quantum circuit for preparing the quantum state |000> + i |111>
qc_example = QuantumCircuit(3)
qc_example.h(0)          # generate superpostion
qc_example.p(np.pi/2,0)  # add quantum phase
qc_example.cx(0,1)       # 0th-qubit-Controlled-NOT gate on 1st qubit
qc_example.cx(0,2)       # 0th-qubit-Controlled-NOT gate on 2nd qubit

This simple example makes an entangled state known as a GHZ state $(|000\rangle + i|111\rangle)/\sqrt{2}$. It uses the standard quantum gates: Hadamard gate (h), Phase gate (p), and CNOT gate (cx).

Once you've made your first quantum circuit, choose which primitive function you will use. Starting with sampler, we use measure_all(inplace=False) to get a copy of the circuit in which all the qubits are measured:

# 2. Add the classical output in the form of measurement of all qubits
qc_measured = qc_example.measure_all(inplace=False)

# 3. Execute using the Sampler primitive
from qiskit.primitives.sampler import Sampler
sampler = Sampler()
job = sampler.run(qc_measured, shots=1000)
result = job.result()
print(f" > Quasi probability distribution: {result.quasi_dists}")

Running this will give an outcome similar to {0: 0.497, 7: 0.503} which is 000 50% of the time and 111 50% of the time up to statistical fluctuations. To illustrate the power of Estimator, we now use the quantum information toolbox to create the operator $XXY+XYX+YXX-YYY$ and pass it to the run() function, along with our quantum circuit. Note the Estimator requires a circuit without measurement, so we use the qc_example circuit we created earlier.

# 2. Define the observable to be measured 
from qiskit.quantum_info import SparsePauliOp
operator = SparsePauliOp.from_list([("XXY", 1), ("XYX", 1), ("YXX", 1), ("YYY", -1)])

# 3. Execute using the Estimator primitive
from qiskit.primitives import Estimator
estimator = Estimator()
job = estimator.run(qc_example, operator, shots=1000)
result = job.result()
print(f" > Expectation values: {result.values}")

Running this will give the outcome 4. For fun, try to assign a value of +/- 1 to each single-qubit operator X and Y and see if you can achieve this outcome. (Spoiler alert: this is not possible!)

Using the Qiskit-provided qiskit.primitives.Sampler and qiskit.primitives.Estimator will not take you very far. The power of quantum computing cannot be simulated on classical computers and you need to use real quantum hardware to scale to larger quantum circuits. However, running a quantum circuit on hardware requires rewriting to the basis gates and connectivity of the quantum hardware. The tool that does this is the transpiler, and Qiskit includes transpiler passes for synthesis, optimization, mapping, and scheduling. However, it also includes a default compiler, which works very well in most examples. The following code will map the example circuit to the basis_gates = ['cz', 'sx', 'rz'] and a linear chain of qubits $0 \rightarrow 1 \rightarrow 2$ with the coupling_map =[[0, 1], [1, 2]].

from qiskit import transpile
qc_transpiled = transpile(qc_example, basis_gates = ['cz', 'sx', 'rz'], coupling_map =[[0, 1], [1, 2]] , optimization_level=3)

Executing your code on real quantum hardware

Qiskit provides an abstraction layer that lets users run quantum circuits on hardware from any vendor that provides a compatible interface. The best way to use Qiskit is with a runtime environment that provides optimized implementations of sampler and estimator for a given hardware platform. This runtime may involve using pre- and post-processing, such as optimized transpiler passes with error suppression, error mitigation, and, eventually, error correction built in. A runtime implements qiskit.primitives.BaseSampler and qiskit.primitives.BaseEstimator interfaces. For example, some packages that provide implementations of a runtime primitive implementation are:

Qiskit also provides a lower-level abstract interface for describing quantum backends. This interface, located in qiskit.providers, defines an abstract BackendV2 class that providers can implement to represent their hardware or simulators to Qiskit. The backend class includes a common interface for executing circuits on the backends; however, in this interface each provider may perform different types of pre- and post-processing and return outcomes that are vendor-defined. Some examples of published provider packages that interface with real hardware are:

You can refer to the documentation of these packages for further instructions on how to get access and use these systems.

Contribution Guidelines

If you'd like to contribute to Qiskit, please take a look at our contribution guidelines. By participating, you are expected to uphold our code of conduct.

We use GitHub issues for tracking requests and bugs. Please join the Qiskit Slack community for discussion, comments, and questions. For questions related to running or using Qiskit, Stack Overflow has a qiskit. For questions on quantum computing with Qiskit, use the qiskit tag in the Quantum Computing Stack Exchange (please, read first the guidelines on how to ask in that forum).

Authors and Citation

Qiskit is the work of many people who contribute to the project at different levels. If you use Qiskit, please cite as per the included BibTeX file.

Changelog and Release Notes

The changelog for a particular release is dynamically generated and gets written to the release page on Github for each release. For example, you can find the page for the 0.46.0 release here:

https://github.com/Qiskit/qiskit/releases/tag/0.46.0

The changelog for the current release can be found in the releases tab: Releases The changelog provides a quick overview of notable changes for a given release.

Additionally, as part of each release, detailed release notes are written to document in detail what has changed as part of a release. This includes any documentation on potential breaking changes on upgrade and new features. See all release notes here.

Acknowledgements

We acknowledge partial support for Qiskit development from the DOE Office of Science National Quantum Information Science Research Centers, Co-design Center for Quantum Advantage (C2QA) under contract number DE-SC0012704.

License

Apache License 2.0

qiskit-serverless's People

Contributors

1ucian0 avatar akihikokuroda avatar caleb-johnson avatar david-alber avatar eric-arellano avatar garrison avatar github-actions[bot] avatar ibrahim-shehzad avatar icekhan13 avatar jenglick avatar karlaspuldaro avatar kevin-bates avatar mrvee-qc-bee avatar pacomf avatar psschwei avatar renovate[bot] avatar richrines1 avatar scottmason88 avatar seokho-son avatar tansito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qiskit-serverless's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency Django to >=4.2.13
  • Update dependency nbsphinx to >=0.9.4
  • Update dependency tqdm to >=4.66.4
  • Update alpine/k8s Docker tag to v1.30.0
  • Update dependency dj-rest-auth to >=5.1.0
  • Update dependency django-allauth to >=0.62.1
  • Update dependency djangorestframework to >=3.15.1
  • Update dependency nbqa to >=1.8.5
  • Update dependency requests-mock to >=1.12.1
  • Update dependency responses to >=0.25.0
  • Update dependency s3fs to >=2023.12.2
  • Update dependency setuptools to >=69.5.1
  • Update dependency sphinx-autodoc-typehints to >=1.25.3
  • Update dependency tox to >=4.15.0
  • Update grafana/loki Docker tag to v2.9.8
  • Update grafana/promtail Docker tag to v2.9.8
  • Update icr.io/quantum-public/quantum-serverless-ray-node Docker tag to v0.10.1
  • Update opentelemetry packages to >=1.24.0 (opentelemetry-api, opentelemetry-exporter-otlp, opentelemetry-exporter-otlp-proto-grpc, opentelemetry-sdk)
  • Update prom/prometheus Docker tag to v2.51.2
  • Update python Docker tag to v3.11.4
  • Update qiskit packages (qiskit-ibm-provider, qiskit-ibm-runtime)
  • Update registry.access.redhat.com/ubi8/openssl Docker tag to v8.9-13
  • Update Helm release nginx-ingress-controller to v10
  • Update Helm release nginx-ingress-controller to v11
  • Update Helm release postgresql to v14
  • Update Helm release postgresql to v15
  • Update actions/checkout action to v4
  • Update actions/setup-python action to v5
  • Update actions/upload-artifact action to v4
  • Update azure/setup-helm action to v2
  • Update azure/setup-helm action to v3
  • Update azure/setup-helm action to v4
  • Update dependency Django to v5
  • Update dependency Sphinx to v7
  • Update dependency black to v23
  • Update dependency black to v24
  • Update dependency cloudpickle to v3
  • Update dependency coverage to v6
  • Update dependency coverage to v7
  • Update dependency cryptography to v42.0.7
  • Update dependency dj-rest-auth to v6
  • Update dependency importlib-metadata to v6
  • Update dependency importlib-metadata to v7
  • Update dependency kubernetes to v27
  • Update dependency kubernetes to v28
  • Update dependency kubernetes to v29
  • Update dependency mypy to v1
  • Update dependency mypy-extensions to v1
  • Update dependency pylint to v3
  • Update dependency pytest to v7
  • Update dependency pytest to v8
  • Update dependency pytest-randomly to v2
  • Update dependency pytest-randomly to v3
  • Update dependency reno to v4
  • Update dependency s3fs to v2024
  • Update dependency sphinx-autodoc-typehints to v2
  • Update dependency testcontainers to v4
  • Update docker/build-push-action action to v4
  • Update docker/build-push-action action to v5
  • Update docker/login-action action to v3
  • Update docker/setup-buildx-action action to v3
  • Update docker/setup-qemu-action action to v3
  • Update grafana/loki Docker tag to v3
  • Update grafana/promtail Docker tag to v3
  • Update peaceiris/actions-gh-pages action to v4
  • Update peter-evans/create-pull-request action to v6
  • Update release-drafter/release-drafter action to v6
  • 🔐 Create all rate-limited PRs at once 🔐

Warning

Renovate failed to look up the following dependencies: Failed to look up docker package icr.io/quantum-public/qiskit-serverless-ray-node, Failed to look up docker package icr.io/quantum-public/qiskit-serverless-proxy, Failed to look up docker package icr.io/quantum-public/qiskit-serverless-gateway.

Files affected: charts/qiskit-serverless/charts/gateway/values.yaml, charts/qiskit-serverless/values.yaml


Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • Update dependency ipython to >=8.24.0

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose-dev.yaml
  • prom/prometheus v2.44.0
  • grafana/loki 2.8.4
  • grafana/promtail 2.8.4
docker-compose.yaml
  • prom/prometheus v2.44.0
  • grafana/loki 2.8.4
  • grafana/promtail 2.8.4
dockerfile
Dockerfile-ray-node
docs/deployment/custom_function/Dockerfile
  • icr.io/quantum-public/quantum-serverless-ray-node 0.9.0-py39
gateway/Dockerfile
  • python 3.10.12-slim-buster
proxy/Dockerfile
  • python 3.10.12-slim-buster
github-actions
.github/actions/docker-vscan/action.yaml
  • docker/build-push-action v3
.github/actions/helm-lint/action.yaml
  • azure/setup-helm v1
  • actions/setup-python v4
  • helm/chart-testing-action v2.6.1
.github/actions/icr-build-and-push-images/action.yaml
  • docker/build-push-action v5
  • docker/build-push-action v5
.github/workflows/build-containers-test.yaml
  • actions/checkout v4
  • docker/setup-buildx-action v3
  • docker/build-push-action v5
.github/workflows/client-pypi-release.yaml
  • actions/checkout v3
  • actions/setup-python v4
  • actions/upload-artifact v3
.github/workflows/client-verify.yaml
  • actions/checkout v3
  • actions/setup-python v4
.github/workflows/docker-build.yaml
  • actions/checkout v4
  • actions/setup-python v5
.github/workflows/docker-verify.yaml
  • actions/checkout v3
  • actions/checkout v3
  • actions/checkout v3
.github/workflows/docs-verify.yaml
  • actions/checkout v3
  • actions/setup-python v4
  • actions/upload-artifact v3
.github/workflows/gateway-verify.yaml
  • actions/checkout v3
  • actions/setup-python v4
.github/workflows/helm-verify.yaml
  • actions/checkout v3
.github/workflows/icr-image-build-and-push.yaml
  • actions/checkout v3
  • docker/login-action v2
  • docker/setup-qemu-action v2
  • docker/setup-buildx-action v2
.github/workflows/kubernetes-deploy.yaml
  • actions/checkout v3
  • actions/setup-python v4
.github/workflows/notebook-local-verify.yaml
  • actions/checkout v4
  • actions/setup-python v5
.github/workflows/proxy-verify.yaml
  • actions/checkout v3
  • actions/setup-python v4
.github/workflows/publish-docs.yaml
  • actions/checkout v3
  • actions/setup-python v4
  • peaceiris/actions-gh-pages v3
.github/workflows/publish-helm.yaml
  • azure/setup-helm v3
  • actions/checkout v3
  • actions/upload-artifact v3
  • bruceadams/get-release v1.3.2
  • actions/upload-release-asset v1
.github/workflows/release-drafter.yml
  • release-drafter/release-drafter v5
.github/workflows/release-pull-request.yaml
  • actions/checkout v3
.github/workflows/update-component-versions.yaml
  • actions/checkout v4
  • peter-evans/create-pull-request v5
helm-values
charts/qiskit-serverless/charts/gateway/values.yaml
  • icr.io/quantum-public/qiskit-serverless-ray-node 0.10.1-py39
  • registry.access.redhat.com/ubi8/openssl 8.8-9
  • alpine/k8s 1.29.2@sha256:a51aa37f0a34ff827c7f2f9cb7f6fbb8f0e290fa625341be14c2fcc4b1880f60
  • icr.io/quantum-public/qiskit-serverless-proxy 0.9.0
charts/qiskit-serverless/values.yaml
  • icr.io/quantum-public/qiskit-serverless-gateway 0.10.1
  • icr.io/quantum-public/qiskit-serverless-ray-node 0.10.1-py310
  • registry.access.redhat.com/ubi8/openssl 8.8-9
  • alpine/k8s 1.29.2@sha256:a51aa37f0a34ff827c7f2f9cb7f6fbb8f0e290fa625341be14c2fcc4b1880f60
  • kuberay/operator v1.0.0
helmv3
charts/qiskit-serverless/Chart.yaml
  • nginx-ingress-controller 9.11.0
  • postgresql 13.4.4
  • kuberay-operator 1.0.0
pep621
client/pyproject.toml
  • setuptools >=69.2.0
pip_requirements
client/requirements-dev.txt
  • coverage >=5.5
  • pylint >=2.17.7
  • nbqa >=1.7.1
  • treon >=0.1.4
  • pytest >=6.2.5
  • pytest-randomly >=1.2.3
  • mypy >=0.991
  • mypy-extensions >=0.4.4
  • jupyter-sphinx >=0.5.3
  • nbsphinx >=0.9.3
  • sphinx-autodoc-typehints >=1.24.0
  • reno >=3.5.0
  • black ~=22.12
  • requests-mock >=1.11.0
  • testcontainers ==3.7.1
  • tox >=4.0.0
client/requirements.txt
  • ray >=2.9.3, <3
  • requests >=2.31.0
  • importlib-metadata >=5.2.0
  • qiskit >=1.0.2
  • qiskit-ibm-runtime >=0.21.1
  • qiskit-ibm-provider >=0.10.0
  • cloudpickle ==2.2.1
  • tqdm >=4.66.3
  • opentelemetry-api >=1.18.0
  • opentelemetry-sdk >=1.18.0
  • opentelemetry-exporter-otlp-proto-grpc >=1.18.0
  • s3fs >=2023.6.0
  • opentelemetry.instrumentation.requests >=0.40b0
  • ipywidgets >=8.1.2
  • ipython >=8.10.0
docs/requirements-doc.txt
  • coverage >=5.5
  • pylint >=2.17.7
  • nbqa >=1.7.1
  • treon >=0.1.4
  • pytest >=6.2.5
  • pytest-randomly >=1.2.3
  • mypy >=0.991
  • mypy-extensions >=0.4.4
  • jupyter-sphinx >=0.5.3
  • nbsphinx >=0.9.3
  • sphinx-autodoc-typehints >=1.24.0
  • Sphinx >=6.2.1,<7.2
  • reno >=3.5.0
  • black ~=22.12
  • sphinx-copybutton >=0.5.2
  • qiskit-sphinx-theme ~=1.16.1
  • tox >=4.0.0
gateway/requirements-dev.txt
  • pylint >=2.17.7
  • pytest >=6.2.5
  • pylint-django >=2.5.5
  • black ~=22.12
  • requests-mock >=1.11.0
  • coverage >=5.5
  • responses >=0.23.3
  • tox >=4.0.0
gateway/requirements.txt
  • cryptography >=42.0.5
  • djangorestframework >=3.14.0
  • django-allauth >=0.61.1
  • django-allow-cidr >=0.7.1
  • dj-rest-auth >=5.0.2
  • django-csp >=3.8
  • djangorestframework-simplejwt >=5.3.1
  • django_prometheus >=2.3.1
  • ray >=2.9.3
  • Django >=4.2.11
  • gunicorn >=22.0.0
  • requests >=2.31.0
  • psycopg2-binary >=2.9.9
  • kubernetes >=26.1.0
  • opentelemetry-distro >=0.40b0
  • opentelemetry-exporter-otlp >=1.19.0
  • django-concurrency >=2.5
  • drf-yasg >=1.21.7
  • cryptography >=41.0.1
  • sqlparse >=0.5.0
proxy/requirements-dev.txt
  • pylint >=2.17.7
  • black ~=22.12
  • coverage >=5.5
  • tox >=4.0.0
proxy/requirements.txt
  • headerparser ==0.5.1
  • certifi ==2024.2.2
  • requests ==2.31.0
  • gunicorn ==22.0.0
  • flask ==3.0.3

  • Check this box to trigger a request for Renovate to run again on this repository

Job: add ability to cancel job

What is the expected behavior?

Job: add ability to cancel/stop job

Should be something like this

job = serverless.run_program(program)

job.stop() # or job.cancel()

Client: add `get_job_by_id` method

What is the expected enhancement?

Add get_job_by_id method to QuantumServerless object

Details

Currently when you execute run_job it will return a job object that you can query. We need to get job object by id to recover it in a case of you lost job variable

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository.

  • WARN: Job timeout
  • WARN: Worker exiting

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency requests to >=2.28.1
  • Update Terraform aws to >= 3.75.2
  • Update Terraform aws to >= 4.40.0
  • Update Terraform github.com/aws-ia/terraform-aws-eks-blueprints to v4.17.0
  • Update Terraform hashicorp/terraform to >= 1.3.5
  • Update Terraform ibm to >= 1.47.1
  • Update Terraform kubernetes to >= 2.16.0
  • Update dependency Flask to v2.2.2
  • Update dependency importlib-metadata to >=4.13.0
  • Update dependency qiskit-ibm-runtime to >=0.8.0
  • Update dependency qiskit-nature to >=0.5.1
  • Update dependency qiskit-terra to >=0.22.2
  • Update dependency ray to >=2.1.0, <3
  • Update dependency werkzeug to v2.2.2
  • Update lachlanevenson/k8s-kubectl Docker tag to v1.25.0
  • Update python Docker tag to v3.11
  • Update rayproject/ray Docker tag to v2.2.0
  • Update actions/checkout action to v3
  • Update actions/setup-python action to v3
  • Update actions/setup-python action to v4
  • Update actions/upload-artifact action to v3
  • Update dependency flask-restx to v1
  • Update dependency importlib-metadata to v5
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yml
dockerfile
infrastructure/docker/Dockerfile-notebook
infrastructure/docker/Dockerfile-ray-qiskit
  • rayproject/ray 2.1.0-py37
manager/Dockerfile
  • python 3.8-slim-buster
  • lachlanevenson/k8s-kubectl v1.10.3
github-actions
.github/workflows/client-pypi-release.yml
  • actions/checkout v2
  • actions/setup-python v2
  • actions/upload-artifact v2
.github/workflows/client-verify.yaml
  • actions/checkout v2
  • actions/setup-python v2
.github/workflows/docker-node-image.yml
  • actions/checkout v3
  • docker/login-action v2
  • docker/build-push-action v3
  • docker/build-push-action v3
  • docker/build-push-action v3
.github/workflows/docs.yml
  • actions/checkout v2
  • actions/setup-python v2
  • peaceiris/actions-gh-pages v3
.github/workflows/manager-verify.yaml
  • actions/checkout v2
  • actions/setup-python v2
.github/workflows/release-drafter.yml
  • release-drafter/release-drafter v5
helm-values
infrastructure/helm/quantumserverless/charts/jupyter/values.yaml
infrastructure/helm/quantumserverless/charts/manager/values.yaml
infrastructure/helm/quantumserverless/charts/operator/values.yaml
infrastructure/helm/quantumserverless/charts/ray-cluster/values.yaml
  • rayproject/ray 2.0.0
infrastructure/helm/quantumserverless/values.yaml
infrastructure/terraform/aws/values.yaml
infrastructure/terraform/ibm/values.yaml
pip_requirements
client/requirements.txt
  • ray >=2.0.0, <3
  • requests >=2.28.0
  • importlib-metadata >=4.12.0
  • qiskit-terra >=0.21.0
  • qiskit-nature >=0.4.4
  • qiskit-ibmq-provider >=0.19.2
  • qiskit-aer >=0.11.0
  • qiskit-ibm-runtime >=0.7.0
manager/requirements.txt
  • Flask ==2.1.3
  • flask-restx ==0.5.1
  • werkzeug ==2.1.2
terraform
infrastructure/terraform/aws/main.tf
  • github.com/aws-ia/terraform-aws-eks-blueprints v4.8.0
  • terraform-aws-modules/vpc/aws ~> 3.0
infrastructure/terraform/aws/versions.tf
  • hashicorp/terraform >= 1.0.0
  • aws >= 3.72
  • kubernetes >= 2.10
  • helm >= 2.4.1
infrastructure/terraform/ibm/cluster.tf
  • terraform-ibm-modules/cluster/ibm 1.5.0
infrastructure/terraform/ibm/main.tf
  • hashicorp/terraform ~> 1.2
  • ibm >= 1.46.0
  • helm >= 2.6.0
infrastructure/terraform/ibm/vpc.tf
  • terraform-ibm-modules/vpc/ibm 1.1.1

  • Check this box to trigger a request for Renovate to run again on this repository

Implement new interfaces

What is the expected enhancement?

Implement new interfaces

Init

import quantum_serverless as qs
from quantum_serverless import QuantumServeless

serverless = QuantumServerless()
# or
serverless = QuantumServerless(config)
# or
serverless = QuantumServerless().load_config(...)

Annotation

@qs.run_qiskit_remote(target={"cpus": 2})
def func(...):
    ...
serverless = QuantumServerless():
with serverless.provider("ibm"):
    remote_function_future = func(...)

Specify the version from notebook docker image

What is the expected behavior?

Now that we are going to start delivering infrastructure resources to users we should start closing a bit the versions related with the dependencies that we are using. In this case Jupyter notebook.

Dependencies monitoring process

What is the expected enhancement?

Quantum-Serverless has several dependencies that we are going to monitor in case new versions are published to maintain the project correctly updated.

Helm: remove ClusterRole from manager

What is the current behavior?

With the current helm configuration the manager chart is creating two kind of roles: ClusterRole and the default Role.

What is the expected behavior?

ClusterRole is no longer needed and can be removed from the configuration.

Client: ports configuration for QuantumServerless

What is the expected enhancement?

There are at least 2 types of ports we need to support:

  1. interactive (client) mode for 10001
  2. dashboard/jobs for 8265

We now only supporting one port for client mode

In compute resource setting we need to support both ports, but make them with default values.

Update docker-compose

What is the expected enhancement?

Update docker compose with notebook and head node for quick demonstrations.

Docs: update groundstate demo

What is the expected enhancement?

Update groundstate solver demo / tutorial to latest nature and to run locally on any estimator

Client: add support to get only finished jobs

What is the expected enhancement?

Add support for get for only finished jobs

Example

from quantum_serverless import get_finished

...

with serverless:
      refs = [run_something() for _ in range(50)]
      time.sleep(2)

      finished_after_2_secods = get_finished(refs)
      print(len(finished_after_2_secods))
# 19

Terraform helm configuration improvements

What is the expected enhancement?

In the terraform project we need to specify in the folder of each provider the values for the helm execution. Here we should review:

  • Unify naming:
    • IBM Cloud: terraform.yaml
    • AWS: values.yaml
  • Review values: it seems we are using old configurations to run the helm.

IBM Cloud Terraform configuration

What is the expected behavior?

For the project we need to provide to the user an initial configuration with what be able to start running things in different clouds.

With this issue we will provide the configuration for IBM Cloud.

Helm: fix default values file

Steps to reproduce the problem

Helm install with changing cluster values

What is the current behavior?

Not taking values into account

Solution

Fix typo in default values file.

High level of cluster configs should be ray-cluster, not cluster

Add integration tests

What is the expected enhancement?

Add integration tests for jobs.

This will require to setup of running head node inside docker container and testing functionality against actual running head node instead of local one.

Create events interface to notify actions

What is the expected enhancement?

Allow to quantum_serverless library implements a events-telemetry class to reuse between different programs that can run in different pods.

We can start with something simple (key, value), like:

quantum_serverless.events.notify(key, value) # Will be broadcast to all listeners listen by key
@quantum_serverless.events.listener(key) # Internally key will be the combination of env+key

Create a State middleware to reuse between programs

What is the expected enhancement?

Allow to quantum_serverless library implements a memory state class to reuse between different programs that can run in different pods.

We can start with something simple (key, value), like:

quantum_serverless.state.set(key, value) # Atomic operation
@quantum_serverless.state.get(key, value) # Internally k will be the combination of env+k, think about it

Github actions

Setup github actions to run tests for client and manager packages.

Notes: as this project in private at this moment we have constraints on actions time. Probably we need to think about how to reduce actions time, while maintaining code quality

Migrate from middleware to manager

What is the expected enhancement?

In the infrastructure project we have several references where we are using middleware where we should use manager.

Deprecated context usage

Steps to reproduce the problem

Run any computation within serverless context.

What is the current behavior?

Following deprecation warning appears

/home/ray/anaconda3/lib/python3.7/site-packages/ray/_private/worker.py:983: UserWarning: len(ctx) is deprecated. Use len(ctx.address_info) instead.',
 '  warnings.warn("len(ctx) is deprecated. Use len(ctx.address_info) instead.")

What is the expected behavior?

Should not raise deprecation warning.

How to fix suggestions?

Remove usage of Contex class in type hinting for QuantumServerless class.

Update docker images

What is the expected enhancement?

Update docker images for nodes, manager, jupyter

Migrate to kuberay api service

What is the expected enhancement?

Kuberay helm chart provides ApiService to manage ray clusters (CRUD).

We need to migrate to this helm chart and update client to work with those resources.

Issues in project:

Create new interface: Nested Programs

What is the expected behavior?

Create a new interface called NestedPrograms to allow encapsulate the run_qiskit_remote methods in a class to bring more powerful logic regarding to reuse/import/export the code in the near future.

The proposal can be something like:

# It will have all/by type default libraries imported

class NestedProgram (...): # To extend in your class# local parameters like visibility : ENUM …

	def __init__(…, env, options): # Options allowed to define the resources to usedef _import_program(…): # Code imported to run. From local/remote. Overwrittendef program(in: quantum_serverless.INPUT): # Code to run. Overwrittenreturn (quantum_serverless.OUTPUT) out

	@quantum_serverless.run_qiskit_remote(…)
	def run(…, options)�		…
		# Run the nested program in the secure and controlled environment
		output = self.program(…)
		…

Then, we can create workflows with the new interface, allowing something like

# Invoking Nested Programs

env = { ‘name’:’my_nested_environment_customized’, ’options’: { … } } # It can be a VAR ENV?

myProgram = new MyNestedProgram(env, …)
result_step_1 = myProgram.run(…)


myProgram2A = new NestedProgram(env, {‘from’: ‘cloud’, ‘origin’: ‘ENDPOINT’, ‘options’: { … } }))
future_result_2A = myProgram2A.runAsync(result_step_1)

myProgram2B = new NestedProgram(env, {‘from’: ‘cloud’, ‘origin’: ‘ENDPOINT’, ‘options’: { … } }))
future_result_2B = myProgram2B.runAsync(result_step_1)

[result_2A, result_2B] = quantum_serverless.get([future_result_2A, future_result_2B])

results_step_2  = combine_results_step2(result_2A, result_2B)


myProgram3 = new NestedProgram(env, {‘from’: ‘file’, ‘origin’ ‘PATH|URL’, ‘options’: {…}))
final_result = myProgram3.run(results_step_2)

GH Actions: release workflow

What is the expected behavior?

Setup GH actions workflow on release.

On release:

  • compile images
  • push images to IBM registry
  • build client
  • push to PyPi

Add dev and regular docker-compose files

What is the expected enhancement?

Split docker compose into 2 version:

  1. dev version which builds images from file and current project
  2. version with images from qiskit dockerhub with latest commit for user to play around

Something like this

Dev

services:
  jupyter:
    container_name: qs-jupyter
    build:
      context: ./
      dockerfile: infrastructure/docker/Dockerfile-notebook

Regular

services:
  jupyter:
    container_name: qs-jupyter
    image: qiskit/quantum-serverless-notebook:latest

Remove clusters in favor of compute resources

What is the expected enhancement?

Compute resources is a more general term and should be used instead of clusters.

QServerless object should have access to multiple providers and each provider should be able to have multiple compute resources.

Additional notes

Remove context, set_clusters, cluster, backends

Update to new Runtime package

What is the expected enhancement?

New version of runtime has been released yesterday and has some breaking changes.
Update to latest version and make sure everything works as expected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.