Quantum Computing For Beginners
Quantum Computing For Beginners
examples, and carefully structured chapters, these notes aim to guide readers from the
basics of qubits and quantum states to advanced topics such as error correction and
ay
quantum programming, fostering a strong foundation for future study and exploration in
Ud
quantum computing.
© 2025 Uday Patil. All rights reserved.
til
No part of this publication may be reproduced, distributed, or transmitted in any form
Pa
or by any means, without the prior written permission of the author, except as
permitted by copyright law.
ay
This Notes is a work of educational and informational content intended for learning purposes.
The author disclaim all liability for any direct or indirect damages arising from use of the
material herein.
Quantum Computing Notes 2
Contents
1 Chapter 1: Introduction 5
1.1 What is Quantum Computing? . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Why Do We Need Quantum Computing? . . . . . . . . . . . . . . . . . . 5
1.3 Summary Table: Classical vs Quantum Computing . . . . . . . . . . . . 6
5 Quantum Algorithms 16
5.1 Introduction to Quantum Algorithms . . . . . . . . . . . . . . . . . . . . 16
Quantum Computing Notes 3
7 Quantum Programming 22
Ud
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.2 Quantum Programming Languages and Platforms . . . . . . . . . . . . . 22
7.3 Building a Quantum Program . . . . . . . . . . . . . . . . . . . . . . . . 22
7.4 Basic Example (Pseudocode using Qiskit Syntax) . . . . . . . . . . . . . 22
7.5 Visualization of Quantum Circuits . . . . . . . . . . . . . . . . . . . . . . 23
7.6 Simulators and Cloud Access . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.7 Programming Quantum Algorithms . . . . . . . . . . . . . . . . . . . . . 23
7.8 Challenges in Quantum Programming . . . . . . . . . . . . . . . . . . . . 23
7.9 Best Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
7.10 Summary Table: Popular Quantum Programming Tools . . . . . . . . . . 24
7.11 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
12 Practice Problems 37
Quantum Computing Notes 5
1 Chapter 1: Introduction
1.1 What is Quantum Computing?
Quantum computing is a new kind of computation that uses the laws of quantum mechan-
ics to process information. Unlike classical computers, which use bits that are either 0 or
1, quantum computers use qubits, which can be in a state of 0, 1, or both simultaneously
thanks to a property known as superposition.
A qubit can be mathematically described as
where α and β are complex numbers such that |α|2 + |β|2 = 1. When measured, the qubit
collapses to the state |0⟩ with probability |α|2 or to |1⟩ with probability |β|2 .
Quantum computers exploit this and other quantum phenomena like entanglement
and interference to perform computations in ways classical computers cannot.
their computational power scales linearly with resources. Quantum computers promise
to overcome some of these limitations by leveraging quantum mechanical effects, offering
ay
• Exponential speedup in some problems, e.g., factoring large numbers using Shor’s
algorithm.
The power of quantum computing arises from processing many possibilities simultane-
ously through qubits’ superposition and leveraging entanglement to correlate qubits in
non-classical ways, enabling powerful parallel computations that classical bits cannot
replicate.
Quantum Computing Notes 6
• Qubit: Can be |0⟩, |1⟩, or any quantum superposition of these two states.
where α and β are complex numbers called amplitudes, and the probabilities must add
up to 1:
|α|2 + |β|2 = 1.
• If |ψ⟩ = √12 |0⟩ + √12 |1⟩, the qubit is “half-half” and measurement yields |0⟩ or |1⟩
with 50% chance each.
• |0⟩, |1⟩ are “kets” (column vectors), representing the pure states.
• ⟨0|, ⟨1| are “bras” (row vectors), used for calculations like inner products.
" # " #
1 0
• Example: |0⟩ = , |1⟩ = .
0 1
2.6 Entanglement
Some multi-qubit states cannot be separated into individual qubit states—these are en-
tangled.
Example: Bell State
1
|Φ+ ⟩ = √ (|00⟩ + |11⟩)
2
Measurement of one qubit instantly reveals the state of the other, regardless of distance.
2.7 Measurement
Measuring a qubit “collapses” its state to |0⟩ or |1⟩, with probabilities |α|2 and |β|2 .
General rule:
• After measurement: State is |0⟩ (with |α|2 probability) or |1⟩ (with |β|2 probability).
Quantum states are vectors in a Hilbert space (complex vector space with inner product).
ay
• State vector:
Ud
" #
α
|ψ⟩ =
β
• Normalization:
|α|2 + |β|2 = 1
⟨ψ|ϕ⟩ = α∗ γ + β ∗ δ
ρ = |ψ⟩⟨ψ|
For mixed states (probabilistic combinations of pure states), the density matrix is a
weighted sum.
Quantum Computing Notes 9
Practice/Checklist:
Quantum gates manipulate qubits by rotating their state on the Bloch Sphere or by
creating entanglement. Every computation in quantum computers is built from sequences
of these gates.
Quantum Computing Notes 10
Pauli Gates:
• Y gate: " #
0 −i
Y =
i 0
• Z gate: " #
1 0
til
Z=
0 −1
Pa
" #
1 1 1
Ud
H=√
2 1 −1
1
H |0⟩ = √ (|0⟩ + |1⟩)
2
Phase Gate (S): " #
1 0
S=
0 i
Summary Table: Common Single-Qubit Gates
Quantum Computing Notes 11
1 0 0 0
0 1 0 0
CNOT =
0 0 0 1
0 0 1 0
- Flips the target qubit if and only if the control qubit is |1⟩. - Essential for creating
entanglement.
• SWAP Gate:
1 0 0 0
0 0 1 0
SWAP =
0 1 0 0
0 0 0 1
Symbol Meaning
|q⟩ Qubit line (horizontal wire)
• Control qubit
⊕ Target qubit for CNOT
til
H Hadamard gate
Pa
Resulting state:
1
√ (|00⟩ + |11⟩)
2
This is a Bell state—maximally entangled!
• Probabilities are determined by the square modulus of the qubit amplitudes just
before measurement.
Entanglement? No Yes
Superposition? No Yes
ay
• Quantum circuits can be simulated and tested using online platforms like IBM
Quantum Experience and Qiskit.
• Drawing circuits can be done in LATEX using packages like qcircuit or quantikz.
This chapter covers the essential building blocks for quantum computation: gates and
circuits, which serve as the foundation for all algorithms and hardware in the quantum
computing realm.
The coefficients α and β represent the probabilities that when the qubit is measured, it
ay
multiple possible inputs simultaneously, which is a key reason quantum computers can
outperform classical ones in certain tasks.
4.2 Entanglement
Entanglement is a uniquely quantum phenomenon where two or more qubits become
linked such that the state of one qubit instantaneously affects the state of the other(s),
regardless of the distance between them. This correlation cannot be explained by classical
physics.
For two qubits |ψ⟩ and |ϕ⟩, an entangled state cannot be written as a simple tensor
product of their individual states. For example, the Bell state:
1
|Φ+ ⟩ = √ |00⟩ + |11⟩
2
is entangled. Measurement of one qubit determines the state of the other immediately.
Entanglement is crucial for many quantum algorithms and quantum communication
protocols, such as quantum teleportation and superdense coding.
Quantum Computing Notes 15
Phenomenon Description
til
Superposition A qubit exists in multiple states at once, enabling par-
Pa
allelism.
Entanglement Strong non-classical correlations between qubits.
ay
measurement probabilities.
Decoherence Loss of quantum properties due to environment interac-
tion; main source of errors.
• Entanglement creates strong correlations that are essential for quantum advantage.
These phenomena form the foundation upon which quantum algorithms and quantum
hardware operate. Understanding them is crucial for grasping how and why quantum
computers differ fundamentally from classical ones.
Quantum Computing Notes 16
5 Quantum Algorithms
5.1 Introduction to Quantum Algorithms
Quantum algorithms are step-by-step computational procedures that use quantum gates
and circuits to solve specific problems, often providing speed-ups over the best-known
classical algorithms. They leverage quantum properties such as superposition, entangle-
ment, and interference to achieve their advantages.
• How it works: Uses quantum Fourier transform (QFT) and period finding to
ay
Grover’s Algorithm
• Purpose: Searches an unsorted database or solves “black box” problems.
√
• Speed-up: Quadratic speed-up (classical: O(N ), quantum: O( N )).
• Key steps: Superposition, oracle marking solutions, and repeated amplitude am-
plification.
Quantum Fourier Transform (QFT)
• Role: Core in many quantum algorithms, similar to the classical discrete Fourier
transform but operates on quantum states.
5. Measure the qubits, collapsing them into classical bits with probabilities determined
til
by the computation.
Pa
• Use an oracle that marks the desired state by flipping its phase.
• Amplify the marked state’s amplitude with the Grover diffusion operator.
√
• Repeat the oracle and amplification steps ∼ N times.
• Many quantum speed-ups are for specialized problems, not all computational tasks.
• The field is growing and includes quantum algorithms for optimization, chemistry,
machine learning, and communication.
• Famous algorithms (like Shor’s and Grover’s) demonstrate clear quantum advan-
tage.
ay
entanglement.
• Practical realization still faces challenges due to noise and error rates.
Mastering quantum algorithms is crucial for anyone seeking to understand the power and
limitations of quantum computing.
• Trapped ions: Individual ions (electrically charged atoms) are suspended and
manipulated with lasers. States correspond to different energy levels.
• Photonic qubits: Quantum information stored in single photons using their po-
larization or path.
• Spin qubits: Use the magnetic (spin) state of electrons, often trapped in semicon-
ductor devices (quantum dots).
operations.
• Control electronics: Precisely time and sequence gates, often requiring fast clas-
sical computers and real-time feedback.
Solutions:
• Error correction: Physical qubits are unreliable; error correction requires encod-
ing “logical qubits” into many physical qubits.
• Logical qubits use groups of physical qubits to encode one error-protected bit of
quantum information.
• Algorithms like the surface code are designed for practical error protection.
• Novel qubit designs: Developing more robust, scalable, or easily integrated quan-
ay
tum hardware.
Ud
• Many different physical systems can serve as qubits, each with strengths and weak-
nesses.
• Error correction and noise-resilience are critical for practical quantum computing.
• The field is rapidly evolving, combining advances from physics, engineering, and
materials science.
Hardware innovations are vital to making quantum computers useful for real-world
applications. Understanding these challenges and progress helps explain why quantum
computing is both difficult and promising.
Quantum Computing Notes 22
7 Quantum Programming
7.1 Introduction
Quantum programming translates quantum algorithms into instructions that a quantum
computer can execute. It introduces special programming languages, platforms, and tools
to create and test quantum circuits.
• Cirq: Google’s Python library for designing, simulating, and running quantum
circuits. l
• Others: PyQuil (Rigetti), Braket (Amazon), and more.
ti
Pa
3. Run the circuit, possibly many times (shots), to collect statistics on output.
backend = Aer.get_backend(’qasm_simulator’)
Quantum Computing Notes 23
• Hybrid algorithms often use both classical and quantum steps (e.g., variational
quantum eigensolver).
Quantum Computing Notes 24
• Measure often and analyze output probability distributions, not single run results.
7.11 Conclusion
Quantum programming bridges the gap between theory and implementation, enabling
ay
users to build, test, and run quantum algorithms on actual machines. Getting hands-
Ud
on with these tools is vital for any student or practitioner aiming to master quantum
computing in practice.
8.2 Cryptography
• Breaking Cryptosystems: Quantum algorithms like Shor’s can factor large in-
tegers efficiently, threatening widely-used RSA and ECC encryption.
Quantum Computing Notes 25
• Fundamental Physics: Explore new states of matter, quantum phases, and par-
ticle behavior.
• Database search
til
• Pattern recognition
Pa
• Weather and climate modeling: Simulate complex systems for more accurate
predictions.
for tasks involving complex systems, secure communication, and optimization, with the
greatest short-term impact expected in quantum simulation and cryptography.
Ud
Exploring these applications guides both the research focus and real-world adoption of
quantum technologies.
• Qubit Stability (Decoherence): Quantum states are fragile and can become
disrupted by even minimal interaction with their environment, leading to loss of
information.
• Error Rates and Noise: Quantum operations are prone to errors due to imperfect
control and environmental interference. Error rates are much higher than in classical
computers.
correction codes
ay
• Useful, error-corrected machines at scale are still years away, but research and
investment are accelerating.
• The future of quantum computing will likely involve a combination of newly engi-
neered hardware, deeper theoretical insights, and creative new algorithms.
• Mathematics:
• Books:
• Communities:
• Have you built or simulated a simple quantum circuit (e.g., Bell state creator)?
• Are you familiar with some current research and development trends in quantum
computing?
Quantum Computing Notes 32
• Practice regularly: small code experiments and circuit exercises help you learn
faster.
• Don’t hesitate to use visualizations for state evolution and circuit operation.
Step Description
til
Quantum Principles Learn superposition, entanglement, measurement
Pa
Quantum Algorithms Study and model key algorithms (Deutsch–Jozsa, Grover’s, Shor’s)
Ud
With steady effort, curiosity, and hands-on practice, you will develop both theoretical
understanding and practical skill in quantum computing!
so r
√1
1 1 2 0 3
|ψ⟩ = √ + = q .
3 0 3 1 2
3
Check normalization:
2
r 2
1 2 1 2
√ + = + = 1,
3 3 3 3
thus normalized.
—
1 1
|ϕ⟩ = √ |0⟩ + √ |1⟩,
2 2
ay
apply the Pauli-Z gate to |ϕ⟩ and write the resulting state vector.
Ud
Apply Z:
1 0 1 1
Z|ϕ⟩ = √1 = √1 .
0 −1 2 1 2 −1
3 4
|ψ⟩ = |0⟩ + |1⟩.
5 5
2
4 16
P (1) = = = 0.64.
5 25
—
Quantum Computing Notes 35
1
|Φ⟩ = √ (|00⟩ + |11⟩)
2
is entangled or separable.
Solution: Try to write |Φ⟩ = |α⟩ ⊗ |β⟩.
Suppose
|α⟩ = a0 |0⟩ + a1 |1⟩, |β⟩ = b0 |0⟩ + b1 |1⟩,
then
|α⟩ ⊗ |β⟩ = a0 b0 |00⟩ + a0 b1 |01⟩ + a1 b0 |10⟩ + a1 b1 |11⟩.
For |Φ⟩, the coefficients for |01⟩ and |10⟩ are zero, so:
a0 b1 = 0, a1 b0 = 0.
be factorized, so it is entangled.
—
ay
Problem: Write a qubit state that, when measured, yields |0⟩ with probability 0.8 and
|1⟩ with probability 0.2. Express the state in vector form.
Solution: Let |ψ⟩ = α|0⟩ + β|1⟩. Probabilities are |α|2 = 0.8 and |β|2 = 0.2.
√ √
Choose α = 0.8 ≈ 0.894 and β = 0.2 ≈ 0.447 (taking real, positive values).
0.894
|ψ⟩ ≈ 0.894|0⟩ + 0.447|1⟩ =
0.447
0
Apply to |1⟩ = :
1
1 1 1 0 1
H|1⟩ = √ = √1
2 1 −1 1 2 −1
Thus,
1
H|1⟩ = √ (|0⟩ − |1⟩)
2
—
Problem: A qubit starts in |0⟩. It is passed through the following gates: Hadamard
(H), then Z, then H again. What is the probability of measuring |0⟩ at the end?
ay
Solution: Stepbystep:
1
Ud
1. Start: |0⟩ =
0
1
2. After H: H|0⟩ = √12
1
3. After Z:
1 1 1 1
Z√ = √
2 1 2 −1
4. After H again:
1 1 1 1 1 − 1 1 0 0
H √ = √ √ = =
2 −1 2 2 1+1 2 2 1
The CNOT flips the target qubit if the control is |1⟩. So: - |00⟩ → |00⟩ - |01⟩ → |01⟩ -
|10⟩ → |11⟩ - |11⟩ → |10⟩
—
Solution:
1
ay
|ψ1 ⟩ =
0
Ud
1 1
|ψ2 ⟩ = √
2 1
h i 1 1 1 1 1
⟨ψ1 |ψ2 ⟩ = 1 0 · √ = √ · 1 + √ · 0 = √
2 1 2 2 2
Since the inner product is not zero, the states are not orthogonal.
12 Practice Problems
1. Basic Qubit State: Write the qubit state corresponding to a 30% probability
of measuring |0⟩ and 70% probability of measuring |1⟩. Express it in both Dirac
notation and vector form.
2. Gate Application: Apply the Hadamard gate H to the qubit |0⟩. What is the
resulting state? Write down the vector and show the probabilities of measuring |0⟩
and |1⟩.
Quantum Computing Notes 38
1
|Φ⟩ = (|00⟩ + |01⟩ + |10⟩ + |11⟩)
2
Verify normalization and compute the exact probabilities of measuring |0⟩ and |1⟩.
1 0 0.8
ay
calculate X|ψ⟩.
Ud
7. Create Bell State Circuit: Describe a sequence of gates to create the Bell state
|Φ+ ⟩ = √12 (|00⟩ + |11⟩) from initial state |00⟩ using single-qubit and CNOT gates.
identify the angles θ and ϕ representing this state on the Bloch sphere.
9. CNOT Action: If the control qubit is |1⟩ and the target qubit is √12 (|0⟩ + |1⟩),
write the combined initial state and the resulting state after applying the CNOT
gate.
Bibliography
1. Nielsen, M. A., & Chuang, I. L. (2010). Quantum Computation and Quantum
Information (10th Anniversary Edition). Cambridge University Press.
6. Preskill, J. (1998). Lecture Notes for Physics 229: Quantum Information and Com-
til
putation. California Institute of Technology.
Pa