Quantum Computing Notes
Quantum Computing Notes
Where:
● α and β are probability amplitudes.
● |α|² + |β|² = 1
Diagram
Classical Bit:- 0 or 1
Quantum Bit
|0⟩
\
\
● (Qbit)
/
/
|1⟩
Values 0 or 1
Parallelism No Yes
Measurement Does not change state Collapses to 0 or 1
0 1
1 0
Since output uniquely identifies input, the operation is reversible.
Diagram
Input ──[NOT]── Output
0→1
1→0
0 0 00
0 1 01
1 0 11
1 1 10
Input can always be recovered.
Diagram
|0⟩ ──[H]── Superposition
3. CNOT Gate
Creates entanglement.
Diagram
Control ──●────
|
Target ───⊕────
Explanation
1. First Qbit starts in |0⟩.
2. Hadamard gate creates superposition.
3. CNOT gate entangles both Qbits.
After measurement:
● Becomes 0 with probability |α|²
● Becomes 1 with probability |β|²
Diagram
|ψ⟩ ──[M]── Classical Output
Example
|ψ⟩ = (|0⟩ + |1⟩)/√2
Measurement gives:
0 → 50%
1 → 50%
Steps
1. Start with |0⟩ state.
2. Apply quantum gates.
3. Obtain required state.
Example
|0⟩ ──[H]──
Produces
(|0⟩ + |1⟩)/√2
Diagram
Initial State → Quantum Gates → Desired State
Construction Process
Start with:
|0⟩
Result:
Any point on the Bloch Sphere can be reached.
Construction Steps
1. Initialize:
|00⟩
Output = 5 + 2 = 7
Characteristics
1. Superposition
Qbit can be in multiple states simultaneously.
2. Entanglement
Two Qbits become strongly correlated.
3. Interference
Probability amplitudes combine.
4. Measurement Collapse
State collapses after measurement.
5. Reversibility
Quantum operations are reversible.
Diagram
Quantum System
Superposition
|
Entanglement
|
Interference
|
Measurement
Parallelism No No Yes
Measurement Effect No change Observation only State collapse
Example
Single Qbits:
Q1 = |0⟩
Q2 = |1⟩
Combined system:
|0⟩ ⊗ |1⟩ = |01⟩
(⊗ = Tensor Product)
Diagram
Qbit 1 ----\
---- Combined System
Qbit 2 ----/
Importance
● Builds multi-Qbit systems.
● Enables entanglement.
● Increases computational power.
Classical Computing
● Uses bits (0 or 1).
● Sequential processing.
● Limited parallelism.
Diagram
Bit → Logic Gates → Output
Quantum Computing
● Uses Qbits.
● Superposition and entanglement.
● Massive parallel processing.
Diagram
Qbit
|
Superposition
|
Entanglement
|
Quantum Gates
|
Measurement
Comparison of Evolution
Classical Computing
↓
Improved Processors
↓
Parallel Computing
↓
Quantum Computing
Characteristics
● Every observable is represented by a mathematical operator.
● Measurement gives one of the operator's eigenvalues.
● After measurement, the system collapses to the corresponding eigenstate.
Example
Consider spin of an electron.
Possible measurement results:
Spin Up ↑
Spin Down ↓
Diagram
Quantum State
|
Measurement
|
Observable
|
Result
Applications
● Measuring qubit values.
● Quantum algorithms.
● Quantum communication.
Before Measurement
A qubit may exist in superposition.
Example:
|ψ⟩ = (|0⟩ + |1⟩)/√2
During Measurement
The quantum state collapses into one definite state.
Possible results:
0 with probability 50%
1 with probability 50%
After Measurement
The qubit remains in the measured state.
Diagram
Superposition State
|
V
Measurement
|
-----------
| |
0 1
Importance
● Converts quantum information into classical information.
● Necessary to obtain final results from a quantum computer.
Main Idea
A quantum system evolves continuously until measurement occurs.
State changes are controlled using quantum gates.
Example
Initial State:
|0⟩
Apply Hadamard Gate:
(|0⟩ + |1⟩)/√2
The state has evolved.
Diagram
Initial State
|
Quantum Gate
|
New Quantum State
Characteristics
● Evolution is reversible.
● Governed by quantum mechanics.
● Preserves probability.
Importance
● Performs quantum computation.
● Enables quantum algorithms.
Tensor Product
Quantum systems are combined using the tensor product.
Example:
Qubit A = |0⟩
Qubit B = |1⟩
Combined state:
|0⟩ ⊗ |1⟩ = |01⟩
Diagram
Qubit A ----\
\
--> Combined System
/
Qubit B ----/
Importance
● Creates multi-qubit systems.
● Enables entanglement.
● Increases computational power.
Values 0 or 1
Parallelism No Yes
1. AND Gate
Truth Table
A B Output
0 0 0
0 1 0
1 0 0
1 1 1
Diagram
A ----\
AND ---- Output
B ----/
2. OR Gate
A B Output
0 0 0
0 1 1
1 0 1
1 1 1
3. NOT Gate
Input Output
0 1
1 0
Diagram
Input ---- NOT ---- Output
Applications
● Computers
● Digital circuits
● Arithmetic operations
Characteristics
● No information loss.
● One-to-one mapping.
● Essential in quantum computing.
0 1
1 0
Input can always be recovered.
0 0 00
0 1 01
1 0 11
1 1 10
Importance
1. Reduces energy loss.
2. Required for quantum computation.
3. Preserves information.
3. CNOT Gate
Diagram
Control ----●----
|
Target -----⊕----
Used to create entanglement.
Importance
● Manipulate qubits.
● Implement quantum algorithms.
● Create superposition and entanglement.
Representation
∣ψ⟩=α∣0⟩+β∣1⟩
Diagram
|0⟩
\
\
●
/
/
|1⟩
Advantages
● Enables parallel computation.
● Increases computational power.
Example
Entangled State:
(|00⟩ + |11⟩)/√2
Diagram
Qubit A ===== Qubit B
(Linked States)
Significance
1. Quantum communication.
2. Quantum teleportation.
3. Quantum cryptography.
4. Quantum algorithms.
13. Explain the Role of Unitary Operations in Quantum Computing
Definition
Unitary operations are mathematical operations that preserve quantum information.
All quantum gates are unitary.
Characteristics
● Reversible.
● Preserve probability.
● Maintain normalization.
Example
Pauli-X Gate:
|0⟩ → |1⟩
|1⟩ → |0⟩
The operation can be reversed.
Diagram
Quantum State
|
Unitary Gate
|
New State
Importance
● Perform quantum computations.
● Prevent information loss.
● Enable state evolution.
Main Components
1. Qubits
Store quantum information.
2. Quantum Gates
Manipulate qubits.
3. Quantum Circuits
Sequence of quantum operations.
4. Control Unit
Controls execution of gates.
5. Measurement Unit
Converts quantum information into classical information.
6. Classical Computer
Manages and interprets results.
Architecture Diagram
Classical Computer
|
V
Control System
|
V
-----------------------
| Quantum CPU |
| |
| Qubits + Gates |
-----------------------
|
V
Measurement Unit
|
V
Output
Importance
● Enables execution of quantum algorithms.
● Coordinates quantum and classical processing.
15. Explain How Quantum Systems Differ from Classical Computational Models
Feature Classical System Quantum System
States 0 or 1 Superposition
Performance Limited for complex problems Faster for many complex problems
Examples Laptop, Calculator Quantum Computer
Mathematical Representation
A qubit can exist in state |0⟩, |1⟩, or a combination of both.
General quantum state:
∣ψ⟩=α∣0⟩+β∣1⟩
Where:
● α and β are complex probability amplitudes.
● |α|² gives probability of measuring 0.
● |β|² gives probability of measuring 1.
Normalization condition:
∣α∣2+∣β∣2=1
Vector Representation
Basis states are represented as:
|0⟩ = [1]
[0]
|1⟩ = [0]
[1]
Example
If
|ψ⟩ = (|0⟩ + |1⟩)/√2
Then:
● Probability of 0 = 50%
● Probability of 1 = 50%
Diagram
|0⟩
\
\
●
/
/
|1⟩
Conclusion
Quantum states are the foundation of quantum computing and are mathematically represented using
vectors and probability amplitudes.
Mathematical Representation
In quantum mechanics, observables are represented by Hermitian operators (matrices).
When an observable is measured:
● The result obtained is called an eigenvalue.
● The system collapses into the corresponding eigenstate.
Example
Observable: Spin of an electron
Possible outcomes:
Spin Up ↑
Spin Down ↓
Diagram
Quantum State
|
V
Observable
|
Measurement
|
Result
Importance
● Used to extract information from quantum systems.
● Forms the basis of quantum measurements.
● Essential in quantum algorithms.
Before Measurement
A qubit may exist in superposition.
Example:
|ψ⟩ = (|0⟩ + |1⟩)/√2
During Measurement
The quantum state collapses into one definite state.
Possible outcomes:
0 with probability 50%
After Measurement
The qubit remains in the measured state.
Example
Consider:
|ψ⟩ = (|0⟩ + |1⟩)/√2
After measurement:
50% chance → |0⟩
50% chance → |1⟩
Diagram
Superposition
|
V
Measurement
|
-----------
| |
0 1
Importance
● Converts quantum information into classical information.
● Provides the final result of quantum computation.
Principle
Unlike classical systems, quantum systems evolve according to quantum mechanical laws.
The evolution is continuous and reversible until measurement occurs.
State Evolution
Initial State:
|0⟩
Apply Hadamard Gate:
(|0⟩ + |1⟩)/√2
The state has evolved.
Diagram
Initial State
|
Quantum Gate
|
New State
Characteristics
1. Reversible evolution.
2. Governed by quantum mechanics.
3. Preserves probability.
4. Implemented using quantum gates.
Importance
● Enables quantum computation.
● Forms the basis of quantum algorithms.
Tensor Product
Quantum states are combined using the tensor product (⊗).
Example:
Qubit A = |0⟩
Qubit B = |1⟩
Combined state:
|0⟩ ⊗ |1⟩ = |01⟩
Diagram
Qubit A ----\
\
--> Combined System
/
Qubit B ----/
Importance
1. Creates multi-qubit systems.
2. Enables entanglement.
3. Increases computational power.
Values 0 or 1
AND Gate
Truth Table
A B Output
0 0 0
0 1 0
1 0 0
1 1 1
Diagram
A ----\
AND ---- Output
B ----/
OR Gate
A B Output
0 0 0
0 1 1
1 0 1
1 1 1
NOT Gate
Input Output
0 1
1 0
Diagram
Input ---- NOT ---- Output
Applications
● Digital circuits
● Computers
● Arithmetic operations
Characteristics
● No information loss.
● One-to-one mapping.
● Essential for quantum computation.
0 1
1 0
Example: CNOT Gate
Control Target Output
0 0 00
0 1 01
1 0 11
1 1 10
1. Pauli-X Gate
Acts like classical NOT gate.
|0⟩ → |1⟩
|1⟩ → |0⟩
3. CNOT Gate
Diagram
Control ----●----
|
Target -----⊕----
Used to create entanglement.
Importance
● Manipulate quantum states.
● Create superposition.
● Create entanglement.
● Execute quantum algorithms.
Roles
1. Create Quantum Circuits
Programmers can define qubits and gates.
2. Implement Quantum Algorithms
Algorithms such as Grover's and Shor's can be written.
3. Control Quantum Hardware
Connect software with quantum processors.
4. Simulate Quantum Systems
Test programs before running on real quantum hardware.
Diagram
Programmer
|
Quantum Language
|
Quantum Circuit
|
Quantum Computer
Advantages
● Simplifies quantum algorithm development.
● Provides hardware-independent programming.
● Enables experimentation and research.
Implementation Flow
Algorithm
|
Programming Language
|
Quantum Circuit
|
Execution
|
Measurement
|
Result
2. Quantum Noise
Environmental disturbances introduce errors.
3. Decoherence
Quantum states lose information over time.
4. Complex Mathematics
Requires knowledge of:
● Linear algebra
● Probability
● Quantum mechanics
5. Debugging Difficulty
Quantum states cannot be directly observed without measurement.
Diagram
Quantum Program
|
--------------------
| Noise |
| Decoherence |
| Errors |
--------------------
|
Reduced Accuracy
2. Quantum Parallelism
Superposition allows many computations simultaneously.
3. Efficient Searching
Grover's Algorithm searches databases faster than classical methods.
4. Powerful Factorization
Shor's Algorithm factors large numbers efficiently.
5. Better Optimization
Useful for:
● Scheduling
● Logistics
● Resource allocation
6. Improved Simulations
Can simulate molecules and quantum systems more accurately.
Comparison Table
Task Classical Algorithm Quantum Algorithm
Characteristics
1. Predictable behavior.
2. Same input gives same output.
3. Fixed execution path.
4. No randomness involved.
Example
Consider:
Input = 5
Operation = Add 3
Output = 8
Every time input 5 is given, output will always be 8.
Flow Diagram
Input
|
V
Fixed Rules
|
V
Output
Real-Life Example
Calculator Operation:
7 + 5 = 12
The answer is always 12.
Applications
● Arithmetic calculations
● Database systems
● Operating systems
● Traditional computer programs
Characteristics
1. Multiple possible execution paths.
2. Not restricted to a single choice.
3. Useful for solving complex problems.
4. Basis of NP (Nondeterministic Polynomial Time) problems.
Example
Suppose we want to find a password from:
1234
5678
9876
4321
A deterministic computer checks one by one.
A nondeterministic model assumes all possibilities can be checked simultaneously.
Diagram
Start
|
-----------------
| | |
Path1 Path2 Path3
| | |
-----------------
|
Solution
Significance
1. Helps study computational complexity.
2. Forms basis of NP-complete problems.
3. Used in theoretical computer science.
4. Inspires quantum computing concepts.
Characteristics
1. Uses random choices.
2. Different runs may produce different outputs.
3. Useful for approximation algorithms.
4. Faster for some complex problems.
Diagram
Coin Toss
|
/\
Head Tail
50% 50%
Applications
● Randomized algorithms
● Machine learning
● Cryptography
● Simulations
Diagram
Qubit
|
Superposition
|
Entanglement
|
Quantum Gates
|
Measurement
Applications
● Cryptography
● Optimization
● Drug discovery
● Artificial Intelligence
Values 0 or 1 0, 1, or superposition
Main Components
Plaintext
Original message.
Encryption
Converting plaintext into ciphertext.
Ciphertext
Encrypted message.
Decryption
Converting ciphertext back into plaintext.
Key
Secret information used for encryption and decryption.
Diagram
Plaintext
|
Encryption Key
|
Ciphertext
|
Decryption Key
|
Plaintext
Example
Message:
HELLO
Encrypted as:
KHOOR
(using Caesar Cipher with shift 3)
Applications
● Banking
● Online shopping
● Email security
Diagram
Classical Security
|
Quantum Computers
|
Security Threat
|
Quantum Cryptography
Advantages
● Unconditional security.
● Eavesdropper detection.
● Future-proof communication.
Working
Step 1
Sender (Alice) generates random bits.
Step 2
Alice sends photons using random polarization bases.
Step 3
Receiver (Bob) measures photons using random bases.
Step 4
Alice and Bob compare bases.
Step 5
Matching results form the secret key.
Diagram
Alice
|
Photons
|
Quantum Channel
|
Bob
Security
Any eavesdropper changes photon states and gets detected.
Advantages
● Highly secure.
● Eavesdropping detection.
● Widely implemented.
Working
Uses only two non-orthogonal quantum states instead of four states used in BB84.
Steps
1. Alice sends photons in two states.
2. Bob performs measurements.
3. Some measurements provide valid key bits.
4. Invalid measurements are discarded.
Diagram
Alice
|
Two Quantum States
|
Quantum Channel
|
Bob
Advantages
● Simpler implementation.
● Requires fewer states.
Disadvantages
● More sensitive to noise.
● Lower efficiency.
Working
Step 1
Create entangled photon pairs.
Step 2
One photon sent to Alice.
Step 3
Other photon sent to Bob.
Step 4
Both measure photons.
Step 5
Correlated results form secret key.
Diagram
Entangled Pair
|
--------
| |
Alice Bob
| |
Measure Measure
Security
Any interception disturbs entanglement and can be detected.
Advantages
● Extremely secure.
● Based on entanglement.
● Detects eavesdroppers effectively.
Entanglement No No Yes
Requirements
1. Entangled particles.
2. Classical communication channel.
3. Quantum channel.
Working
Step 1
Alice and Bob share entangled qubits.
Step 2
Alice combines unknown state with her entangled qubit.
Step 3
Alice measures and sends classical information.
Step 4
Bob applies operations.
Step 5
Original state appears at Bob's side.
Diagram
Unknown State
|
Alice
|
Measurement
|
Classical Message
|
V
Bob
|
Quantum Operation
|
Recovered State
Applications
● Quantum communication
● Quantum internet
● Distributed quantum computing
4. Unconditional Security
Provides theoretically provable security.
Comparison Table
Feature Classical Cryptography Quantum Cryptography
3. Transmission Loss
Photons may be lost over long distances.
5. Scalability Issues
Large-scale deployment remains difficult.
6. Infrastructure Requirements
Existing communication networks need modification.
Diagram
Quantum System
|
-------------------
| Noise |
| Signal Loss |
| Hardware Cost |
-------------------
|
Implementation Challenges
UNIT V- Information Theory & Hardware
Example
Sending a message:
HELLO
through the internet or mobile network.
Shannon Entropy
Definition
Shannon Entropy measures the amount of uncertainty or information contained in a message.
Higher uncertainty → Higher information content.
Formula
H(X)=-\sum p(x)\log_2 p(x)
Where:
● H(X) = Entropy
● p(x) = Probability of occurrence
Example: Fair Coin Toss
Head = 0.5
Tail = 0.5
Entropy:
H = 1 bit
This means one bit of information is produced.
Importance
1. Measures information content.
2. Helps data compression.
3. Used in communication systems.
4. Foundation of modern digital communication.
Example
A qubit can exist as:
|\psi\rangle=\alpha|0\rangle+\beta|1\rangle
Formula
S(\rho)=-Tr(\rho\log_2\rho)
Where:
● S(ρ) = von Neumann entropy
● ρ = Density matrix
● Tr = Trace operation
Interpretation
● S = 0 → Pure quantum state
● S > 0 → Mixed quantum state
Example
Pure State:
|0⟩
Entropy:
S=0
Because there is no uncertainty.
Importance
1. Measures quantum uncertainty.
2. Used in quantum communication.
3. Helps analyze entanglement.
4. Important in quantum information theory.
Types of Compression
1. Lossless Compression
Original data can be recovered exactly.
Examples:
● ZIP
● PNG
● Huffman Coding
2. Lossy Compression
Some information is lost permanently.
Examples:
● JPEG
● MP3
● MPEG
Diagram
Original Data
|
Compression
|
Compressed Data
|
Decompression
|
Original Data
Advantages
1. Saves storage space.
2. Reduces transmission time.
3. Improves network efficiency.
Principle
Quantum compression removes redundancy from quantum states while preserving information.
Schumacher Compression
The quantum equivalent of Huffman coding.
Proposed by:
Benjamin Schumacher
Working
1. Analyze quantum state probabilities.
2. Identify redundant information.
3. Encode information using fewer qubits.
4. Recover original state later.
Diagram
Quantum States
|
Quantum Compression
|
Fewer Qubits
|
Quantum Decompression
|
Original Quantum States
Advantages
1. Saves quantum memory.
2. Efficient quantum communication.
3. Reduces hardware requirements.
Need
Errors may occur because of:
● Noise
● Interference
● Hardware failures
Diagram
Data
|
Encoding
|
Transmission
|
Noise
|
Decoding
|
Correct Data
Applications
1. Computer memory.
2. Mobile communication.
3. Satellite communication.
Why Needed?
Qubits are very sensitive to environmental disturbances.
Encoded as:
|000⟩
Diagram
Qubit
|
Encoding
|
Multiple Qubits
|
Error Detection
|
Correction
Importance
1. Reliable quantum computation.
2. Fault-tolerant systems.
3. Long quantum computations.
Challenges
1. Decoherence
Quantum states lose information quickly.
2. Noise
External disturbances create errors.
3. Cooling Requirements
Many systems require extremely low temperatures.
4. High Cost
Quantum hardware is expensive.
5. Error Correction
Requires many additional qubits.
Diagram
Quantum Hardware
|
--------------------
| Noise |
| Decoherence |
| Cost |
| Scalability |
--------------------
Working
1. Ions are trapped using electromagnetic fields.
2. Laser beams manipulate ions.
3. Quantum gates operate on ions.
4. Measurement gives output.
Diagram
Laser
|
V
[ Ion ] [ Ion ] [ Ion ]
|
Electromagnetic Trap
Advantages
1. High accuracy.
2. Long coherence time.
3. Reliable operations.
Disadvantages
1. Slow gate operations.
2. Difficult scalability.
Components
1. Photons
2. Beam splitters
3. Mirrors
4. Detectors
Diagram
Photon
|
Beam Splitter
/\
/ \
Detector Detector
Advantages
1. Low noise.
2. Fast communication.
3. Suitable for quantum networks.
Disadvantages
1. Difficult photon control.
2. Scalability challenges.
Working
1. Molecules placed in magnetic field.
2. Radio-frequency pulses manipulate nuclei.
3. Quantum operations performed.
4. Signals measured.
Diagram
Magnetic Field
|
Molecule
|
RF Pulses
|
Measurement
Advantages
1. Well-understood technology.
2. Easy experimental setup.
Disadvantages
1. Difficult to scale.
2. Limited number of qubits.
Working
1. Circuit cooled near absolute zero.
2. Superconducting current forms qubits.
3. Microwave pulses perform operations.
4. Measurement provides output.
Diagram
Microwave Control
|
V
Superconducting Circuit
|
Cryogenic Cooling
|
Measurement
1. operations.
2. Easily integrated into chips.
3. Scalable architecture.
Disadvantages
1. Sensitive to noise.
2. Requires expensive cooling.
Examples
Used by:
● IBM
● Google
● Rigetti Computing