SlideShare a Scribd company logo
Total count for 00 and 11 are: {'00': 479, '11': 521}
┌───┐ ┌─┐
q_0: ┤ H ├──■──┤M├───
└───┘┌─┴─┐└╥┘┌─┐
q_1: ─────┤ X ├─╫─┤M├
└───┘ ║ └╥┘
c: 2/═══════════╩══╩═
0 1
import qiskit
import numpy as np
from qiskit import QuantumCircuit, transpile
from qiskit.providers.aer import QasmSimulator
from qiskit.visualization import plot_histogram
# Use Aer's qasm_simulator
simulator = QasmSimulator()
# Create a Quantum Circuit acting on the q register
circuit = QuantumCircuit(2, 2)
# Add a H gate on qubit 0
circuit.h(0)
# Add a CX (CNOT) gate on control qubit 0 and target qubit 1
circuit.cx(0, 1)
# Map the quantum measurement to the classical bits
circuit.measure([0,1], [0,1])
# compile the circuit down to low-level QASM instructions
# supported by the backend (not needed for simple circuits)
compiled_circuit = transpile(circuit, simulator)
# Execute the circuit on the qasm simulator
job = simulator.run(compiled_circuit, shots=1000)
# Grab results from the job
result = job.result()
# Returns counts
counts = result.get_counts(circuit)
print("nTotal count for 00 and 11 are:",counts)
# Draw the circuit
circuit.draw()
# Program developed by Bhadale IT, https://www.bhadaleit.com
Qubit http://localhost:8888/nbconvert/html/Qubit.ipynb?download=false
1 of 1 7/3/2021, 5:54 PM

More Related Content

PDF
Qsam simulator in IBM Quantum Lab cloud
PDF
Azure Quantum with IBM Qiskit and IonQ QPU
PDF
Hybrid quantum classical neural networks with pytorch and qiskit
PDF
Multi qubit entanglement
PDF
Single qubit-gates operations
PDF
CUDA Tutorial 01 : Say Hello to CUDA : Notes
PDF
Elasticsearch (R)Evolution — You Know, for Search… by Philipp Krenn at Big Da...
KEY
Grand centraldispatch
Qsam simulator in IBM Quantum Lab cloud
Azure Quantum with IBM Qiskit and IonQ QPU
Hybrid quantum classical neural networks with pytorch and qiskit
Multi qubit entanglement
Single qubit-gates operations
CUDA Tutorial 01 : Say Hello to CUDA : Notes
Elasticsearch (R)Evolution — You Know, for Search… by Philipp Krenn at Big Da...
Grand centraldispatch

What's hot (20)

PDF
Deathstar
PDF
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
PDF
Pre New Year Check of PostgreSQL
PDF
Microsoft Transcript VDMohire-2022
PPTX
Device status anomaly detection
PPTX
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
PDF
What is new with JavaScript in Gnome: The 2021 edition
PDF
Whats New in ASP.NET Core
ODP
Linux Cluster Job Management Systems (SGE)
PDF
Introduction to RevKit
PDF
The Ring programming language version 1.5.3 book - Part 72 of 184
PDF
Kapacitor Alert Topic handlers
PDF
JavaScriptCore's DFG JIT (JSConf EU 2012)
PDF
Arduino & node.js
PDF
The Ring programming language version 1.3 book - Part 45 of 88
PDF
Anton Moldovan "Load testing which you always wanted"
DOCX
C programs
PDF
Reversible Logic Synthesis and RevKit
PDF
The Ring programming language version 1.7 book - Part 67 of 196
PDF
The Ring programming language version 1.2 book - Part 44 of 84
Deathstar
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
Pre New Year Check of PostgreSQL
Microsoft Transcript VDMohire-2022
Device status anomaly detection
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
What is new with JavaScript in Gnome: The 2021 edition
Whats New in ASP.NET Core
Linux Cluster Job Management Systems (SGE)
Introduction to RevKit
The Ring programming language version 1.5.3 book - Part 72 of 184
Kapacitor Alert Topic handlers
JavaScriptCore's DFG JIT (JSConf EU 2012)
Arduino & node.js
The Ring programming language version 1.3 book - Part 45 of 88
Anton Moldovan "Load testing which you always wanted"
C programs
Reversible Logic Synthesis and RevKit
The Ring programming language version 1.7 book - Part 67 of 196
The Ring programming language version 1.2 book - Part 44 of 84
Ad

