SlideShare a Scribd company logo
1 of 9
Download to read offline
Azure Quantum
Prepared By: Vijayananda Mohire
Prerequisites:
To start developing Q# based quantum circuits, follow the below provided links. If will need an Azure
subscription either a free one or institute subscription to Login to Azure portal.
Steps:
Once you have your Azure subscription ready, please log into Azure portal, you will find your Dashboard
as shown below.
Now you will need to create a Quantum Workspace, please refer links below
https://docs.microsoft.com/en-us/azure/quantum/how-to-create-workspace
https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.Quantum%2
FWorkspaces
You will encounter few of these screens for storage provisioning
Select your subscription and created storage account
After storage is selected you will now need a target platform to execute your Q# code. You may select
any provider from below. This step is optional and can be added later on. I have selected IonQ
Finally preview your project details and Click on Create button as shown below
Confirm the deployment has been succeeded
You will now see your project listed in your Dashboard. Click on the project link that will take you to the
project IDE . Here we will use the Notebooks menu as shown below
We will now start working with the Jupyter Notebooks with Q# as Kernel. You can instead select
Python.
Use this link for more details. https://docs.microsoft.com/en-us/azure/quantum/get-started-jupyter-
notebook
Below is the sample of notebook imported into the Quantum workspace and the resulting results
after executing the code. Please follow the instruction and obtain the results
Quantum Computing on Azure Quantum
with Q# and Jupyter Notebook:
Parallel QRNG
This notebook demonstrates how to execute a Q# program on Azure Quantum.
Define Q# operations
The quickest way to define a Q# operation in a Q# Jupyter Notebook is to simply write the Q#
code directly into a notebook cell and execute it. Note that for convenience, the
Microsoft.Quantum.Canon and Microsoft.Quantum.Intrinsic namespaces are
automatically opened in every cell.
[2]
open Microsoft.Quantum.Arrays;
open Microsoft.Quantum.Measurement;
operation SampleRandomNumber(nQubits : Int) : Result[] {
// We prepare a register of qubits in a uniform
// superposition state, such that when we measure,
// all bitstrings occur with equal probability.
use register = Qubit[nQubits] {
// Set qubits in superposition.
ApplyToEachA(H, register);
// Measure all qubits and return.
return ForEach(MResetZ, register);
}
}
 SampleRandomNumber
You can also write your Q# code in .qs files which are in the same folder as the .ipynb notebook.
Running %workspace reload will recompile all such .qs files and report the list of available Q#
operations and functions. In this case, it finds an operation called SampleRandomNumber in a
namespace called Microsoft.Quantum.AzureSamples.
[3]
%workspace reload
Reloading workspace: done!
Using %simulate, you can invoke the built-in Q# functionality to simulate a quantum operation
locally and return the result. You can specify any operation that has been defined in the notebook
or that has been imported from a .qs file.
[4]
%simulate SampleRandomNumber nQubits=3
 Zero
 One
 Zero
