Skip to content

Qiskit/qiskit-serverless

Stability License Code style: Black Python Qiskit

Qiskit Serverless

Qiskit Serverless is a user-friendly tool that enables you to easily run complex quantum computing tasks. With this software, you can execute Qiskit Functions as long running jobs and distribute them across multiple CPUs, GPUs, and QPUs. This means you can take on more complex quantum-classical programs and run them with ease. You don't have to worry about configuration or scaling up computational resources, as Qiskit Serverless takes care of everything for you.

diagram

Table of Contents

  1. Quickstart
    1. Using Docker
    2. Using Kubernetes
  2. Modules
    1. Client
    2. Gateway
    3. Charts
  3. How to Give Feedback
  4. Contribution Guidelines
  5. Deprecation Policy
  6. References and Acknowledgements
  7. License

Quickstart

This Quickstart section guides users to easily deploy Qiskit Serverless infrastructure and run a simple example.

Docker

For user convenience, this section assumes that users will deploy the infrastructure in a local environment using Docker following the next steps.

  1. Prepare local Qiskit Serverless infrastructure

    1. Install Docker You can use any runtime that you prefer to run Docker on your machine: Docker Desktop, podman... If you are using a MacOS with ARM processors we highly recommend to use Colima as your container runtime to avoid problems with that architecture.

      This is a project that takes advantage of distributed computing, so it places a high demand on resources. We recommend increasing the assigned resources to these runtimes. In case of Colima for example we typically use:

      colima start --cpu 4 --memory 8 --disk 100
    2. Install qiskit-serverless on your local system (we recommend using a virtual environment).

      pip install qiskit-serverless
    3. Clone the Qiskit Serverless repository

      git clone https://github.com/Qiskit/qiskit-serverless.git
    4. Run Qiskit Serverless infrastructure Execute Docker Compose using the following commands.

      cd qiskit-serverless/
      sudo docker compose up

      The output should resemble the following.

      ~/qiskit-serverless$ sudo docker compose --profile jupyter up
      [+] Running 5/0
       ✔ Network public-qiskit-serverless_safe-tier     Created                                           0.0s
       ✔ Container ray-head                              Created                                           0.0s
       ✔ Container public-qiskit-serverless-postgres-1  Created                                           0.0s
       ✔ Container gateway                               Created                                           0.0s
       ✔ Container scheduler                             Created                                           0.0s
      Attaching to gateway, public-qiskit-serverless-postgres-1, ray-head, scheduler
      
  2. Write your first Qiskit Function following our hello-world example in the tutorial section.

    That's all!

Kubernetes

For user convenience, this section assumes that users will deploy the infrastructure in a local environment using Kind following the next steps.

  1. Prepare local Qiskit Serverless infrastructure

    1. Install Docker You can use any runtime that you prefer to run Docker on your machine: Docker Desktop, podman... If you are using a MacOS with ARM processors we highly recommend to use Colima as your container runtime to avoid problems with that architecture.

      This is a project that takes advantage of distributed computing, so it places a high demand on resources. We recommend increasing the assigned resources to these runtimes. In case of Colima for example we typically use:

      colima start --cpu 4 --memory 8 --disk 100
    2. Install Kind To simplify the process to deploy a k8s cluster locally we use Kind as the main tool to create a cluster.

    3. Install qiskit-serverless on your local system (we recommend using a virtual environment).

      pip install qiskit-serverless
    4. Clone the Qiskit Serverless repository

      git clone https://github.com/Qiskit/qiskit-serverless.git
    5. Run Qiskit Serverless infrastructure Execute the script to setup the cluster

      tox -e cluster-deploy

      The creation process can take some minutes.

  2. Write your first Qiskit Function following our hello-world example in the tutorial section.

    That's all!

For more detailed examples and explanations refer to the Guide:

  1. Getting Started
  2. Example Qiskit Functions
  3. Infrastructure
  4. Migrating from Qiskit Runtime programs

How to Give Feedback

We encourage your feedback! You can share your thoughts with us by:

  • Opening an issue in the repository

Contribution Guidelines

For information on how to contribute to this project, please take a look at our contribution guidelines.


Deprecation Policy

This project is meant to evolve rapidly and, as such, do not follow Qiskit's deprecation policy. We may occasionally make breaking changes in order to improve the user experience. When possible, we will keep old interfaces and mark them as deprecated, as long as they can co-exist with the new ones. Each substantial improvement, breaking change, or deprecation will be documented in release notes.


References and Acknowledgements

[1] Qiskit
https://github.com/Qiskit/qiskit

[2] Client for IBM Qiskit Runtime
https://github.com/Qiskit/qiskit-ibm-runtime


License

Apache License 2.0