Similar to Quantum circuit example in Qiskit (20)

PDF
Quantum Computing Notes Ver 1.2
PDF
Quantum Computing Notes Ver1.0
PDF
Cryptanalysis with a Quantum Computer - An Exposition on Shor's Factoring Alg...
PDF
HiPEAC'19 Tutorial on Quantum algorithms using QX - 2019-01-23
PPT
Moore and mealy machines
PDF
QX Simulator and quantum programming - 2020-04-28
PPTX
Quantum Computing for app programmer
PDF
Probability of finding a single qubit in a state
PDF
What is quantum generative machine learning?
PPTX
A short introduction to Quantum Computing and Quantum Cryptography
PPTX
Quantum Computing Fundamentals via OO
PPTX
[Q-tangled 22] Deconstructing Quantum Machine Learning Algorithms - Sasha Laz...
PDF
Computazione quantistica con i fotoni -P. Mataloni
PPTX
What is Quantum Computing and Why it is Important
PPT
Matt Purkeypile's Doctoral Dissertation Defense Slides
PPT
Minimum Cost Fault Tolerant Adder Circuits in Reversible Logic Synthesis
PPT
2017 10 17_quantum_program_v2
PPT
2017 07 04_cmmse_quantum_programming_v1
PDF
This is presentation about quantum computing
PPTX
Lecture_2_v2_qc.pptx
Quantum Computing Notes Ver 1.2
Quantum Computing Notes Ver1.0
Cryptanalysis with a Quantum Computer - An Exposition on Shor's Factoring Alg...
HiPEAC'19 Tutorial on Quantum algorithms using QX - 2019-01-23
Moore and mealy machines
QX Simulator and quantum programming - 2020-04-28
Quantum Computing for app programmer
Probability of finding a single qubit in a state
What is quantum generative machine learning?
A short introduction to Quantum Computing and Quantum Cryptography
Quantum Computing Fundamentals via OO
[Q-tangled 22] Deconstructing Quantum Machine Learning Algorithms - Sasha Laz...
Computazione quantistica con i fotoni -P. Mataloni
What is Quantum Computing and Why it is Important
Matt Purkeypile's Doctoral Dissertation Defense Slides
Minimum Cost Fault Tolerant Adder Circuits in Reversible Logic Synthesis
2017 10 17_quantum_program_v2
2017 07 04_cmmse_quantum_programming_v1
This is presentation about quantum computing
Lecture_2_v2_qc.pptx
Ad

More from Vijayananda Mohire (20)

