Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quantum on learn.openshift.com #882

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions quantum-computing-pathway.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"title": "Quantum computing on OpenShift",
"icon": "fa-openshift",
"courses": [
{
"external_link": "https://learn.openshift.com/quantum-computing/qiskit/",
"course_id": "qiskit",
"title": "Quantum Computing on OpenShift using Qiskit"
}
]
}
54 changes: 54 additions & 0 deletions quantum-computing/qiskit/01-installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Getting started

This installation method will use the latest version of the operator image that has been built and published to quay.

<!-- ``cd openshift-quantum-operators/operators-examples/openshift-qiskit-operator/operator``{{execute}} -->

## Create a project

Create a new project
``oc new-project quantum-katacoda``{{execute}}

<!-- ## Custom Resource Definition

Deploy the custom resource definition (CRD)
``oc create -f deploy/crds/singhp11.io_qiskitplaygrounds_crd.yaml``{{execute}}

## Deploy the RBAC configuration:

``oc apply -f deploy/role.yaml``{{execute}}
``oc apply -f deploy/service_account.yaml``{{execute}}
``oc apply -f deploy/role_binding.yaml``{{execute}} -->

## Setting up authorization with IBMQ Account token

Navigate to secret.cfg in the katacoda built in editor and insert the value of the account token into the secret.cfg file.

NOTE: Use the token provided to you at https://quantum-computing.ibm.com/account.

```
[AUTH TOKENS]
token = your_IBMQ_account_token
```

## Create the secret

``oc create secret generic qiskit-secret --from-file=qiskit-secret.cfg=deploy/secret.cfg``{{execute}}

## Deploy the operator itself

``oc apply -f deploy/operator.yaml``{{execute}}

## Wait for the operator pod deployment to complete

``oc get pods -w``{{execute}}

NOTE: When the pods are running enter Ctrl+c

## Deploy an instance of the custom resource

``oc create -f deploy/crds/singhp11.io_v1_qiskitplayground_cr.yaml``{{execute}}

## The notebook is found on the exposed route

``oc get routes -w``{{execute}}
3 changes: 3 additions & 0 deletions quantum-computing/qiskit/02-example-workload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test the Jupyter Notebook