Executing Q# operations in Azure Quantum
First, find the resource ID of your Azure Quantum workspace. You can copy/paste this from the
top-right corner of your Quantum Workspace page in Azure Portal.
Next, you can run %azure.connect to connect to the workspace and display the list of
provisioned targets that support execution of Q# programs. If you are prompted to login, be sure
to use the same account you used to create your Azure Quantum workspace.
[7]
%azure.connect "/subscriptions/c684880b-e981-4b8f-9baf-
742935e59228/resourceGroups/cloud-shell-storage-
centralindia/providers/Microsoft.Quantum/Workspaces/quantumproj" location="eastus"
2 sec
Authenticated using
Microsoft.Azure.Quantum.Authentication.TokenFileCredential
Connected to Azure Quantum workspace quantumproj in location eastus.
Target ID Current Availability Average Queue Time (Seconds)
ionq.qpu Available 158
ionq.simulator Available 3
Now, use %azure.target to specify the target you'd like to use for job submission.
[8]
%azure.target ionq.simulator
38 sec
Loading package Microsoft.Quantum.Providers.IonQ and dependencies...
Active target is now ionq.simulator
Target ID Current Availability Average Queue Time (Seconds)
ionq.simulator Available 3
To submit a job, use %azure.submit along with the Q# operation name and any parameters
required by that operation. The %azure.submit command will return immediately after the job
is created. Alternatively, you can use %azure.execute, which will submit the job and wait for it
to complete.
[9]
%azure.submit SampleRandomNumber nQubits=3
9 sec
Submitting SampleRandomNumber to target ionq.simulator...
Job successfully submitted for 500 shots.
Job name: SampleRandomNumber
Job ID: 5f1afaa2-25ea-437d-b305-fe1fa94e479e
Job Name Job ID
Job
Status
Target
Creation
Time
Begin
Execution
Time
End
Execution
Time
SampleRandomNumber
5f1afaa2-25ea-
437d-b305-
fe1fa94e479e
Waiting ionq.simulator
01/14/2022
07:27:34
+00:00
Running %azure.status will display the status of the most recently submitted job in this
session. If you want to check the status of a different job, provide the job ID to %azure.status.
[10]
%azure.status
4 sec
Job Name Job ID Job Status Target
Creation
Time
Begin
Execution
Time
End
Execution
Time
SampleRandomNumber
5f1afaa2-
25ea-437d-
b305-
fe1fa94e479e
Succeeded ionq.simulator
01/14/2022
07:27:34
+00:00
01/14/2022
07:27:40
+00:00
01/14/2022
07:27:40
+00:00
Once the job has completed, use %azure.output to display the result. Again, you can provide a
job ID to %azure.output if you want to display the status of a specific job.
[11]
%azure.output
2 sec
You can also view the status of all jobs by using %azure.jobs. Providing a parameter to this
command will filter to just the jobs containing that string. For example, you can query for the
status of all jobs named Microsoft.Quantum.AzureSamples.SampleRandomNumber.
[12]
%azure.jobs SampleRandomNumber
1 sec
Job Name Job ID Job Status Target
Creation
Time
Begin
Execution
Time
End
Execution
Time
SampleRandomNumber
5f1afaa2-
25ea-437d-
b305-
fe1fa94e479e
Succeeded ionq.simulator
01/14/2022
07:27:34
+00:00
01/14/2022
07:27:40
+00:00
01/14/2022
07:27:40
+00:00

More Related Content

Similar to Azure Quantum Workspace for developing Q# based quantum circuits

Machine learning at scale with aws sage maker
Machine learning at scale with aws sage makerMachine learning at scale with aws sage maker
Machine learning at scale with aws sage makerPhilipBasford
 
DevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless ArchitectureDevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless ArchitectureMikhail Prudnikov
 
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agentsPVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agentsAndrey Karpov
 
Hands-on Lab: Migrating Oracle to PostgreSQL
Hands-on Lab: Migrating Oracle to PostgreSQL Hands-on Lab: Migrating Oracle to PostgreSQL
Hands-on Lab: Migrating Oracle to PostgreSQL Amazon Web Services
 
PVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOpsPVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOpsAndrey Karpov
 
Testing Microservices
Testing MicroservicesTesting Microservices
Testing MicroservicesAnil Allewar
 
Building an HPC Cluster in 10 Minutes
Building an HPC Cluster in 10 MinutesBuilding an HPC Cluster in 10 Minutes
Building an HPC Cluster in 10 MinutesMonica Rut Avellino
 
Build containerized application using Docker and Azure.pdf
Build containerized application using Docker and Azure.pdfBuild containerized application using Docker and Azure.pdf
Build containerized application using Docker and Azure.pdfHamida Rebai Trabelsi
 
Automated shutdown
Automated shutdownAutomated shutdown
Automated shutdownMario Berend
 
AWS ML Model Deployment
AWS ML Model DeploymentAWS ML Model Deployment
AWS ML Model DeploymentKnoldus Inc.
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3kognate
 
Qtp 9.2 examples
Qtp 9.2 examplesQtp 9.2 examples
Qtp 9.2 examplesmedsherb
 
CloudOps CloudStack Budapest, 2014
CloudOps CloudStack Budapest, 2014CloudOps CloudStack Budapest, 2014
CloudOps CloudStack Budapest, 2014CloudOps2005
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JSBipin
 
The Ring programming language version 1.2 book - Part 51 of 84
The Ring programming language version 1.2 book - Part 51 of 84The Ring programming language version 1.2 book - Part 51 of 84
The Ring programming language version 1.2 book - Part 51 of 84Mahmoud Samir Fayed
 
Divide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.jsDivide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.jsSebastian Springer
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 introTerry Cho
 
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...Andrey Karpov
 

