Key identities to memorize:
H|0⟩ = |+⟩, H|1⟩ = |−⟩
HXH = Z, HZH = X
H²= I
CNOT flips target when control = |1⟩
Shortcut: The last qubit starts |1⟩→H gives |−⟩ (the "phase kickback" qubit)
Read it as:
All qubits → H (create superposition)
CNOTs with |−⟩ as target → phase kickback onto control qubits
Final H layer → interference/measurement
Trick: You never need to track the last qubit — it stays |−⟩ throughout. Just track phase kicks on controls.
Shortcut: HXH = Z and HZH = X
Qubit 1: H → X → H = Z effectively
Qubit 2: H → H = Identity (does nothing)
Qubit 3: H → Z → H → X = X·X = I
Trick: Collapse H-gate sandwiches immediately before tracking state.
Shortcut breakdown:
Spot the |1⟩→H = |−⟩ on bottom (kickback qubit again)
Controlled-X gates on qubits 2,4 kick phase back to controls
Middle section: just X gates on selected qubits
Final H layer → read out in computational basis
Master trick: Whenever you see |1⟩→H as ancilla + CNOTs, it's always phase kickback — the oracle flips phase of marked states, no need to track ancilla.
Assignments- Answers
1. Which of the following statements regarding Variational Quantum Algorithms(VQAs) are correct? (Select all that apply)
A1: A shallow and faithful cost function is desirable
A2: Randomly initialized deep Quantum Circuits exhibit Barren Plateau
Answer the following questions 2 and 3, with reference to Fig. 1
2. Select all the statements that hold for UENT and the unitaries U i,j (Θk )
A1: Together, UENT and the unitaries U i,j (Θk ) form the trial state
A2: The state created by these unitaries have both superposition and entanglement.
3. The number of layers d is primarily a function of
A: the available depth or coherence time.
4. Quantum Generative Adversarial Networks (QGANs) consists of:
Anss: Generator, Discriminator
5. Which of the following statements is an accurate description of the phenomenon of decoherence?
A1: Decoherence causes a pure quantum state to transform into an incoherent mixture of multiplestates.
A2: Decoherence is caused when a quantum system is coupled to a bath or environment and the joint system evolves via a unitary transformation.
6. Select all the options that apply to the three-qubit quantum error correcting code
A1: The three-qubit code assumes that the bit-flip noise occurs identically and independently on the encoded qubits.
A2: The bit-flip noise flips the qubit with some probability p and leaves it untouched with probability 1 − p.
A3: The encoding transforms the state α|0⟩ + β|1⟩ to (α|000⟩ + β|111⟩) where |α|2 + |β|2 = 1.
7. Let S1 and S2 denote the syndrome bits at the end of the 3-qubit bit-flip quantum error correction protocol. Match the syndrome bit values to their respective recovery gates.
Syndrome ---> Recovery gates
(0,1) --> I ⊕ I ⊕ X
(1,1)---> X ⊕ I ⊕ I
(1,0)---> I ⊕ X ⊕ I
shortcut (11= XII, 01= IIX, 10=IXI)
8. Analyse the following 7-qubit circuit and answer the question. What is the probability for all of the first 6 wires to output 0 when measured at the end of this circuit?
Ans: 1
9. Consider the encoded (or logical) state |ψL ⟩ = α|000⟩ + β|111⟩ subject to a quantum noise channel where each qubit can undergo a bit flip with probability p. The exact probability that the 3-qubit bit-flip quantum error correcting code fails to recover the original state is given by x ⋅ py ⋅ (1 − p)z + p3 , where p is the bit-flip probability and x, y, z are the variables to be identified. The value of y ⋅ x + z________. (here, ⋅ denotes multiplication)
Ans: 7
10. Consider a 3-qubit state in the {|+⟩, |−⟩} basis, of the form 1 (|+ + +⟩ + |− − −⟩) . Which of the following sets of errors can be detected on this state?
Ans: {ZII, IZI, IIZ}
1. Consider |X⟩=|XN−1XN−2…X1X0⟩, a N-qubit state, is there a simple unitary U^ such that: U^|X⟩=|ψ⟩=12N√∑Y∈{0,1}N(−1)X⋅Y|Y⟩
where X⋅Y denotes the mod 2 bitwise inner product X⋅Y=(XN−1⋅YN−1)⊕(XN−2⋅YN−2)⊕⋯⊕(X1⋅Y1)⊕(X0⋅Y0) Starting from the state |ψ⟩, can one get complete information of X by applying some unitary gates followed by measurement?
Ans: U^=H^⊗N, Yes we can get information about X starting from |ψ⟩ by using H^⊗N followed by measurement.
2. In the Deutsch-Jozsa problem, what is the minimum number of queries a classical deterministic algorithm must make to determine with 100% certainty whether a function of input size n is constant or balanced?
Ans: 1+ 2^(n−1)
3. What are the possible outputs when the first 3 qubits are measured at the end of the circuit? Follow qiskit ordering
Ans: |010⟩, |110⟩
4. Which properties of a quantum mechanical system are exploited by both the Deutsch-Jozsa and Bernstein-Vazirani algorithms to encode the function’s output f(x) onto the phase of the input state?
Anss: Phase Kickback, Superposition
5. What is the expected output when the qubits are measured at the end of the circuit
Ans: |000⟩
6. What is the probability for all the first 4 wires to output 0 when measured at the end of the following circuit?
Ans: 0
7. How does the quantum circuit for the Bernstein-Vazirani algorithm fundamentally compare to the circuit for the Deutsch-Jozsa algorithm?
Ans: It is identical in structure, differing only in the function implemented by the oracle.
8. How is the reflection about the uniform superposition state |u⟩ (the Grover diffuser) constructed?
Ans: By transforming |u⟩ to |0...0⟩ with Hadamard gates, reflecting about |0...0⟩, and transforming back
9. What does the following quantum circuit represent?
Ans: Deutsch-Jozsa with Constant Function Oracle
10. The geometric interpretation of Grover’s algorithm involves a rotation within a 2D plane. Which two orthogonal basis vectors span this plane?
Ans: The target state |a⟩ and a uniform superposition of all non-target states, |e⟩.
1. Which of the following are Qiskit Runtime primitives currently available on the IBM Quantum Platform?
Ans: Sampler, Estimator
2. According to the IBM Quantum Composer documentation, which version of Open-QASM is currently supported for writing quantum circuits in the code editor?
Ans: OpenQASM 2.0
3. Which statement correctly describes the difference between the Sampler and Estimator primitives in Qiskit?
Ans: Sampler <--- measurement outcome distributions ---- circuit, Estimator <--- expectation values of specified observables
4. In the transpilation process, which of the following steps are NOT performed to prepare a quantum circuit for execution on real quantum hardware?
Anss: Converting all gates to Hadamard and CNOT gates only
5. Using IBM Quantum Composer, create a 3-qubit circuit starting in state |000⟩. Apply a rotation gate Ry(π3) to the first qubit (q[0]). After running the circuit and viewing the statevector visualization, which of the following images correctly represents the resulting quantum state?
Ans:
6. Create a 3-qubit GHZ state by applying a Hadamard gate to q[0], followed by CNOT gates from q[0] to q[1] and q[0] to q[2]. Visualize the density matrix using the state city representation. Which of the following images correctly shows the real and imaginary components of the density matrix?
Ans:
7. Starting with the initial state |ψ⟩=12(|00⟩+|01⟩+|10⟩+|11⟩), apply a CNOT gate with control qubit q[0] and target qubit q[1], followed by a Hadamard gate on q[0]. What is the resulting quantum state?
Ans: (√2/2)(|00⟩+|10⟩)
8. Apply a rotation gate Ry(2π3) to the first qubit of state |000⟩, followed by a CNOT from qubit 0 to qubit 1. What is the resulting quantum state?
Ans: (1/2)|000⟩+(√3|2) 011⟩
9. In a quantum teleportation protocol, Bob applies correction gates based on the 2-bit classical message from Alice. If Bob’s gate sequences in four trials are: (I, I), (Z, I), (X, I), and (XZ, I), what are the corresponding 2-bit messages Alice sent?
Ans:00, 01, 10, 11
10. Alice and Bob share an entangled state (1/√2)(|01⟩+|10⟩). If Alice measures her qubit in the computational basis and obtains result |0⟩, what is the state of Bob’s qubit after Alice’s measurement?
Ans: |1⟩
1. Recall the Bloch sphere (geometric) representation of a qubit system, where in the state of a qubit is parameterized by two angles θ and ϕ, as
|ψ⟩=(cosθ2)|0⟩+eiϕ(sinθ2)|1⟩. What are the values of the angles θ and ϕ for the state |ψ⟩=((1+i)/2–√(1−i)/2–√) ?
Ans: Sampler, Estimator
2. The state |ϕ⟩=(1+i4)|0⟩+(3−i4)|1⟩ is measured in the {|+⟩,|−⟩} basis (also called the Hadamard basis). What is the probability of obtaining |+⟩ as the measurement result?
Ans: 2/3
3. Which of the following gate sequences adds a relative phase of π between |0⟩ and |1⟩ ?
Ans: ZSSSS, XYZZ
4.Suppose the state |+⟩=|0⟩+|1⟩2–√, is transformed via a quantum gate of the form P=|0⟩⟨0|+eiϕ|1⟩⟨1|. Find the angle ϕ such that, after the action of the gate, the probability of obtaining |+⟩ is 1/√2.
Anss: ϕ = π/2
5. Which of the circuits below implement the following operation?
Ans:
6.Which of these are valid quantum gates?
Ans: (100eπi/4)
⎛⎝12√12√−i2√i2√⎞⎠
(e−πi/300eπi/3)
7. Which of these circuits implement the transformation |00⟩→12√|00⟩−12√|11⟩?
Ans: (√2/2)(|00⟩+|10⟩)
8. Which of the following pairs of quantum states can be perfectly distinguished?
Ans: (1/2)|000⟩+(√3|2) 011⟩
9.Which of the following states are equivalent to |ψ⟩=cosπ4|0⟩+eiπ/3sinπ4|1⟩ physically?
Ans:(a)eiπ2cosπ4|0⟩+ei(π3+π2)sinπ4|1⟩
(c)−cosπ4|0⟩−eiπ3sinπ4|1⟩
10Consider the following single-qubit rotation gates:
Ans: ϕ=π/4, α=β=π/2, θ=π/4.