Explore quantum circuits [following](https://qiskit.org/documentation/tutorials/circuits/1_getting_started_with_qiskit.html) or run any of the sample notebook attached with the operator.
13 changes: 13 additions & 0 deletions quantum-computing/qiskit/06-exploring-the-deploy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<br>

## Accessing the serving system
OpenShift IBM Quantum circuit serving system can be accessed using the exposed route
``oc get routes -w``{{execute}}

## Accessing the notebook

1. Click on "Console" in the right hand top bar
2. Click on "Projects" and search for "quantum-katacoda"
3. Click on "quantum-katacoda" to land on the project dashboard
4. Click on "Networking -> Routes" on the left hand side panel
5. The url for "ibmqe" is under "Location"
10 changes: 10 additions & 0 deletions quantum-computing/qiskit/assets/configure-scenario.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
echo "Cloning git repository"

git clone https://github.com/qiskit-community/openshift-quantum-operators.git openshift-quantum-operators &> /dev/null
cd openshift-quantum-operators/ &> /dev/null

echo "Git clone complete and OpenShift Ready ...."

export PS1="$ "
stty echo
Empty file.
25 changes: 25 additions & 0 deletions quantum-computing/qiskit/finish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Additional Resources

Thank you for trying the playground. For individual exercises on using OpenShift, see the home page of our [OpenShift interactive learning portal](https://learn.openshift.com)

## Code repository

* [Code repository](https://github.com/qiskit-community/openshift-quantum-operators)

## Find the operators on OperatorHub.io

* [OpenShift Qiskit Operator](https://operatorhub.io/operator/openshift-qiskit-operator)
* [OpenShift IBM Quantum Operator](https://operatorhub.io/operator/ibm-quantum-operator)

## Documentaion

* [OpenShift Qiskit Operator](https://github.com/qiskit-community/openshift-quantum-operators/tree/master/operators-examples/openshift-qiskit-operator)
* [OpenShift IBM Quantum Operator](https://github.com/qiskit-community/openshift-quantum-operators/tree/master/operators-examples/openshift-ibm-quantum-operator)

## Contributing

You can contribute by

* Raising any [issues](https://github.com/qiskit-community/openshift-quantum-operators/issues) you find using openshift-ibm-quantum-operator and openshift-qiskit-operator
* Fixing issues by opening [Pull Requests](https://github.com/qiskit-community/openshift-quantum-operators/pulls)
* Talking about the operators
63 changes: 63 additions & 0 deletions quantum-computing/qiskit/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"icon": "fa-openshift",
"title": "Quantum Computing on OpenShift using Qiskit(OpenShift 4.5)",
"description": "Implement quantum circuits using Qiskit SDK on OpenShift",
"pathwayTitle": "OpenShift",
"difficulty": "intermediate",
"time": "60 minutes",
"backend": {
"imageid": "openshift-4-5"
},
"environment": {
"uilayout": "editor-terminal",
"uisettings": "javascript",
"uieditorpath": "/root/openshift-quantum-operators/operators-examples/openshift-qiskit-operator/",
"showdashboard": true,
"hideintro": false,
"dashboards": [
{
"name": "Console",
"href": "https://console-openshift-console-[[HOST_SUBDOMAIN]]-443-[[KATACODA_HOST]].environments.katacoda.com"
}
]
},
"details": {
"steps": [
{
"title": "Installation",
"text": "01-installation.md"
},
{
"title": "Step 2 - Example workload",
"text": "02-example-workload.md"
},
{
"title": "Step 4 - Introduction to OpenShift IBM Quantum Operator",
"text": "04-intro-ocp-ibm-quantum-operator.md"
},
{
"title": "Step 5 - Installing OpenShift IBM Quantum Operator",
"text": "05-installation-ocp-ibm-quantum-op.md"
},
{
"title": "Step 6 - Testing IBM Quantum Operator",
"text": "06-exploring-the-deploy.md"
}
],
"intro": {
"code": "set-env.sh",
"text": "intro.md"
},
"finish": {
"text": "finish.md"
},
"assets": {
"client": [
{
"file": "configure-scenario.sh",
"target": "/var/tmp/"
}
]
}
}
}
36 changes: 36 additions & 0 deletions quantum-computing/qiskit/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# What will you learn

This lab will allow you to test how you can integrate quantum workloads in OpenShift. It provides a development environment to implement quantum algorithms and runs them on IBM quantum computers or simulators. The scenarios will introduce two operators namely, OpenShift Qiskit operator and OpenShift IBM quantum operator.

## Qiskit

Qiskit [quiss-kit] is an open source SDK for working with quantum computers at the level of pulses, circuits and algorithms.

## IBM Quantum Experience

IBM Quantum Experience is quantum on the cloud. With IBM Quantum Experience you can

* put quantum to work by running experiments on IBM Q systems and simulators available to the public and IBM Q Network
* develop, deploy and explore quantum applications in areas such as chemistry, optimization, finance, and AI
* stay informed and contribute to the future of quantum. Be part of the largest quantum community

## OpenShift Qiskit Operator

Operator sets up QiskitPlayground for implementing quantum circuits.

QiskitPlayground is a [Jupyter Notebook](https://jupyter.org/) with the qiskit libraries enabled for implementing quantum circuits. It comes with pre installed python packages for visualising results. QiskitPlayground can run the quantum circuits on simulator or on real quantum machines using [IBMQ Account](https://quantum-computing.ibm.com/).

To run on real quantum backend, QiskitPlayground reads the IBM Q account API token from a secret file mounted on the QiskitPlayground pod.

## OpenShift IBM Quantum Operator

OpenShift IBM quantum operator creates a flexible serving system for quantum circuits implemented in Qiskit. You can submit quantum workloads implemented in Qiskit which are executed on IBM Quantum Experience. Workloads are executed as pods, orchestrated and managed by Kube APIs.

## Concepts

* Jupyter Notebook
* Qiskit

## Requirement

You will need to create an account [here](https://quantum-computing.ibm.com/) once the account has been created. Go to the [account menu](https://quantum-computing.ibm.com/account) and copy the token as it will be used during installation.
9 changes: 9 additions & 0 deletions quantum-computing/qiskit/set-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

echo "Initializing..."
stty -echo
clear
until $(ls /var/tmp/configure-scenario.sh &> /dev/null); do (echo -n .; sleep 2); done;
clear
stty echo
/bin/bash /var/tmp/configure-scenario.sh