Similar to Azure Quantum Workspace for developing Q# based quantum circuits (20)

Machine learning at scale with aws sage maker
Machine learning at scale with aws sage makerMachine learning at scale with aws sage maker
Machine learning at scale with aws sage maker
 
DevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless ArchitectureDevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless Architecture
 
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agentsPVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
 
Hands-on Lab: Migrating Oracle to PostgreSQL
Hands-on Lab: Migrating Oracle to PostgreSQL Hands-on Lab: Migrating Oracle to PostgreSQL
Hands-on Lab: Migrating Oracle to PostgreSQL
 
PVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOpsPVS-Studio in the Clouds: Azure DevOps
PVS-Studio in the Clouds: Azure DevOps
 
Azure from scratch part 4
Azure from scratch part 4Azure from scratch part 4
Azure from scratch part 4
 
Testing Microservices
Testing MicroservicesTesting Microservices
Testing Microservices
 
Building an HPC Cluster in 10 Minutes
Building an HPC Cluster in 10 MinutesBuilding an HPC Cluster in 10 Minutes
Building an HPC Cluster in 10 Minutes
 
Build containerized application using Docker and Azure.pdf
Build containerized application using Docker and Azure.pdfBuild containerized application using Docker and Azure.pdf
Build containerized application using Docker and Azure.pdf
 
Automated shutdown
Automated shutdownAutomated shutdown
Automated shutdown
 
AWS ML Model Deployment
AWS ML Model DeploymentAWS ML Model Deployment
AWS ML Model Deployment
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3
 
Qtp 9.2 examples
Qtp 9.2 examplesQtp 9.2 examples
Qtp 9.2 examples
 
CloudOps CloudStack Budapest, 2014
CloudOps CloudStack Budapest, 2014CloudOps CloudStack Budapest, 2014
CloudOps CloudStack Budapest, 2014
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JS
 
The Ring programming language version 1.2 book - Part 51 of 84
The Ring programming language version 1.2 book - Part 51 of 84The Ring programming language version 1.2 book - Part 51 of 84
The Ring programming language version 1.2 book - Part 51 of 84
 
Divide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.jsDivide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.js
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 
QSpiders - Simple Recording and Configuration of recording options for HP Loa...
QSpiders - Simple Recording and Configuration of recording options for HP Loa...QSpiders - Simple Recording and Configuration of recording options for HP Loa...
QSpiders - Simple Recording and Configuration of recording options for HP Loa...
 
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
 

More from Vijayananda Mohire

Certificate- Peer Review of Book Chapter on ML
Certificate- Peer Review of Book Chapter on MLCertificate- Peer Review of Book Chapter on ML
Certificate- Peer Review of Book Chapter on MLVijayananda Mohire
 
Key projects Data Science and Engineering
Key projects Data Science and EngineeringKey projects Data Science and Engineering
Key projects Data Science and EngineeringVijayananda Mohire
 
Key projects Data Science and Engineering
Key projects Data Science and EngineeringKey projects Data Science and Engineering
Key projects Data Science and EngineeringVijayananda Mohire
 
Bhadale IT Hub-Multi Cloud and Multi QAI
Bhadale IT Hub-Multi Cloud and Multi QAIBhadale IT Hub-Multi Cloud and Multi QAI
Bhadale IT Hub-Multi Cloud and Multi QAIVijayananda Mohire
 
My key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIMy key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIVijayananda Mohire
 
Key projects in AI, ML and Generative AI
Key projects in AI, ML and Generative AIKey projects in AI, ML and Generative AI
Key projects in AI, ML and Generative AIVijayananda Mohire
 
My Journey towards Artificial Intelligence
My Journey towards Artificial IntelligenceMy Journey towards Artificial Intelligence
My Journey towards Artificial IntelligenceVijayananda Mohire
 
Bhadale IT Cloud Solutions for Agriculture
Bhadale IT Cloud Solutions for AgricultureBhadale IT Cloud Solutions for Agriculture
Bhadale IT Cloud Solutions for AgricultureVijayananda Mohire
 
Bhadale IT Cloud Solutions for Agriculture
Bhadale IT Cloud Solutions for AgricultureBhadale IT Cloud Solutions for Agriculture
Bhadale IT Cloud Solutions for AgricultureVijayananda Mohire
 
