In April 2023 the Union Cabinet approved India's National Quantum Mission with an outlay of roughly ₹6,003 crore spread over eight years, targeting intermediate-scale quantum computers of 50 to 1,000 physical qubits by 2031, built through Thematic Hubs anchored at institutions including IISc and several IITs. Every press report on the Mission uses the same handful of words: qubit, superposition, entanglement, quantum advantage. Almost none of them explain what those words actually mean at the level of a state vector and a matrix multiplication, which is the only level at which "quantum advantage" stops being a slogan and becomes something you can check. This chapter builds that vocabulary from first principles: what a qubit is as a mathematical object, how quantum gates act on it, why two qubits together are not just "two bits," and how the resulting structure gets pressed into service for machine learning. A companion chapter in this curriculum goes deep on variational quantum circuits as trainable models; this chapter builds the substrate those models sit on.
A qubit is a vector, not a fuzzy bit
A classical bit is a label: 0 or 1, full stop. A qubit is a unit vector in a two-dimensional complex vector space, written in Dirac notation as |ψ⟩ = α|0⟩ + β|1⟩, where |0⟩ = (1, 0) and |1⟩ = (0, 1) are the two basis states and α, β are complex numbers called amplitudes satisfying |α|² + |β|² = 1. That normalization constraint is not decoration; it is what lets |α|² and |β|² be interpreted as the probabilities of measuring the qubit in state |0⟩ or |1⟩. Crucially, the qubit is in the state α|0⟩ + β|1⟩ the entire time it evolves under quantum gates, both amplitudes fully present and interacting with each other. It only reduces to a single classical outcome, 0 or 1, at the instant you measure it, and after that measurement the superposition is gone: the qubit is now whatever you measured, deterministically. This is the first fact that has no classical analogue: a classical bit's value is a fact about the world you can inspect for free; a qubit's amplitudes are structure that measurement destroys.
Many qubits: tensor products, not addition
A single qubit lives in a 2-dimensional space. Two qubits do not live in a 4-dimensional space by addition (2+2); they live in a 4-dimensional space by tensor product (2×2), spanned by |00⟩, |01⟩, |10⟩, |11⟩, and a general 2-qubit state is a normalized combination of all four: c₀₀|00⟩ + c₀₁|01⟩ + c₁₀|10⟩ + c₁₁|11⟩. Extend this to n qubits and the state space has dimension 2ⁿ, spanned by every n-bit string simultaneously. This exponential growth is the second fact with no classical counterpart, and it cuts both ways. It is why a modest number of qubits can, in principle, represent an astronomically large state space, and it is exactly why classical computers struggle to simulate quantum systems: to track a general n-qubit state exactly, a classical simulator must store roughly 2ⁿ complex numbers. At n = 300, that number already exceeds the count of atoms in the observable universe, which is the real (and much more precise) content behind the popular claim that quantum computers "process exponentially more information." What that claim leaves out, and what the rest of this chapter is about, is that having an exponentially large state does not automatically mean you can extract an exponentially useful answer from it.
Gates are reversible matrices, and that changes what "logic" means
Classical logic gates like AND and OR are not reversible: AND(0,0), AND(0,1), and AND(1,0) all output 0, so given the output 0 you cannot recover which input produced it. Quantum gates cannot do this. Because quantum evolution corresponds to multiplying the state vector by a unitary matrix U (one satisfying U†U = I, where U† is the conjugate transpose), every quantum gate is, by construction, invertible: applying U†U to a state always returns exactly what you started with. This is why quantum circuits are built from a small set of reversible one- and two-qubit gates rather than from AND/OR/NOT directly.
Two gates matter most for what follows. The Hadamard gate H acts on a single qubit and is defined by the matrix H = (1/√2)[[1, 1], [1, −1]]. Applied to |0⟩ = (1, 0), it produces H|0⟩ = (1/√2)(1, 1) = (|0⟩ + |1⟩)/√2, an equal superposition. The controlled-NOT (CNOT) gate acts on two qubits: it leaves the target qubit unchanged if the control qubit is |0⟩, and flips the target if the control qubit is |1⟩. On the four basis states |00⟩, |01⟩, |10⟩, |11⟩ (control first, target second), CNOT sends |10⟩ ↦ |11⟩ and |11⟩ ↦ |10⟩, leaving |00⟩ and |01⟩ fixed, giving the matrix:
CNOT =
[[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 0, 1],
[0, 0, 1, 0]]
Now build the single most important two-qubit state in quantum computing by hand, starting from |00⟩ = (1, 0, 0, 0). First apply H to qubit 0 only (the other qubit passes through an identity gate I). The combined operator H⊗I, written out in the |00⟩, |01⟩, |10⟩, |11⟩ basis, is:
H⊗I = (1/sqrt(2)) *
[[1, 0, 1, 0],
[0, 1, 0, 1],
[1, 0, -1, 0],
[0, 1, 0, -1]]
Multiplying this by (1, 0, 0, 0) picks out its first column: (1/√2)(1, 0, 1, 0), which is the state (|00⟩ + |10⟩)/√2. Qubit 0 is now in superposition; qubit 1 is untouched. Next apply CNOT with qubit 0 as control. Multiplying the CNOT matrix above by (1/√2)(1, 0, 1, 0): row 0 picks out input index 0, giving 1/√2; row 1 picks out input index 1, giving 0; row 2 picks out input index 3, giving 0; row 3 picks out input index 2, giving 1/√2. The result is (1/√2)(1, 0, 0, 1), which is the state (|00⟩ + |11⟩)/√2. This is the Bell state, and building it took exactly one Hadamard and one CNOT. In Qiskit, the same two lines reproduce it:
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
print(Statevector.from_instruction(qc))
# Statevector([0.70710678+0.j, 0. +0.j, 0. +0.j,
# 0.70710678+0.j],
# dims=(2, 2))
0.70710678 is 1/√2 to eight decimal places, confirming the hand computation: nonzero amplitude only on |00⟩ and |11⟩.
Entanglement is a statement about what a state vector cannot be factored into
The Bell state (|00⟩ + |11⟩)/√2 is entangled, meaning it cannot be written as (a state of qubit 0) tensor (a state of qubit 1). This is provable, not just assertable. Suppose it could: (a|0⟩ + b|1⟩) ⊗ (c|0⟩ + d|1⟩) = ac|00⟩ + ad|01⟩ + bc|10⟩ + bd|11⟩. Matching this to (1/√2)|00⟩ + 0|01⟩ + 0|10⟩ + (1/√2)|11⟩ requires ad = 0 and bc = 0, while ac = 1/√2 and bd = 1/√2 (both nonzero). From ac ≠ 0, a ≠ 0. From ad = 0 and a ≠ 0, d = 0. But then bd = 0, contradicting bd = 1/√2. No choice of a, b, c, d works: the Bell state genuinely cannot be decomposed into two independent single-qubit states. Measuring qubit 0 of this state and getting |0⟩ instantly tells you qubit 1 will also read |0⟩ if measured, and likewise for |1⟩, a correlation stronger than any classical joint probability distribution over two independent coins can produce (the content of Bell's theorem, which this curriculum's statistics and probability chapters have laid the groundwork to state precisely).
Correcting a misconception: superposition is not "trying every answer at once"
The most common mental model students bring to quantum computing is that an n-qubit register in superposition is secretly running 2ⁿ classical computations in parallel, and a quantum algorithm just "reads off" the right one at the end. This is wrong in a way that matters: it predicts quantum computers should be exponentially faster at literally everything, which they are not. What actually happens is that gates manipulate probability amplitudes, and amplitudes can cancel. The real engine of any quantum algorithm is interference, arranging the circuit so that amplitudes leading to wrong answers cancel toward zero and amplitudes leading to the right answer reinforce, before a single measurement is taken.
Here is a minimal, fully traced demonstration. Start with the single-qubit state |0⟩ = (1, 0) and apply three gates in sequence: Hadamard, then the phase-flip gate Z = [[1, 0], [0, −1]], then Hadamard again.
Step 1, apply H: H(1, 0) = (1/√2)(1, 1) = (|0⟩ + |1⟩)/√2. The qubit now has equal, nonzero amplitude on both |0⟩ and |1⟩, exactly the state a "parallel guessing" intuition would say is "trying both values."
Step 2, apply Z: Z flips the sign of the |1⟩ component only, giving (1/√2)(1, −1) = (|0⟩ − |1⟩)/√2. The magnitudes of both amplitudes are unchanged; only a relative phase was introduced.
Step 3, apply H again: H · (1/√2)(1, −1). Computing each output component: the |0⟩ amplitude is (1/√2)[(1)(1/√2) + (1)(−1/√2)] = (1/√2)(0) = 0. The |1⟩ amplitude is (1/√2)[(1)(1/√2) + (−1)(−1/√2)] = (1/√2)(√2) = 1. The final state is (0, 1) = |1⟩, exactly.
The qubit started deterministically at |0⟩, passed through a state where both |0⟩ and |1⟩ had equal, nonzero, "present" amplitude, and ended deterministically at |1⟩, with probability exactly 1, not roughly 1. The |0⟩ branch was not randomly discarded; its amplitude was driven to precisely zero by destructive interference between step 1's superposition and the phase step 2 introduced, while the |1⟩ branch was reinforced to amplitude 1 by constructive interference. Nothing was "tried and then one answer picked": the entire computation was one continuous, deterministic reshaping of amplitudes. This is why real quantum algorithms (Grover's search, Shor's factoring, and the variational circuits covered elsewhere in this curriculum) succeed or fail based on whether their designers can engineer this kind of cancellation for the specific problem at hand, not on the size of the superposition alone. A superposition with no engineered interference pattern, measured immediately, just gives you a uniformly random classical string, no faster than guessing.
Getting classical data in: the encoding problem for quantum machine learning
Every quantum machine learning pipeline eventually has to answer a question pure quantum computing courses can skip: how does a classical feature vector, say a row from an ordinary CSV of sensor readings or transaction amounts, become a quantum state? Three standard encodings answer this differently, with different qubit costs.
Basis encoding stores an n-bit classical string directly as a single computational basis state on n qubits, for example 101 becomes |101⟩. It is simple but wastes the exponential state space entirely, since the qubits sit in one definite basis state rather than superposition.
Angle encoding uses a rotation gate to map one real-valued feature onto one qubit's amplitudes. Using the RY rotation, RY(θ) = [[cos(θ/2), −sin(θ/2)], [sin(θ/2), cos(θ/2)]], encode a normalized feature x ∈ [0, 1] by setting θ = πx and applying RY(θ) to |0⟩. Take x = 0.6: θ = 0.6π = 108°, so θ/2 = 54°, giving cos(54°) ≈ 0.58779 and sin(54°) ≈ 0.80902. The encoded qubit is (0.58779, 0.80902), and 0.58779² + 0.80902² ≈ 0.3455 + 0.6545 = 1.0000, confirming a valid normalized state. In code:
import numpy as np
theta = np.pi * 0.6
ry = np.array([[np.cos(theta / 2), -np.sin(theta / 2)],
[np.sin(theta / 2), np.cos(theta / 2)]])
q0 = np.array([1, 0])
print(ry @ q0)
# [0.58778525 0.80901699]
Angle encoding needs one qubit per feature, a linear cost, but each qubit is easy to prepare with a single gate.
Amplitude encoding goes further: it packs 2ⁿ classical numbers directly into the amplitudes of an n-qubit state, needing only log₂(N) qubits for N features rather than N. This sounds like a free exponential compression, and for storage it is, but the circuit that prepares an arbitrary amplitude-encoded state can itself require a number of gates that grows exponentially with n in the worst case. The qubit savings do not automatically translate into a runtime saving; the classical cost of getting the data in can eat the advantage the algorithm gains once it is there. This tradeoff, not hype about qubit counts, is what should be checked first when a QML paper claims a speedup.
There is a second, stricter obstacle to treating quantum states like classical data: the no-cloning theorem (Wootters and Zurek, "A single quantum cannot be cloned," Nature 299, 802-803, 1982). Classical data can be copied for free, which is why a training loop can reuse the same minibatch across epochs without a second thought. Suppose a universal cloning gate U existed, satisfying U(|ψ⟩⊗|0⟩) = |ψ⟩⊗|ψ⟩ for every state |ψ⟩. Since U is a quantum gate it must be linear. Apply it to |ψ⟩ = |0⟩: U(|0⟩|0⟩) = |0⟩|0⟩. Apply it to |ψ⟩ = |1⟩: U(|1⟩|0⟩) = |1⟩|1⟩. Now apply it to |ψ⟩ = (|0⟩+|1⟩)/√2. Linearity forces U(((|0⟩+|1⟩)/√2)⊗|0⟩) = (U(|0⟩|0⟩) + U(|1⟩|0⟩))/√2 = (|00⟩ + |11⟩)/√2, the Bell state. But a true clone of (|0⟩+|1⟩)/√2 would instead be ((|0⟩+|1⟩)/√2) ⊗ ((|0⟩+|1⟩)/√2) = (|00⟩ + |01⟩ + |10⟩ + |11⟩)/2. These are different states (the first has zero amplitude on |01⟩ and |10⟩; the second does not), a contradiction, so no such U exists. Practically, this means a quantum training example cannot be duplicated to take several independent measurements of the same run; each measurement that needs a fresh copy of a quantum state requires re-preparing it from scratch, which is a real, structural cost that has no classical counterpart and one reason quantum machine learning is not a drop-in replacement for classical ML on the same data pipeline.
Active recall
Attempt each question before reading its answer.
1. Write the exact 2-qubit state vector immediately after H is applied to qubit 0 of |00⟩, before CNOT is applied.
2. Repeat the Bell-state circuit (H on q0, then CNOT with q0 as control) but starting from |01⟩ instead of |00⟩. What is the final state? Show the intermediate step.
3. Using the angle-encoding scheme θ = πx with the RY gate, what are the two amplitudes produced for x = 0.3, and do they satisfy normalization?
4. A classmate says: "A 300-qubit quantum computer stores 2³⁰⁰ numbers at once, so it can solve any search problem instantly." Identify the specific error.
5. Show that applying the CNOT gate twice in a row returns any 2-qubit basis state to itself, and explain why this must be true of any valid quantum gate.
6. A general pure state of n qubits needs 2ⁿ complex amplitudes (2ⁿ⁺¹ − 2 independent real numbers once normalization and global phase are accounted for) to specify exactly, versus n bits for a classical register. Compute this real-number count for n = 10 and state what it implies for classically simulating a 10-qubit circuit.
Answers.
1. (H⊗I)|00⟩ = (1/√2)(1, 0, 1, 0), i.e. (|00⟩ + |10⟩)/√2, worked out above as the first column of the H⊗I matrix.
2. |01⟩ = (0, 1, 0, 0). Applying H⊗I: (1/√2)(0, 1, 0, 1), the state (|01⟩ + |11⟩)/√2. Now apply CNOT (control q0): |01⟩ is unaffected since its control bit is 0; |11⟩ maps to |10⟩ since its control bit is 1. Component by component, output index 0 gets input index 0 (value 0), output index 1 gets input index 1 (value 1/√2), output index 2 gets input index 3 (value 1/√2), output index 3 gets input index 2 (value 0). Final state: (0, 1/√2, 1/√2, 0) = (|01⟩ + |10⟩)/√2, a different Bell state (often written |Ψ⁺⟩). Changing only the starting basis state rippled through both the H step and the CNOT step to land on an entirely different entangled pair, not just a relabeled version of the first answer.
3. θ = 0.3π = 54°, θ/2 = 27°. cos(27°) ≈ 0.89101, sin(27°) ≈ 0.45399. Check: 0.89101² + 0.45399² ≈ 0.7939 + 0.2061 = 1.0000, normalized.
4. The error is conflating "the state vector has 2³⁰⁰ nonzero amplitudes" with "you can extract 2³⁰⁰ answers." A measurement of 300 qubits yields exactly one 300-bit classical string; every other amplitude's information is destroyed by the act of measuring, and the no-cloning theorem rules out cheaply re-running the same prepared state many times to sample more of it for free (each repeat needs a fresh state preparation). Worse, without a circuit specifically engineered to interfere destructively on wrong answers and constructively on the right one (as in the H-Z-H example above), a naive superposition measured immediately just returns a uniformly random 300-bit string, no better than guessing. The exponential state space is a resource, not an answer.
5. CNOT swaps |10⟩ ↔ |11⟩ and fixes |00⟩, |01⟩. Applying it twice: |00⟩ → |00⟩ → |00⟩, |01⟩ → |01⟩ → |01⟩, |10⟩ → |11⟩ → |10⟩, |11⟩ → |10⟩ → |11⟩. Every basis state returns to itself, so CNOT² = I, confirming CNOT is its own inverse. This must hold for any legitimate quantum gate because gates are required to be unitary (U†U = I) so that quantum evolution is reversible; a gate that could not be undone would make it impossible, even in principle, to run a computation backward to recover earlier information, which quantum mechanics does not permit for closed-system evolution.
6. For n = 10, 2ⁿ⁺¹ − 2 = 2¹¹ − 2 = 2046 independent real numbers are needed to fully specify the state, against just 10 bits for a classical register describing one definite outcome. A classical simulator that wants to track the full quantum state exactly (not just sample from it) must carry all 2046 numbers through every gate application, and this count doubles with each additional qubit, which is precisely why classically simulating even modest quantum circuits becomes intractable well before industrial-scale qubit counts are reached, and why claims of quantum advantage are checked against how fast this exact classical simulation cost grows, not against the number of qubits alone.
Think About It
Think about this: How would you explain quantum machine learning and quantum computing to a friend who has never seen a computer? What real-world analogy would you use? Imagine you had to build a system using these concepts — what would be your first step? Try this: before moving on, write down three things you learned and one question you still have.
Practice Exercises
Now it is time to practice! Complete these challenges to solidify your understanding:
- Exercise 1: Write a short program that demonstrates the core concept from this chapter. Test it with at least 3 different inputs.
- Exercise 2: Find a real-world example where quantum machine learning and quantum computing is used in an Indian company (like TCS, Infosys, Flipkart, or ISRO). Write a paragraph explaining the connection.
- Exercise 3: Create a mind-map connecting quantum machine learning and quantum computing to at least 3 other topics you have studied.
Key Takeaways — Summary and Recap
Let us recap what we covered: the core ideas behind quantum machine learning and quantum computing, how they connect to real-world applications, and why they matter for your journey in computer science. Remember these key points as you move forward. For competitive exam preparation (CBSE, JEE, BITSAT), focus on understanding the WHY behind each concept, not just the WHAT.