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.
- Quickstart
- Modules
- How to Give Feedback
- Contribution Guidelines
- Deprecation Policy
- References and Acknowledgements
- License
This Quickstart section guides users to easily deploy Qiskit Serverless infrastructure and run a simple example.
For user convenience, this section assumes that users will deploy the infrastructure in a local environment using Docker following the next steps.
-
Prepare local Qiskit Serverless infrastructure
-
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
-
Install qiskit-serverless on your local system (we recommend using a virtual environment).
pip install qiskit-serverless
-
Clone the Qiskit Serverless repository
git clone https://github.com/Qiskit/qiskit-serverless.git
-
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
-
-
Write your first Qiskit Function following our hello-world example in the tutorial section.
That's all!
For user convenience, this section assumes that users will deploy the infrastructure in a local environment using Kind following the next steps.
-
Prepare local Qiskit Serverless infrastructure
-
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
-
Install Kind To simplify the process to deploy a k8s cluster locally we use Kind as the main tool to create a cluster.
-
Install qiskit-serverless on your local system (we recommend using a virtual environment).
pip install qiskit-serverless
-
Clone the Qiskit Serverless repository
git clone https://github.com/Qiskit/qiskit-serverless.git
-
Run Qiskit Serverless infrastructure Execute the script to setup the cluster
tox -e cluster-deploy
The creation process can take some minutes.
-
-
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:
We encourage your feedback! You can share your thoughts with us by:
- Opening an issue in the repository
For information on how to contribute to this project, please take a look at our contribution guidelines.
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.
[1] Qiskit
https://github.com/Qiskit/qiskit
[2] Client for IBM Qiskit Runtime
https://github.com/Qiskit/qiskit-ibm-runtime