Bhadale IT Intel and Azure Cloud Offerings
Bhadale IT Intel and Azure Cloud OfferingsBhadale IT Intel and Azure Cloud Offerings
Bhadale IT Intel and Azure Cloud OfferingsVijayananda Mohire
 
Practical ChatGPT From Use Cases to Prompt Engineering & Ethical Implications
Practical ChatGPT From Use Cases to Prompt Engineering & Ethical ImplicationsPractical ChatGPT From Use Cases to Prompt Engineering & Ethical Implications
Practical ChatGPT From Use Cases to Prompt Engineering & Ethical ImplicationsVijayananda Mohire
 
Cloud Infrastructure - Partner Delivery Accelerator (APAC)
Cloud Infrastructure - Partner Delivery Accelerator (APAC)Cloud Infrastructure - Partner Delivery Accelerator (APAC)
Cloud Infrastructure - Partner Delivery Accelerator (APAC)Vijayananda Mohire
 
Red Hat Sales Specialist - Red Hat Enterprise Linux
Red Hat Sales Specialist - Red Hat Enterprise LinuxRed Hat Sales Specialist - Red Hat Enterprise Linux
Red Hat Sales Specialist - Red Hat Enterprise LinuxVijayananda Mohire
 
Generative AI Business Transformation
Generative AI Business TransformationGenerative AI Business Transformation
Generative AI Business TransformationVijayananda Mohire
 
Microsoft Learn Transcript Jan 2024- vijaymohire
Microsoft Learn Transcript Jan 2024- vijaymohireMicrosoft Learn Transcript Jan 2024- vijaymohire
Microsoft Learn Transcript Jan 2024- vijaymohireVijayananda Mohire
 
Bhadale Group of Companies -Futuristic Products Brief-Ver 1.0
Bhadale Group of Companies -Futuristic Products Brief-Ver 1.0Bhadale Group of Companies -Futuristic Products Brief-Ver 1.0
Bhadale Group of Companies -Futuristic Products Brief-Ver 1.0Vijayananda Mohire
 
Intel Partnership - Gold Member - 2024
Intel Partnership - Gold Member - 2024Intel Partnership - Gold Member - 2024
Intel Partnership - Gold Member - 2024Vijayananda Mohire
 
Bhadale Group of Companies -Defense Academy Ver. 2.0
Bhadale Group of Companies -Defense Academy Ver. 2.0Bhadale Group of Companies -Defense Academy Ver. 2.0
Bhadale Group of Companies -Defense Academy Ver. 2.0Vijayananda Mohire
 

More from Vijayananda Mohire (20)

Certificate- Peer Review of Book Chapter on ML
Certificate- Peer Review of Book Chapter on MLCertificate- Peer Review of Book Chapter on ML
Certificate- Peer Review of Book Chapter on ML
 
Key projects Data Science and Engineering
Key projects Data Science and EngineeringKey projects Data Science and Engineering
Key projects Data Science and Engineering
 
Key projects Data Science and Engineering
Key projects Data Science and EngineeringKey projects Data Science and Engineering
Key projects Data Science and Engineering
 
Bhadale IT Hub-Multi Cloud and Multi QAI
Bhadale IT Hub-Multi Cloud and Multi QAIBhadale IT Hub-Multi Cloud and Multi QAI
Bhadale IT Hub-Multi Cloud and Multi QAI
 
My key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIMy key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAI
 
Key projects in AI, ML and Generative AI
Key projects in AI, ML and Generative AIKey projects in AI, ML and Generative AI
Key projects in AI, ML and Generative AI
 
My Journey towards Artificial Intelligence
My Journey towards Artificial IntelligenceMy Journey towards Artificial Intelligence
My Journey towards Artificial Intelligence
 
Bhadale IT Cloud Solutions for Agriculture
Bhadale IT Cloud Solutions for AgricultureBhadale IT Cloud Solutions for Agriculture
Bhadale IT Cloud Solutions for Agriculture
 
Bhadale IT Cloud Solutions for Agriculture
Bhadale IT Cloud Solutions for AgricultureBhadale IT Cloud Solutions for Agriculture
Bhadale IT Cloud Solutions for Agriculture
 
Bhadale IT Intel and Azure Cloud Offerings
Bhadale IT Intel and Azure Cloud OfferingsBhadale IT Intel and Azure Cloud Offerings
Bhadale IT Intel and Azure Cloud Offerings
 