PDF
Bhadale QAI Hub - for multicloud, multitechnology platform
PDF
Practical_Introduction_to_Quantum_Safe_Cryptography
PDF
Progress Report- MIT Course 8.371.3x - VD-Mohire
PDF
Quantum Communications Q&A with Gemini LLM
PDF
Peer Review Certificate for Journal of Engg
PDF
Quantum Algorithms for Electronics - IEEE Certificate
PDF
NexGen Solutions for cloud platforms, powered by GenQAI
PDF
Certificate- Peer Review of Book Chapter on ML
PDF
Key projects Data Science and Engineering
PDF
Key projects Data Science and Engineering
PDF
Bhadale IT Hub-Multi Cloud and Multi QAI
PDF
My key hands-on projects in Quantum, and QAI
PDF
Azure Quantum Workspace for developing Q# based quantum circuits
PDF
Key projects in AI, ML and Generative AI
PDF
My Journey towards Artificial Intelligence
PDF
Bhadale IT Cloud Solutions for Agriculture
PDF
Bhadale IT Cloud Solutions for Agriculture
PDF
Bhadale IT Intel and Azure Cloud Offerings
PDF
GitHub Copilot-vijaymohire
PDF
Practical ChatGPT From Use Cases to Prompt Engineering & Ethical Implications
Bhadale QAI Hub - for multicloud, multitechnology platform
Practical_Introduction_to_Quantum_Safe_Cryptography
Progress Report- MIT Course 8.371.3x - VD-Mohire
Quantum Communications Q&A with Gemini LLM
Peer Review Certificate for Journal of Engg
Quantum Algorithms for Electronics - IEEE Certificate
NexGen Solutions for cloud platforms, powered by GenQAI
Certificate- Peer Review of Book Chapter on ML
Key projects Data Science and Engineering
Key projects Data Science and Engineering
Bhadale IT Hub-Multi Cloud and Multi QAI
My key hands-on projects in Quantum, and QAI
Azure Quantum Workspace for developing Q# based quantum circuits
Key projects in AI, ML and Generative AI
My Journey towards Artificial Intelligence
Bhadale IT Cloud Solutions for Agriculture
Bhadale IT Cloud Solutions for Agriculture
Bhadale IT Intel and Azure Cloud Offerings
GitHub Copilot-vijaymohire
Practical ChatGPT From Use Cases to Prompt Engineering & Ethical Implications

Recently uploaded (20)

PPTX
Machine Learning_overview_presentation.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Electronic commerce courselecture one. Pdf
PDF
Approach and Philosophy of On baking technology
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Encapsulation theory and applications.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Big Data Technologies - Introduction.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
Machine Learning_overview_presentation.pptx
cuic standard and advanced reporting.pdf
Chapter 3 Spatial Domain Image Processing.pdf
A comparative analysis of optical character recognition models for extracting...
NewMind AI Weekly Chronicles - August'25-Week II
Reach Out and Touch Someone: Haptics and Empathic Computing
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Review of recent advances in non-invasive hemoglobin estimation
Electronic commerce courselecture one. Pdf
Approach and Philosophy of On baking technology
sap open course for s4hana steps from ECC to s4
Encapsulation theory and applications.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Network Security Unit 5.pdf for BCA BBA.
Mobile App Security Testing_ A Comprehensive Guide.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Big Data Technologies - Introduction.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm

Quantum circuit example in Qiskit

  • 1. Total count for 00 and 11 are: {'00': 479, '11': 521} ┌───┐ ┌─┐ q_0: ┤ H ├──■──┤M├─── └───┘┌─┴─┐└╥┘┌─┐ q_1: ─────┤ X ├─╫─┤M├ └───┘ ║ └╥┘ c: 2/═══════════╩══╩═ 0 1 import qiskit import numpy as np from qiskit import QuantumCircuit, transpile from qiskit.providers.aer import QasmSimulator from qiskit.visualization import plot_histogram # Use Aer's qasm_simulator simulator = QasmSimulator() # Create a Quantum Circuit acting on the q register circuit = QuantumCircuit(2, 2) # Add a H gate on qubit 0 circuit.h(0) # Add a CX (CNOT) gate on control qubit 0 and target qubit 1 circuit.cx(0, 1) # Map the quantum measurement to the classical bits circuit.measure([0,1], [0,1]) # compile the circuit down to low-level QASM instructions # supported by the backend (not needed for simple circuits) compiled_circuit = transpile(circuit, simulator) # Execute the circuit on the qasm simulator job = simulator.run(compiled_circuit, shots=1000) # Grab results from the job result = job.result() # Returns counts counts = result.get_counts(circuit) print("nTotal count for 00 and 11 are:",counts) # Draw the circuit circuit.draw() # Program developed by Bhadale IT, https://www.bhadaleit.com Qubit http://localhost:8888/nbconvert/html/Qubit.ipynb?download=false 1 of 1 7/3/2021, 5:54 PM