SlideShare une entreprise Scribd logo
1  sur  13
Télécharger pour lire hors ligne
Azure Quantum with IBM Qiskit and IonQ QPU
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
//
Getting started with Qiskit and IonQ on
Azure Quantum
This notebook shows how to send a basic quantum circuit expressed using the Qiskit library to
an IonQ target via the Azure Quantum service.
First, import the required packages for this sample:
from qiskit import QuantumCircuit
from qiskit.visualization import plot_histogram
from qiskit.tools.monitor import job_monitor
from azure.quantum.qiskit import AzureQuantumProvider
Connecting to the Azure Quantum service
To connect to the Azure Quantum service, use the AzureQuantumProvider constructor to create
a provider object that connects to your Azure Quantum workspace. This will use your
workspace's resource ID and location.
from azure.quantum.qiskit import AzureQuantumProvider
provider = AzureQuantumProvider (
resource_id = "/subscriptions/c684880b-e981-4b8f-9baf-
742935e59228/resourceGroups/cloud-shell-storage-
centralindia/providers/Microsoft.Quantum/Workspaces/quantumproj",
location = "eastus"
)
Use provider.backends to see what targets are currently available. Running this method will trigger
authentication to your Microsoft account, if you're not already logged in.
print([backend.name() for backend in provider.backends()])
['ionq.qpu', 'ionq.simulator']
Run a simple circuit
Let's create a simple Qiskit circuit to run.
This notebook assumes some familiarity with Qiskit. To read more about Qiskit, review the
Qiskit documentation.
# Create a Quantum Circuit acting on the q register
circuit = QuantumCircuit(3, 3)
circuit.name = "Qiskit Sample - 3-qubit GHZ circuit"
circuit.h(0)
circuit.cx(0, 1)
circuit.cx(1, 2)
circuit.measure([0,1,2], [0, 1, 2])
# Print out the circuit
circuit.draw()
┌───┐ ┌─┐
q_0: ┤ H ├──■───────┤M├──────
└───┘┌─┴─┐ └╥┘┌─┐
q_1: ─────┤ X ├──■───╫─┤M├───
└───┘┌─┴─┐ ║ └╥┘┌─┐
q_2: ──────────┤ X ├─╫──╫─┤M├
└───┘ ║ ║ └╥┘
c: 3/════════════════╩══╩══╩═
0 1 2
To get a result back quickly, use provider.get_backend to create a Backend
object to connect to the IonQ Simulator back-end:
simulator_backend = provider.get_backend("ionq.simulator")
You can now run the program via the Azure Quantum service and get the result.
The following cell will submit a job that runs the circuit with 100 shots:
job = simulator_backend.run(circuit, shots=100)
job_id = job.id()
print("Job id", job_id)
Job id 4a40a692-7835-11ec-91ff-00155d14b93c
To monitor job progress, we can use the Qiskit job_monitor we imported
earlier to keep track of the Job's status. Note that this call will block
until the job completes:
job_monitor(job)
Job Status: job has successfully run
To wait until the job is completed and return the results, run:
result = job.result()
This returns a qiskit.Result object.
type(result)
qiskit.result.result.Result
print(result)
Result(backend_name='ionq.simulator', backend_version='1', qobj_id='Qiskit
Sample - 3-qubit GHZ circuit', job_id='4a40a692-7835-11ec-91ff-00155d14b93c',
success=True, results=[ExperimentResult(shots=100, success=True,
meas_level=2, data=ExperimentResultData(counts={'000': 50, '111': 50},
probabilities={'000': 0.5, '111': 0.5}),
header=QobjExperimentHeader(meas_map='[0, 1, 2]', name='Qiskit Sample - 3-
qubit GHZ circuit', num_qubits='3', qiskit='True'))])
Because this is an object native to the Qiskit package, we can use Qiskit's
result.get_counts and plot_histogram to visualize the results. The results
can return a sparse dictionary so to make sure all possible bitstring lables
are represented we add them to counts
# The histogram returned by the results can be sparse, so here we add any of the miss
ing bitstring labels.
counts = {format(n, "03b"): 0 for n in range(8)}
counts.update(result.get_counts(circuit))
print(counts)
plot_histogram(counts)
{'000': 50, '001': 0, '010': 0, '011': 0, '100': 0, '101': 0, '110': 0,
'111': 50}
Run on IonQ QPU
To connect to real hardware (Quantum Processing Unit or QPU), simply provide the name of the
target "ionq.qpu" to the provider.get_backend method:
qpu_backend = provider.get_backend("ionq.qpu")
Submit the circuit to run on Azure Quantum. Note that depending on queue times this may take a
while to run!
Here we will again use the job_monitor to keep track of the job status, and plot_histogram to
plot the results.
# Submit the circuit to run on Azure Quantum
qpu_job = qpu_backend.run(circuit, shots=1024)
job_id = qpu_job.id()
print("Job id", job_id)
# Monitor job progress and wait until complete:
job_monitor(qpu_job)
# Get the job results (this method also waits for the Job to complete):
result = qpu_job.result()
print(result)
counts = {format(n, "03b"): 0 for n in range(8)}
counts.update(result.get_counts(circuit))
print(counts)
plot_histogram(counts)
Job id 94fac0be-7835-11ec-91ff-00155d14b93c Job Status: job has successfully
run Result(backend_name='ionq.qpu', backend_version='1', qobj_id='Qiskit
Sample - 3-qubit GHZ circuit', job_id='94fac0be-7835-11ec-91ff-00155d14b93c',
success=True, results=[ExperimentResult(shots=1024, success=True,
meas_level=2, data=ExperimentResultData(counts={'000': 446, '001': 16, '010':
16, '011': 21, '100': 11, '101': 13, '110': 30, '111': 471},
probabilities={'000': 0.435546875, '001': 0.015625, '010': 0.015625, '011':
0.0205078125, '100': 0.0107421875, '101': 0.0126953125, '110': 0.029296875,
'111': 0.4599609375}), header=QobjExperimentHeader(meas_map='[0, 1, 2]',
name='Qiskit Sample - 3-qubit GHZ circuit', num_qubits='3', qiskit='True'))])
{'000': 446, '001': 16, '010': 16, '011': 21, '100': 11, '101': 13, '110':
30, '111': 471}
# Print package versions used in this notebook
import qiskit
print('n'.join(f'{m.__name__}=={m.__version__}' for m in globals().values() if getat
tr(m, '__version__', None)))
qiskit==0.18.3
------------------------------------------------------------------------------------------------------------------------------
Disclaimer: Copyrights and all training material are owned by Microsoft Azure Quantum. We at
Bhadale IT have executed the Q# code and used IonQ hardware. No intention for any copyright
infringements. For educational purpose only

Contenu connexe

Tendances

Part 1: ng-grid and a Simple REST API
Part 1: ng-grid and a Simple REST APIPart 1: ng-grid and a Simple REST API
Part 1: ng-grid and a Simple REST APIreneechemel
 
Grand centraldispatch
Grand centraldispatchGrand centraldispatch
Grand centraldispatchYuumi Yoshida
 
Device status anomaly detection
Device status anomaly detectionDevice status anomaly detection
Device status anomaly detectionDavid Tung
 
Spark with kubernates
Spark with kubernatesSpark with kubernates
Spark with kubernatesDavid Tung
 
CUDA by Example : Thread Cooperation : Notes
CUDA by Example : Thread Cooperation : NotesCUDA by Example : Thread Cooperation : Notes
CUDA by Example : Thread Cooperation : NotesSubhajit Sahu
 
Integrating cloud stack with puppet
Integrating cloud stack with puppetIntegrating cloud stack with puppet
Integrating cloud stack with puppetPuppet
 
[212] large scale backend service develpment
[212] large scale backend service develpment[212] large scale backend service develpment
[212] large scale backend service develpmentNAVER D2
 
Effective Modern C++ - Item 35 & 36
Effective Modern C++ - Item 35 & 36Effective Modern C++ - Item 35 & 36
Effective Modern C++ - Item 35 & 36Chih-Hsuan Kuo
 
Whats New in ASP.NET Core
Whats New in ASP.NET CoreWhats New in ASP.NET Core
Whats New in ASP.NET CoreJon Galloway
 
The Ring programming language version 1.10 book - Part 72 of 212
The Ring programming language version 1.10 book - Part 72 of 212The Ring programming language version 1.10 book - Part 72 of 212
The Ring programming language version 1.10 book - Part 72 of 212Mahmoud Samir Fayed
 
Use C++ to Manipulate mozSettings in Gecko
Use C++ to Manipulate mozSettings in GeckoUse C++ to Manipulate mozSettings in Gecko
Use C++ to Manipulate mozSettings in GeckoChih-Hsuan Kuo
 
Pre New Year Check of PostgreSQL
Pre New Year Check of PostgreSQLPre New Year Check of PostgreSQL
Pre New Year Check of PostgreSQLAndrey Karpov
 
The Ring programming language version 1.5.3 book - Part 72 of 184
The Ring programming language version 1.5.3 book - Part 72 of 184The Ring programming language version 1.5.3 book - Part 72 of 184
The Ring programming language version 1.5.3 book - Part 72 of 184Mahmoud Samir Fayed
 
Protocol handler in Gecko
Protocol handler in GeckoProtocol handler in Gecko
Protocol handler in GeckoChih-Hsuan Kuo
 
"Ускорение сборки большого проекта на Objective-C + Swift" Иван Бондарь (Avito)
"Ускорение сборки большого проекта на Objective-C + Swift" Иван Бондарь (Avito)"Ускорение сборки большого проекта на Objective-C + Swift" Иван Бондарь (Avito)
"Ускорение сборки большого проекта на Objective-C + Swift" Иван Бондарь (Avito)AvitoTech
 
Ownership System in Rust
Ownership System in RustOwnership System in Rust
Ownership System in RustChih-Hsuan Kuo
 
OpenCVとPCLでのRealSenseのサポート状況+α
OpenCVとPCLでのRealSenseのサポート状況+αOpenCVとPCLでのRealSenseのサポート状況+α
OpenCVとPCLでのRealSenseのサポート状況+αTsukasa Sugiura
 
The Ring programming language version 1.7 book - Part 67 of 196
The Ring programming language version 1.7 book - Part 67 of 196The Ring programming language version 1.7 book - Part 67 of 196
The Ring programming language version 1.7 book - Part 67 of 196Mahmoud Samir Fayed
 
Whatthestack using Tempest for testing your OpenStack deployment
Whatthestack using Tempest for testing your OpenStack deploymentWhatthestack using Tempest for testing your OpenStack deployment
Whatthestack using Tempest for testing your OpenStack deploymentChristian Schwede
 

Tendances (19)

Part 1: ng-grid and a Simple REST API
Part 1: ng-grid and a Simple REST APIPart 1: ng-grid and a Simple REST API
Part 1: ng-grid and a Simple REST API
 
Grand centraldispatch
Grand centraldispatchGrand centraldispatch
Grand centraldispatch
 
Device status anomaly detection
Device status anomaly detectionDevice status anomaly detection
Device status anomaly detection
 
Spark with kubernates
Spark with kubernatesSpark with kubernates
Spark with kubernates
 
CUDA by Example : Thread Cooperation : Notes
CUDA by Example : Thread Cooperation : NotesCUDA by Example : Thread Cooperation : Notes
CUDA by Example : Thread Cooperation : Notes
 
Integrating cloud stack with puppet
Integrating cloud stack with puppetIntegrating cloud stack with puppet
Integrating cloud stack with puppet
 
[212] large scale backend service develpment
[212] large scale backend service develpment[212] large scale backend service develpment
[212] large scale backend service develpment
 
Effective Modern C++ - Item 35 & 36
Effective Modern C++ - Item 35 & 36Effective Modern C++ - Item 35 & 36
Effective Modern C++ - Item 35 & 36
 
Whats New in ASP.NET Core
Whats New in ASP.NET CoreWhats New in ASP.NET Core
Whats New in ASP.NET Core
 
The Ring programming language version 1.10 book - Part 72 of 212
The Ring programming language version 1.10 book - Part 72 of 212The Ring programming language version 1.10 book - Part 72 of 212
The Ring programming language version 1.10 book - Part 72 of 212
 
Use C++ to Manipulate mozSettings in Gecko
Use C++ to Manipulate mozSettings in GeckoUse C++ to Manipulate mozSettings in Gecko
Use C++ to Manipulate mozSettings in Gecko
 
Pre New Year Check of PostgreSQL
Pre New Year Check of PostgreSQLPre New Year Check of PostgreSQL
Pre New Year Check of PostgreSQL
 
The Ring programming language version 1.5.3 book - Part 72 of 184
The Ring programming language version 1.5.3 book - Part 72 of 184The Ring programming language version 1.5.3 book - Part 72 of 184
The Ring programming language version 1.5.3 book - Part 72 of 184
 
Protocol handler in Gecko
Protocol handler in GeckoProtocol handler in Gecko
Protocol handler in Gecko
 
"Ускорение сборки большого проекта на Objective-C + Swift" Иван Бондарь (Avito)
"Ускорение сборки большого проекта на Objective-C + Swift" Иван Бондарь (Avito)"Ускорение сборки большого проекта на Objective-C + Swift" Иван Бондарь (Avito)
"Ускорение сборки большого проекта на Objective-C + Swift" Иван Бондарь (Avito)
 
Ownership System in Rust
Ownership System in RustOwnership System in Rust
Ownership System in Rust
 
OpenCVとPCLでのRealSenseのサポート状況+α
OpenCVとPCLでのRealSenseのサポート状況+αOpenCVとPCLでのRealSenseのサポート状況+α
OpenCVとPCLでのRealSenseのサポート状況+α
 
The Ring programming language version 1.7 book - Part 67 of 196
The Ring programming language version 1.7 book - Part 67 of 196The Ring programming language version 1.7 book - Part 67 of 196
The Ring programming language version 1.7 book - Part 67 of 196
 
Whatthestack using Tempest for testing your OpenStack deployment
Whatthestack using Tempest for testing your OpenStack deploymentWhatthestack using Tempest for testing your OpenStack deployment
Whatthestack using Tempest for testing your OpenStack deployment
 

Similaire à Azure Quantum with IBM Qiskit and IonQ QPU

Azure Quantum Workspace for developing Q# based quantum circuits
Azure Quantum Workspace for developing Q# based quantum circuitsAzure Quantum Workspace for developing Q# based quantum circuits
Azure Quantum Workspace for developing Q# based quantum circuitsVijayananda Mohire
 
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdfDevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdfKAI CHU CHUNG
 
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
 
Phil Basford - machine learning at scale with aws sage maker
Phil Basford - machine learning at scale with aws sage makerPhil Basford - machine learning at scale with aws sage maker
Phil Basford - machine learning at scale with aws sage makerAWSCOMSUM
 
Session 3 - CloudStack Test Automation and CI
Session 3 - CloudStack Test Automation and CISession 3 - CloudStack Test Automation and CI
Session 3 - CloudStack Test Automation and CItcloudcomputing-tw
 
CloudOps CloudStack Budapest, 2014
CloudOps CloudStack Budapest, 2014CloudOps CloudStack Budapest, 2014
CloudOps CloudStack Budapest, 2014CloudOps2005
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platformnirajrules
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceBen Hall
 
Azure machine learning service
Azure machine learning serviceAzure machine learning service
Azure machine learning serviceRuth Yakubu
 
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
 
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
 
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
 
Okd wg kubecon marathon azure & vsphere
Okd wg kubecon marathon azure & vsphereOkd wg kubecon marathon azure & vsphere
Okd wg kubecon marathon azure & vsphereWalid Shaari
 
Managing Large-scale Networks with Trigger
Managing Large-scale Networks with TriggerManaging Large-scale Networks with Trigger
Managing Large-scale Networks with Triggerjathanism
 
Monitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaMonitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaArvind Kumar G.S
 
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
 

Similaire à Azure Quantum with IBM Qiskit and IonQ QPU (20)

Azure Quantum Workspace for developing Q# based quantum circuits
Azure Quantum Workspace for developing Q# based quantum circuitsAzure Quantum Workspace for developing Q# based quantum circuits
Azure Quantum Workspace for developing Q# based quantum circuits
 
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdfDevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
 
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
 
Phil Basford - machine learning at scale with aws sage maker
Phil Basford - machine learning at scale with aws sage makerPhil Basford - machine learning at scale with aws sage maker
Phil Basford - machine learning at scale with aws sage maker
 
Session 3 - CloudStack Test Automation and CI
Session 3 - CloudStack Test Automation and CISession 3 - CloudStack Test Automation and CI
Session 3 - CloudStack Test Automation and CI
 
CloudOps CloudStack Budapest, 2014
CloudOps CloudStack Budapest, 2014CloudOps CloudStack Budapest, 2014
CloudOps CloudStack Budapest, 2014
 
Azure from scratch part 4
Azure from scratch part 4Azure from scratch part 4
Azure from scratch part 4
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container Service
 
Azure machine learning service
Azure machine learning serviceAzure machine learning service
Azure machine learning service
 
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
 
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
 
Big Data Tools in AWS
Big Data Tools in AWSBig Data Tools in AWS
Big Data Tools in AWS
 
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...
 
Okd wg kubecon marathon azure & vsphere
Okd wg kubecon marathon azure & vsphereOkd wg kubecon marathon azure & vsphere
Okd wg kubecon marathon azure & vsphere
 
Managing Large-scale Networks with Trigger
Managing Large-scale Networks with TriggerManaging Large-scale Networks with Trigger
Managing Large-scale Networks with Trigger
 
Monitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaMonitoring using Prometheus and Grafana
Monitoring using Prometheus and Grafana
 
Grover's Algorithm
Grover's AlgorithmGrover's Algorithm
Grover's Algorithm
 
Corba 2
Corba 2Corba 2
Corba 2
 
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
 

Plus de Vijayananda Mohire

NexGen Solutions for cloud platforms, powered by GenQAI
NexGen Solutions for cloud platforms, powered by GenQAINexGen Solutions for cloud platforms, powered by GenQAI
NexGen Solutions for cloud platforms, powered by GenQAIVijayananda 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
 

Plus de Vijayananda Mohire (20)

NexGen Solutions for cloud platforms, powered by GenQAI
NexGen Solutions for cloud platforms, powered by GenQAINexGen Solutions for cloud platforms, powered by GenQAI
NexGen Solutions for cloud platforms, powered by GenQAI
 
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
 

Dernier

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Dernier (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Azure Quantum with IBM Qiskit and IonQ QPU

  • 1. Azure Quantum with IBM Qiskit and IonQ QPU 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 // Getting started with Qiskit and IonQ on Azure Quantum This notebook shows how to send a basic quantum circuit expressed using the Qiskit library to an IonQ target via the Azure Quantum service. First, import the required packages for this sample: from qiskit import QuantumCircuit from qiskit.visualization import plot_histogram from qiskit.tools.monitor import job_monitor from azure.quantum.qiskit import AzureQuantumProvider Connecting to the Azure Quantum service To connect to the Azure Quantum service, use the AzureQuantumProvider constructor to create a provider object that connects to your Azure Quantum workspace. This will use your workspace's resource ID and location. from azure.quantum.qiskit import AzureQuantumProvider provider = AzureQuantumProvider ( resource_id = "/subscriptions/c684880b-e981-4b8f-9baf- 742935e59228/resourceGroups/cloud-shell-storage- centralindia/providers/Microsoft.Quantum/Workspaces/quantumproj",
  • 10. location = "eastus" ) Use provider.backends to see what targets are currently available. Running this method will trigger authentication to your Microsoft account, if you're not already logged in. print([backend.name() for backend in provider.backends()]) ['ionq.qpu', 'ionq.simulator'] Run a simple circuit Let's create a simple Qiskit circuit to run. This notebook assumes some familiarity with Qiskit. To read more about Qiskit, review the Qiskit documentation. # Create a Quantum Circuit acting on the q register circuit = QuantumCircuit(3, 3) circuit.name = "Qiskit Sample - 3-qubit GHZ circuit" circuit.h(0) circuit.cx(0, 1) circuit.cx(1, 2) circuit.measure([0,1,2], [0, 1, 2]) # Print out the circuit circuit.draw() ┌───┐ ┌─┐ q_0: ┤ H ├──■───────┤M├────── └───┘┌─┴─┐ └╥┘┌─┐ q_1: ─────┤ X ├──■───╫─┤M├─── └───┘┌─┴─┐ ║ └╥┘┌─┐ q_2: ──────────┤ X ├─╫──╫─┤M├ └───┘ ║ ║ └╥┘ c: 3/════════════════╩══╩══╩═ 0 1 2 To get a result back quickly, use provider.get_backend to create a Backend object to connect to the IonQ Simulator back-end: simulator_backend = provider.get_backend("ionq.simulator") You can now run the program via the Azure Quantum service and get the result. The following cell will submit a job that runs the circuit with 100 shots: job = simulator_backend.run(circuit, shots=100) job_id = job.id() print("Job id", job_id) Job id 4a40a692-7835-11ec-91ff-00155d14b93c
  • 11. To monitor job progress, we can use the Qiskit job_monitor we imported earlier to keep track of the Job's status. Note that this call will block until the job completes: job_monitor(job) Job Status: job has successfully run To wait until the job is completed and return the results, run: result = job.result() This returns a qiskit.Result object. type(result) qiskit.result.result.Result print(result) Result(backend_name='ionq.simulator', backend_version='1', qobj_id='Qiskit Sample - 3-qubit GHZ circuit', job_id='4a40a692-7835-11ec-91ff-00155d14b93c', success=True, results=[ExperimentResult(shots=100, success=True, meas_level=2, data=ExperimentResultData(counts={'000': 50, '111': 50}, probabilities={'000': 0.5, '111': 0.5}), header=QobjExperimentHeader(meas_map='[0, 1, 2]', name='Qiskit Sample - 3- qubit GHZ circuit', num_qubits='3', qiskit='True'))]) Because this is an object native to the Qiskit package, we can use Qiskit's result.get_counts and plot_histogram to visualize the results. The results can return a sparse dictionary so to make sure all possible bitstring lables are represented we add them to counts # The histogram returned by the results can be sparse, so here we add any of the miss ing bitstring labels. counts = {format(n, "03b"): 0 for n in range(8)} counts.update(result.get_counts(circuit)) print(counts) plot_histogram(counts) {'000': 50, '001': 0, '010': 0, '011': 0, '100': 0, '101': 0, '110': 0, '111': 50}
  • 12. Run on IonQ QPU To connect to real hardware (Quantum Processing Unit or QPU), simply provide the name of the target "ionq.qpu" to the provider.get_backend method: qpu_backend = provider.get_backend("ionq.qpu") Submit the circuit to run on Azure Quantum. Note that depending on queue times this may take a while to run! Here we will again use the job_monitor to keep track of the job status, and plot_histogram to plot the results. # Submit the circuit to run on Azure Quantum qpu_job = qpu_backend.run(circuit, shots=1024) job_id = qpu_job.id() print("Job id", job_id) # Monitor job progress and wait until complete: job_monitor(qpu_job) # Get the job results (this method also waits for the Job to complete): result = qpu_job.result() print(result) counts = {format(n, "03b"): 0 for n in range(8)} counts.update(result.get_counts(circuit)) print(counts) plot_histogram(counts) Job id 94fac0be-7835-11ec-91ff-00155d14b93c Job Status: job has successfully run Result(backend_name='ionq.qpu', backend_version='1', qobj_id='Qiskit Sample - 3-qubit GHZ circuit', job_id='94fac0be-7835-11ec-91ff-00155d14b93c', success=True, results=[ExperimentResult(shots=1024, success=True, meas_level=2, data=ExperimentResultData(counts={'000': 446, '001': 16, '010': 16, '011': 21, '100': 11, '101': 13, '110': 30, '111': 471}, probabilities={'000': 0.435546875, '001': 0.015625, '010': 0.015625, '011': 0.0205078125, '100': 0.0107421875, '101': 0.0126953125, '110': 0.029296875, '111': 0.4599609375}), header=QobjExperimentHeader(meas_map='[0, 1, 2]', name='Qiskit Sample - 3-qubit GHZ circuit', num_qubits='3', qiskit='True'))]) {'000': 446, '001': 16, '010': 16, '011': 21, '100': 11, '101': 13, '110': 30, '111': 471}
  • 13. # Print package versions used in this notebook import qiskit print('n'.join(f'{m.__name__}=={m.__version__}' for m in globals().values() if getat tr(m, '__version__', None))) qiskit==0.18.3 ------------------------------------------------------------------------------------------------------------------------------ Disclaimer: Copyrights and all training material are owned by Microsoft Azure Quantum. We at Bhadale IT have executed the Q# code and used IonQ hardware. No intention for any copyright infringements. For educational purpose only