GitHub Copilot-vijaymohire
GitHub Copilot-vijaymohireGitHub Copilot-vijaymohire
GitHub Copilot-vijaymohire
 
Practical ChatGPT From Use Cases to Prompt Engineering & Ethical Implications
Practical ChatGPT From Use Cases to Prompt Engineering & Ethical ImplicationsPractical ChatGPT From Use Cases to Prompt Engineering & Ethical Implications
Practical ChatGPT From Use Cases to Prompt Engineering & Ethical Implications
 
Cloud Infrastructure - Partner Delivery Accelerator (APAC)
Cloud Infrastructure - Partner Delivery Accelerator (APAC)Cloud Infrastructure - Partner Delivery Accelerator (APAC)
Cloud Infrastructure - Partner Delivery Accelerator (APAC)
 
Red Hat Sales Specialist - Red Hat Enterprise Linux
Red Hat Sales Specialist - Red Hat Enterprise LinuxRed Hat Sales Specialist - Red Hat Enterprise Linux
Red Hat Sales Specialist - Red Hat Enterprise Linux
 
RedHat_Transcript_Jan_2024
RedHat_Transcript_Jan_2024RedHat_Transcript_Jan_2024
RedHat_Transcript_Jan_2024
 
Generative AI Business Transformation
Generative AI Business TransformationGenerative AI Business Transformation
Generative AI Business Transformation
 
Microsoft Learn Transcript Jan 2024- vijaymohire
Microsoft Learn Transcript Jan 2024- vijaymohireMicrosoft Learn Transcript Jan 2024- vijaymohire
Microsoft Learn Transcript Jan 2024- vijaymohire
 
Bhadale Group of Companies -Futuristic Products Brief-Ver 1.0
Bhadale Group of Companies -Futuristic Products Brief-Ver 1.0Bhadale Group of Companies -Futuristic Products Brief-Ver 1.0
Bhadale Group of Companies -Futuristic Products Brief-Ver 1.0
 
Intel Partnership - Gold Member - 2024
Intel Partnership - Gold Member - 2024Intel Partnership - Gold Member - 2024
Intel Partnership - Gold Member - 2024
 
Bhadale Group of Companies -Defense Academy Ver. 2.0
Bhadale Group of Companies -Defense Academy Ver. 2.0Bhadale Group of Companies -Defense Academy Ver. 2.0
Bhadale Group of Companies -Defense Academy Ver. 2.0
 

Recently uploaded

Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 

Recently uploaded (20)

Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 

