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 1 commit
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": "Qiskit Quantum Computing on OpenShift"
}
]
}
49 changes: 49 additions & 0 deletions quantum-computing/qiskit/01-installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<br>

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

Insert the value of the account token into the secret.cfg file.

``vi deploy/secret.cfg``{{execute}}

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}}
13 changes: 13 additions & 0 deletions quantum-computing/qiskit/02-exploring-the-deploy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<br>

## The notebook is found on 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. Click on the url for "example-qiskitplayground" under "Location"
6. Run the sample notebooks
5 changes: 5 additions & 0 deletions quantum-computing/qiskit/03-example-workload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<br>

## 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
9 changes: 9 additions & 0 deletions quantum-computing/qiskit/04-intro-ocp-ibm-quantum-operator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<br>

# Introduction

## 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.

For getting started guides, installation, deployment and test OpenShift IBM quantum operator follow next steps.
49 changes: 49 additions & 0 deletions quantum-computing/qiskit/05-installation-ocp-ibm-quantum-op.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<br>

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-ibm-quantum-operator/operator/``{{execute}}

## Use/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_ibmqes_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

Insert the value of the account token into the secret.cfg file.

``vi deploy/secret.cfg``{{execute}}

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 apply -f deploy/crds/singhp11.io_v1_ibmqe_cr.yaml``{{execute}}
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.
1 change: 1 addition & 0 deletions quantum-computing/qiskit/finish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
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)
64 changes: 64 additions & 0 deletions quantum-computing/qiskit/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"icon": "fa-openshift",
"title": "Qiskit Quantum Computing on OpenShift (OpenShift 4.4)",
"description": "",
"pathwayTitle": "OpenShift",
"difficulty": "advanced",
"time": "60 minutes",
"backend": {
"imageid": "openshift-4-4"
},
"environment": {
"showdashboard": true,
"dashboards": [
{
"name": "Console",
"href": "https://console-openshift-console-[[HOST_SUBDOMAIN]]-443-[[KATACODA_HOST]].environments.katacoda.com"
}
],
"uilayout": "terminal-iframe"
},
"details": {
"steps": [
{
"title": "Installation",
"text": "01-installation.md"
},
{
"title": "Step 2 - Exploring the Deployment",
"text": "02-exploring-the-deploy.md"
},
{
"title": "Step 3 - Example workload",
"text": "03-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/"
}
]
}
}
}
11 changes: 11 additions & 0 deletions quantum-computing/qiskit/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Goal

This lab will allow you to test how you can integrate quantum workloads in OpenShift.

## Concepts

* Jupyter Notebook
* Qiskit

## Requirement
You will need to create an account at 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