Azure Quantum Workspace for developing Q# based quantum circuits

  • 1. Azure Quantum Prepared By: Vijayananda Mohire Prerequisites: To start developing Q# based quantum circuits, follow the below provided links. If will need an Azure subscription either a free one or institute subscription to Login to Azure portal. Steps: Once you have your Azure subscription ready, please log into Azure portal, you will find your Dashboard as shown below. Now you will need to create a Quantum Workspace, please refer links below https://docs.microsoft.com/en-us/azure/quantum/how-to-create-workspace https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.Quantum%2 FWorkspaces You will encounter few of these screens for storage provisioning
  • 2. Select your subscription and created storage account After storage is selected you will now need a target platform to execute your Q# code. You may select any provider from below. This step is optional and can be added later on. I have selected IonQ
  • 3. Finally preview your project details and Click on Create button as shown below Confirm the deployment has been succeeded
  • 4. You will now see your project listed in your Dashboard. Click on the project link that will take you to the project IDE . Here we will use the Notebooks menu as shown below
  • 5. We will now start working with the Jupyter Notebooks with Q# as Kernel. You can instead select Python. Use this link for more details. https://docs.microsoft.com/en-us/azure/quantum/get-started-jupyter- notebook Below is the sample of notebook imported into the Quantum workspace and the resulting results after executing the code. Please follow the instruction and obtain the results Quantum Computing on Azure Quantum with Q# and Jupyter Notebook: Parallel QRNG This notebook demonstrates how to execute a Q# program on Azure Quantum. Define Q# operations The quickest way to define a Q# operation in a Q# Jupyter Notebook is to simply write the Q# code directly into a notebook cell and execute it. Note that for convenience, the Microsoft.Quantum.Canon and Microsoft.Quantum.Intrinsic namespaces are automatically opened in every cell. [2] open Microsoft.Quantum.Arrays; open Microsoft.Quantum.Measurement;
  • 6. operation SampleRandomNumber(nQubits : Int) : Result[] { // We prepare a register of qubits in a uniform // superposition state, such that when we measure, // all bitstrings occur with equal probability. use register = Qubit[nQubits] { // Set qubits in superposition. ApplyToEachA(H, register); // Measure all qubits and return. return ForEach(MResetZ, register); } }  SampleRandomNumber You can also write your Q# code in .qs files which are in the same folder as the .ipynb notebook. Running %workspace reload will recompile all such .qs files and report the list of available Q# operations and functions. In this case, it finds an operation called SampleRandomNumber in a namespace called Microsoft.Quantum.AzureSamples. [3] %workspace reload Reloading workspace: done! Using %simulate, you can invoke the built-in Q# functionality to simulate a quantum operation locally and return the result. You can specify any operation that has been defined in the notebook or that has been imported from a .qs file. [4] %simulate SampleRandomNumber nQubits=3  Zero  One  Zero Executing Q# operations in Azure Quantum First, find the resource ID of your Azure Quantum workspace. You can copy/paste this from the top-right corner of your Quantum Workspace page in Azure Portal. Next, you can run %azure.connect to connect to the workspace and display the list of provisioned targets that support execution of Q# programs. If you are prompted to login, be sure to use the same account you used to create your Azure Quantum workspace. [7]
  • 7. %azure.connect "/subscriptions/c684880b-e981-4b8f-9baf- 742935e59228/resourceGroups/cloud-shell-storage- centralindia/providers/Microsoft.Quantum/Workspaces/quantumproj" location="eastus" 2 sec Authenticated using Microsoft.Azure.Quantum.Authentication.TokenFileCredential Connected to Azure Quantum workspace quantumproj in location eastus. Target ID Current Availability Average Queue Time (Seconds) ionq.qpu Available 158 ionq.simulator Available 3 Now, use %azure.target to specify the target you'd like to use for job submission. [8] %azure.target ionq.simulator 38 sec Loading package Microsoft.Quantum.Providers.IonQ and dependencies... Active target is now ionq.simulator Target ID Current Availability Average Queue Time (Seconds) ionq.simulator Available 3 To submit a job, use %azure.submit along with the Q# operation name and any parameters required by that operation. The %azure.submit command will return immediately after the job is created. Alternatively, you can use %azure.execute, which will submit the job and wait for it to complete. [9] %azure.submit SampleRandomNumber nQubits=3 9 sec Submitting SampleRandomNumber to target ionq.simulator... Job successfully submitted for 500 shots. Job name: SampleRandomNumber Job ID: 5f1afaa2-25ea-437d-b305-fe1fa94e479e
  • 8. Job Name Job ID Job Status Target Creation Time Begin Execution Time End Execution Time SampleRandomNumber 5f1afaa2-25ea- 437d-b305- fe1fa94e479e Waiting ionq.simulator 01/14/2022 07:27:34 +00:00 Running %azure.status will display the status of the most recently submitted job in this session. If you want to check the status of a different job, provide the job ID to %azure.status. [10] %azure.status 4 sec Job Name Job ID Job Status Target Creation Time Begin Execution Time End Execution Time SampleRandomNumber 5f1afaa2- 25ea-437d- b305- fe1fa94e479e Succeeded ionq.simulator 01/14/2022 07:27:34 +00:00 01/14/2022 07:27:40 +00:00 01/14/2022 07:27:40 +00:00 Once the job has completed, use %azure.output to display the result. Again, you can provide a job ID to %azure.output if you want to display the status of a specific job. [11] %azure.output 2 sec
  • 9. You can also view the status of all jobs by using %azure.jobs. Providing a parameter to this command will filter to just the jobs containing that string. For example, you can query for the status of all jobs named Microsoft.Quantum.AzureSamples.SampleRandomNumber. [12] %azure.jobs SampleRandomNumber 1 sec Job Name Job ID Job Status Target Creation Time Begin Execution Time End Execution Time SampleRandomNumber 5f1afaa2- 25ea-437d- b305- fe1fa94e479e Succeeded ionq.simulator 01/14/2022 07:27:34 +00:00 01/14/2022 07:27:40 +00:00 01/14/2022 07:27:40 +00:00