Title: CertiQ — C1000-179 / 1 · Perform quantum operations

Question: What is the statevector of the qubit after this circuit runs, in the computational basis [amp(|0⟩), amp(|1⟩)]?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(1)
qc.h(0)
qc.s(0)
print(Statevector.from_instruction(qc))
A.[0.7071, 0.7071] — equal superposition with no relative phase
B.[0.7071, 0.7071j] — equal superposition with a relative phase of i on |1⟩
C.[0.7071, -0.7071j] — equal superposition with a relative phase of −i on |1⟩
D.[0.7071j, 0.7071] — phase i applied to the |0⟩ amplitude
Answer: Correct: B
H maps |0⟩ to (|0⟩+|1⟩)/√2. The S gate is the phase gate diag(1, i): it leaves |0⟩ alone and multiplies the |1⟩ amplitude by i, giving (|0⟩ + i|1⟩)/√2 = [0.7071, 0.7071j].
References
- quantum.cloud.ibm.com/docs/guides/construct-circuits
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q001 · predict-output · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: In Qiskit, which two-qubit operator does Pauli('XZ') represent?
from qiskit.quantum_info import Pauli
p = Pauli('XZ')
print(p.to_matrix())
A.A single-qubit matrix X·Z = −iY; the label is a matrix product, not a tensor product
B.X ⊗ Z — Pauli X acts on qubit 1 and Pauli Z acts on qubit 0
C.Z ⊗ X — Pauli X acts on qubit 0 and Pauli Z acts on qubit 1
D.The 4×4 identity, because X and Z appear in different tensor factors
Answer: Correct: B
A Pauli label is read right-to-left: the rightmost character is qubit 0 and the leftmost is the highest-index qubit. So Pauli('XZ') is X on qubit 1 tensored with Z on qubit 0, i.e. the 4×4 matrix np.kron(X, Z).
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q010 · predict-output · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: For Pauli('IX') on a two-qubit system, which qubit does the X act on, and what operator is built?
from qiskit.quantum_info import Pauli
print(Pauli('IX').to_matrix())
A.X on both qubits, since the identity 'passes through' and copies the X
B.Nothing — 'IX' is an invalid Pauli label and raises an error
C.X on qubit 0 (I ⊗ X): the rightmost label character maps to the lowest-index qubit
D.X on qubit 1 (X ⊗ I): the leftmost label character maps to qubit 0
Answer: Correct: C
Pauli labels are little-endian: the rightmost character is qubit 0. So Pauli('IX') puts identity on qubit 1 and X on qubit 0, giving I ⊗ X.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q012 · mcq · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: The .dot method returns the operator product A·B and tracks the resulting phase. What does this print?
from qiskit.quantum_info import Pauli
result = Pauli('X').dot(Pauli('Y'))
print(result.to_label())
A.iY — the product stays on the letter Y
B.iZ — X·Y = iZ
C.-iZ — X·Y = −iZ
D.Z — the product is Z and the phase is discarded
Answer: Correct: B
The Pauli matrices obey X·Y = iZ. The Pauli class keeps track of the ± i phase factor, so .to_label() returns 'iZ'.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q013 · predict-output · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: Using .dot (the operator product A·B, which tracks the ± i phase), which of the following single-qubit Pauli identities are TRUE? Select all that apply.
from qiskit.quantum_info import Pauli
# e.g. Pauli('X').dot(Pauli('Y')).to_label()
A.X · Y = iZ
B.Y · Z = iX
C.Z · X = iY
D.X · Z = iY
E.Y · X = iZ
Answer: Correct: A, B, C
The cyclic products carry a +i phase: X·Y = iZ, Y·Z = iX, Z·X = iY. Reversing the order flips the sign of the phase.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q014 · multi · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: For the three-qubit operator Pauli('XYZ'), which qubit does the Z factor act on?
from qiskit.quantum_info import Pauli
p = Pauli('XYZ')
print(p.to_matrix().shape)
A.Qubit 2 — the leftmost label character maps to the lowest-index qubit
B.Qubit 1 — Z is the middle factor
C.All three qubits — Z is applied globally
D.Qubit 0 — the rightmost label character maps to the lowest-index qubit
Answer: Correct: D
Qiskit reads Pauli labels right-to-left. In 'XYZ' the rightmost character (Z) is qubit 0, Y is qubit 1, and X is qubit 2. So Z acts on qubit 0.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q015 · mcq · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: What matrix does Pauli('X').tensor(Pauli('Y')) produce?
from qiskit.quantum_info import Pauli
op = Pauli('X').tensor(Pauli('Y'))
print(op.to_label())
A.X ⊗ Y (label 'XY') — tensor places the first operand on the higher-index qubit
B.Y ⊗ X (label 'YX') — tensor places the first operand on qubit 0
C.X ⊗ X (label 'XX')
D.The 4×4 identity
Answer: Correct: A
a.tensor(b) returns a ⊗ b, with a on the higher-index qubit and b on qubit 0. So Pauli('X').tensor(Pauli('Y')) is X ⊗ Y, label 'XY'.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q016 · predict-output · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: Two Pauli operators commute when reordering them leaves the product unchanged. Which of the following pairs COMMUTE? Select all that apply.
from qiskit.quantum_info import Pauli
# e.g. Pauli('XX').commutes(Pauli('ZZ'))
A.X⊗X and Z⊗Z
B.X⊗I and Z⊗Z
C.X⊗Z and Z⊗X
D.I⊗X and Z⊗I
E.X and Z (single qubit)
Answer: Correct: A, C, D
Two multi-qubit Paulis commute when they anticommute on an EVEN number of qubits. A⊗B and C⊗D commute iff (an even count of the single-qubit factor pairs anticommute). X⊗X vs Z⊗Z: X,Z anticommute on both qubits (even) -> commute. X⊗Z vs Z⊗X: anticommute on both (even) -> commute. I⊗X vs Z⊗I: factors act on disjoint qubits, no anticommuting pair -> commute.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q017 · multi · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: What does this code print?
from qiskit.quantum_info import SparsePauliOp
op = SparsePauliOp.from_list([("Z", 1), ("Z", 2), ("X", 1)])
print(op.simplify())
A.SparsePauliOp(['Z', 'X'], coeffs=[2, 1]) — duplicate 'Z' terms are dropped, keeping the largest
B.SparsePauliOp(['Z', 'X'], coeffs=[3, 2]) — every coefficient is summed together
C.SparsePauliOp(['Z', 'X'], coeffs=[3, 1]) — like terms are summed
D.SparsePauliOp(['Z', 'Z', 'X'], coeffs=[1, 2, 1]) — from_list already merged, so simplify does nothing
Answer: Correct: C
simplify() combines repeated Pauli terms by summing their coefficients: the two 'Z' terms (1 + 2) become 3, and 'X' stays 1, yielding coeffs [3, 1].
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q018 · predict-output · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: What is the expectation value of the observable O = Z⊗Z + 0.5·(X⊗X) in the state |00⟩?
from qiskit.quantum_info import Statevector, SparsePauliOp
O = SparsePauliOp.from_list([("ZZ", 1.0), ("XX", 0.5)])
psi = Statevector.from_label("00")
print(psi.expectation_value(O))
A.1.5 — both terms contribute their full coefficient
B.0.0 — the two Pauli strings cancel
C.0.5 — only the X⊗X term contributes
D.1.0 — ⟨ZZ⟩ = 1 on |00⟩ and ⟨XX⟩ = 0
Answer: Correct: D
|00⟩ is a +1 eigenstate of Z⊗Z, so ⟨ZZ⟩ = 1. X⊗X flips |00⟩ to |11⟩, which is orthogonal to |00⟩, so ⟨XX⟩ = 0. The total is 1·1 + 0.5·0 = 1.0.
References
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
- quantum.cloud.ibm.com/docs/guides/operators-overview
Meta: s1-q019 · predict-output · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: This code is meant to build the two-qubit operator that applies Pauli Z to qubit 0 and leaves qubit 1 unchanged (i.e. I ⊗ Z). It builds the wrong operator. What is the correct fix?
from qiskit.quantum_info import Pauli
# want: Z on qubit 0, identity on qubit 1
op = Pauli('ZI')
A.Replace it with Pauli(['Z', 'I']) — multi-qubit labels must be passed as a list
B.Replace it with Pauli('IZ') — the rightmost character is qubit 0, so Z must be on the right
C.Nothing — 'ZI' already puts Z on qubit 0
D.Replace it with Pauli('ZZ') — you must specify Z on both positions
Answer: Correct: B
Pauli labels are little-endian: the rightmost character is qubit 0. To place Z on qubit 0 you write Pauli('IZ') (identity on qubit 1, Z on qubit 0). The original 'ZI' does the opposite — Z on qubit 1.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q020 · spot-bug · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: What does Pauli('Z').dot(Pauli('X')) evaluate to (.dot is the product Z·X, keeping the phase)?
from qiskit.quantum_info import Pauli
print(Pauli('Z').dot(Pauli('X')).to_label())
A.iY — Z·X = iY
B.-iY — Z·X = −iY
C.iX — the product stays on the letter X
D.Y — the product is Y with no phase
Answer: Correct: A
The cyclic Pauli products carry +i: X·Y = iZ, Y·Z = iX, and Z·X = iY. So Pauli('Z').dot(Pauli('X')) returns 'iY'.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q021 · predict-output · Difficulty 3/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: A qubit is prepared in |1⟩, then a T gate is applied. What is the resulting statevector [amp(|0⟩), amp(|1⟩)]?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(1)
qc.x(0)
qc.t(0)
print(Statevector.from_instruction(qc))
A.[0, i] — T applies a phase of i to |1⟩
B.[0.7071, 0.7071j] — T turns |1⟩ into a superposition
C.[0, e^{iπ/4}] ≈ [0, 0.7071+0.7071j] — T multiplies the |1⟩ amplitude by e^{iπ/4}
D.[0, 1] — T leaves |1⟩ unchanged because it is a phase gate
Answer: Correct: C
T = diag(1, e^{iπ/4}). Acting on |1⟩ it multiplies the amplitude by e^{iπ/4} = 0.7071 + 0.7071j, so Statevector records [0, e^{iπ/4}]. Because the |0⟩ amplitude is 0 here, this factor is actually an unobservable global phase (the measurement probabilities stay [0, 1]) — but Qiskit's statevector still carries it explicitly, which is why the amplitude is not a bare 1.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q022 · predict-output · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: What state results from applying a Z gate to |+⟩ = (|0⟩ + |1⟩)/√2?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(1)
qc.h(0)   # prepare |+>
qc.z(0)
print(Statevector.from_instruction(qc))
A.[0.7071, 0.7071j] — Z adds a phase of i to |1⟩
B.|−⟩ = (|0⟩ − |1⟩)/√2 ≈ [0.7071, −0.7071]
C.|+⟩ unchanged ≈ [0.7071, 0.7071]
D.|1⟩ = [0, 1]
Answer: Correct: B
Z = diag(1, −1) flips the sign of the |1⟩ amplitude, mapping |+⟩ = (|0⟩+|1⟩)/√2 to |−⟩ = (|0⟩−|1⟩)/√2 ≈ [0.7071, −0.7071].
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q023 · predict-output · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: The goal is to prepare the state (|0⟩ − i|1⟩)/√2. The code below produces the wrong relative phase on |1⟩. What is the fix?
from qiskit import QuantumCircuit
qc = QuantumCircuit(1)
qc.h(0)
qc.s(0)   # intended: relative phase of -i on |1>
A.Nothing — S already applies the −i phase to |1⟩
B.Replace qc.s(0) with qc.z(0) — Z supplies the −i phase
C.Replace qc.s(0) with qc.t(0) — T supplies the −i phase
D.Replace qc.s(0) with qc.sdg(0) — S applies +i, but S† (sdg) applies the −i phase
Answer: Correct: D
S = diag(1, i) applies a +i phase, producing (|0⟩ + i|1⟩)/√2 — the opposite of the target. The inverse gate S† (sdg) = diag(1, −i) gives the desired (|0⟩ − i|1⟩)/√2.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q024 · spot-bug · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: What is the statevector after applying the √X gate (sx) to |0⟩?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(1)
qc.sx(0)
print(Statevector.from_instruction(qc))
A.[0.5+0.5j, 0.5−0.5j] — √X is the 'square root of NOT'
B.[0, 1] = |1⟩ — √X is just another name for X
C.[0.7071, 0.7071] = |+⟩ — √X creates an equal real superposition
D.[0.7071, 0.7071j] — equal magnitudes with a phase i on |1⟩
Answer: Correct: A
SX = ½[[1+i, 1−i], [1−i, 1+i]]. Applied to |0⟩ it gives [0.5+0.5j, 0.5−0.5j]. Applying SX twice reproduces X, which is why it is the 'square root of NOT'; a single application yields equal 0.5/0.5 probabilities but with complex amplitudes.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q025 · predict-output · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: What is the statevector after applying rz(π/2) to |0⟩? (Qiskit defines RZ(θ) = diag(e^{−iθ/2}, e^{iθ/2}).)
import numpy as np
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(1)
qc.rz(np.pi / 2, 0)
print(Statevector.from_instruction(qc))
A.[0.7071, 0.7071j] — RZ rotates |0⟩ into a superposition
B.[e^{+iπ/4}, 0] ≈ [0.7071+0.7071j, 0] — the |0⟩ phase is +θ/2
C.[e^{−iπ/4}, 0] ≈ [0.7071−0.7071j, 0] — RZ multiplies |0⟩ by e^{−iθ/2}
D.[1, 0] — RZ has no effect on |0⟩ at all
Answer: Correct: C
RZ(θ) = diag(e^{−iθ/2}, e^{iθ/2}). On |0⟩ it multiplies the amplitude by e^{−iθ/2} = e^{−iπ/4} = 0.7071 − 0.7071j. Because |0⟩ is an eigenstate, this is a global phase — the measurement probabilities are unchanged — but Statevector.from_instruction still records it.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q026 · predict-output · Difficulty 3/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: You build a circuit and set qc.global_phase = np.pi / 4 (no other change), then sample it many times on a simulator. How does the global phase affect the measured bitstring counts?
import numpy as np
from qiskit import QuantumCircuit
qc = QuantumCircuit(1)
qc.h(0)
qc.global_phase = np.pi / 4   # multiplies the whole statevector by e^{i pi/4}
qc.measure_all()
A.It raises an error at run time, because a global phase leaves the state un-normalized
B.Not at all — a global phase multiplies the entire statevector by e^{iπ/4}, which is physically unobservable, so every measurement probability is unchanged
C.The relative frequencies shift toward outcome 1, because the phase adds amplitude to |1⟩
D.It rotates the qubit by π/4, changing the measurement probabilities like an RY(π/4) would
Answer: Correct: B
A global phase multiplies every amplitude by the same unit-modulus factor e^{iθ}. Since measurement probabilities are |amplitude|², the common factor cancels, so the counts are statistically identical to the phase-free circuit. Global phase is physically unobservable.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q027 · mcq · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: What is the statevector after applying p(π/2) (the phase gate P) to |1⟩?
import numpy as np
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(1)
qc.x(0)
qc.p(np.pi / 2, 0)
print(Statevector.from_instruction(qc))
A.[0, 1] — P only adds a phase to |0⟩, so |1⟩ is unchanged
B.[0, −1] — the phase is e^{iπ} = −1
C.[i, 0] — the phase is applied to the |0⟩ amplitude
D.[0, i] — P(π/2) = diag(1, e^{iπ/2}) multiplies |1⟩ by i (P(π/2) is the S gate)
Answer: Correct: D
P(θ) = diag(1, e^{iθ}) puts the phase on the |1⟩ amplitude. With θ = π/2 that is e^{iπ/2} = i, so |1⟩ → i|1⟩ = [0, i]. P(π/2) is exactly the S gate.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q028 · predict-output · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: What is the statevector after applying a Y gate to |0⟩?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(1)
qc.y(0)
print(Statevector.from_instruction(qc))
A.[0, i] — Y|0⟩ = i|1⟩
B.[0, 1] = |1⟩ — Y is just a bit flip like X
C.[0, −i] — Y|0⟩ = −i|1⟩
D.[i, 0] — Y|0⟩ = i|0⟩
Answer: Correct: A
Y = [[0, −i], [i, 0]]. Acting on |0⟩ (the first column) it returns [0, i] = i|1⟩. Y flips the bit AND multiplies by i.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q029 · predict-output · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: For Statevector.from_label('10') on a two-qubit system, which computational-basis amplitude is 1?
from qiskit.quantum_info import Statevector
print(Statevector.from_label('10').data)
A.Index 3: the state |11⟩
B.Index 0: the state |00⟩
C.Index 2: the state |q1 q0⟩ = |10⟩ — qubit 1 is 1 and qubit 0 is 0
D.Index 1: label '10' means qubit 0 = 1 and qubit 1 = 0
Answer: Correct: C
from_label reads the string left-to-right as |q_{n-1} … q_0⟩. So '10' means qubit 1 = 1, qubit 0 = 0, which is the basis state with integer index 2 (binary 10). The amplitude at index 2 is 1.
References
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
- quantum.cloud.ibm.com/docs/guides/operators-overview
Meta: s1-q030 · predict-output · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: A two-qubit circuit applies X to qubit 0 only. What does probabilities_dict() of the resulting statevector return?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(2)
qc.x(0)
print(Statevector.from_instruction(qc).probabilities_dict())
A.{'10': 1.0} — qubit 0 is the leftmost bit in the string
B.{'11': 1.0} — X flips both qubits
C.{'00': 1.0} — X on qubit 0 has no measurable effect
D.{'01': 1.0} — bitstrings are ordered q1q0, so flipping qubit 0 gives '01'
Answer: Correct: D
Qiskit orders bitstrings as q_{n-1}…q_0, so the rightmost character is qubit 0. Flipping only qubit 0 of |00⟩ gives the bitstring '01' with probability 1.
References
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
- quantum.cloud.ibm.com/docs/guides/operators-overview
Meta: s1-q031 · predict-output · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: A circuit applies qc.cx(0, 1) (control = qubit 0, target = qubit 1). Writing states as |q1 q0⟩, which basis-state transformation does it implement?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Operator
qc = QuantumCircuit(2)
qc.cx(0, 1)
print(Operator(qc).data.real)
A.|11⟩ → |00⟩: both qubits flip when both are 1
B.|01⟩ → |11⟩ and |11⟩ → |01⟩; |00⟩ and |10⟩ unchanged (target qubit 1 flips when control qubit 0 = 1)
C.|10⟩ → |11⟩ and |11⟩ → |10⟩ (qubit 1 flips whenever qubit 1 is already 1)
D.|10⟩ → |01⟩: the gate simply swaps the two qubits
Answer: Correct: B
With control = qubit 0, the target (qubit 1) is flipped exactly when qubit 0 = 1. In |q1 q0⟩ notation, qubit 0 = 1 holds for |01⟩ and |11⟩, so |01⟩ ↔ |11⟩ while |00⟩ and |10⟩ (qubit 0 = 0) are untouched.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q032 · mcq · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: Operator.__eq__ (==) tests exact matrix equality, while Operator.equiv tests equality up to a global phase. For which of the following pairs does Operator(a).equiv(Operator(b)) return True? Select all that apply.
import numpy as np
from qiskit import QuantumCircuit
from qiskit.quantum_info import Operator
# a: e.g. QuantumCircuit with z(0); b: with rz(pi, 0)
A.a = X gate, b = Y gate
B.a = Z gate, b = RZ(π)
C.a = X gate, b = RX(π)
D.a = H gate, b = Z gate
Answer: Correct: B, C
RZ(π) = diag(e^{−iπ/2}, e^{iπ/2}) = −i·Z, so it equals Z up to the global phase −i → equiv is True (though == is False). Likewise RX(π) = −i·X, equivalent to X up to a global phase. Both pass .equiv().
References
- quantum.cloud.ibm.com/docs/guides/operator-class
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q033 · multi · Difficulty 3/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: What does Statevector.from_label('0').evolve(Pauli('X')) produce?
from qiskit.quantum_info import Statevector, Pauli
sv = Statevector.from_label('0').evolve(Pauli('X'))
print(sv.data)
A.|1⟩ = [0, 1] — X flips |0⟩ to |1⟩
B.|0⟩ = [1, 0] — evolve returns the operator applied later, leaving the state as |0⟩
C.|+⟩ = [0.7071, 0.7071]
D.[0, i] — X applies a phase as well as a flip
Answer: Correct: A
Statevector.evolve(op) returns a new statevector with op applied. X maps |0⟩ to |1⟩, so the result is [0, 1].
References
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
- quantum.cloud.ibm.com/docs/guides/operators-overview
Meta: s1-q034 · predict-output · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: For a = Statevector.from_label('0') and b = Statevector.from_label('1'), what is a.tensor(b)?
from qiskit.quantum_info import Statevector
a = Statevector.from_label('0')
b = Statevector.from_label('1')
print(a.tensor(b).data)
A.|10⟩ (a 1 at index 2): tensor puts a on qubit 0 and b on the higher qubit
B.|11⟩ (a 1 at index 3): both qubits are set
C.the zero vector [0,0,0,0]: tensoring orthogonal states vanishes
D.|01⟩ (a 1 at index 1): tensor puts a on the higher-index qubit and b on qubit 0
Answer: Correct: D
a.tensor(b) = a ⊗ b places the caller a on the higher-index qubit (qubit 1) and b on qubit 0. With a = |0⟩ and b = |1⟩ that is |q1 q0⟩ = |01⟩, a single 1 at index 1.
References
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
- quantum.cloud.ibm.com/docs/guides/operators-overview
Meta: s1-q035 · predict-output · Difficulty 3/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: This code tries to read the statevector of a circuit but raises an error. What is the true cause and correct fix?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(1, 1)
qc.h(0)
qc.measure(0, 0)
sv = Statevector.from_instruction(qc)
A.The number of shots defaults to 0; set shots=1024 so the measurement resolves
B.Statevector cannot represent a superposition; use DensityMatrix.from_instruction instead
C.Measurement is not a unitary and adds classical bits; build the statevector from the measurement-free circuit (drop measure)
D.from_instruction needs a backend; pass backend=AerSimulator() to it
Answer: Correct: C
Statevector.from_instruction simulates unitary evolution and cannot process a measure (which is non-unitary and involves classical bits). The fix is to remove the measurement and take the statevector of the pure-unitary circuit.
References
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
- quantum.cloud.ibm.com/docs/guides/operators-overview
Meta: s1-q036 · spot-bug · Difficulty 3/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: A two-qubit circuit applies H to qubit 0 only. As a tensor product, what is Operator(qc)?
import numpy as np
from qiskit import QuantumCircuit
from qiskit.quantum_info import Operator
qc = QuantumCircuit(2)
qc.h(0)
print(np.round(Operator(qc).data, 3))
A.a 2×2 matrix H — the idle qubit is dropped from the operator
B.I ⊗ H — the operator on qubit 0 sits on the RIGHT of the tensor product
C.H ⊗ I — the operator on qubit 0 sits on the LEFT of the tensor product
D.H ⊗ H — H is applied to both qubits
Answer: Correct: B
Qiskit's little-endian convention puts qubit 0 on the RIGHT of the tensor product. A gate on qubit 0 with the other qubit idle is therefore I ⊗ H, a 4×4 operator.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/guides/operator-class
Meta: s1-q037 · predict-output · Difficulty 3/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: What state does Statevector.from_int(2, dims=4) create for a two-qubit system?
from qiskit.quantum_info import Statevector
print(Statevector.from_int(2, dims=4).data)
A.|10⟩ — a 1 at index 2 (binary 10): qubit 1 = 1, qubit 0 = 0
B.|01⟩ — the integer 2 sets qubit 0 to 1
C.|2⟩ of a single 4-level qudit; not a valid two-qubit basis state
D.an equal superposition of two basis states, because dims=4
Answer: Correct: A
from_int(2, dims=4) creates the basis state whose integer index is 2 in a 4-dimensional (two-qubit) space: a single amplitude 1 at index 2, i.e. |10⟩ (qubit 1 = 1, qubit 0 = 0).
References
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
- quantum.cloud.ibm.com/docs/guides/operators-overview
Meta: s1-q038 · predict-output · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: A qubit starts in |0⟩ and an RY(π/3) rotation is applied. What is the probability of measuring outcome 1?
import numpy as np
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(1)
qc.ry(np.pi / 3, 0)
print(Statevector.from_instruction(qc).probabilities())
A.0.75 = cos²(π/6) — P(1) = cos²(θ/2)
B.0.5 — any nonzero rotation yields an equal superposition
C.1.0 — RY(π/3) rotates |0⟩ all the way to |1⟩
D.0.25 = sin²(π/6) — for RY(θ)|0⟩, P(1) = sin²(θ/2)
Answer: Correct: D
RY(θ)|0⟩ = cos(θ/2)|0⟩ + sin(θ/2)|1⟩, so P(1) = sin²(θ/2). With θ = π/3, sin²(π/6) = 0.5² = 0.25.
References
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
- quantum.cloud.ibm.com/docs/guides/operators-overview
Meta: s1-q039 · predict-output · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: For the state RY(π/3)|0⟩, what is the expectation value ⟨Z⟩?
import numpy as np
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector, Pauli
qc = QuantumCircuit(1)
qc.ry(np.pi / 3, 0)
sv = Statevector.from_instruction(qc)
print(sv.expectation_value(Pauli('Z')))
A.0.25 — ⟨Z⟩ equals P(1) = sin²(θ/2)
B.0.866 = cos(π/6) = cos(θ/2)
C.0.5 = cos(π/3) — ⟨Z⟩ = cos θ for RY(θ)|0⟩
D.−0.5 — ⟨Z⟩ = −cos θ
Answer: Correct: C
For RY(θ)|0⟩ the populations are cos²(θ/2) on |0⟩ and sin²(θ/2) on |1⟩, so ⟨Z⟩ = cos²(θ/2) − sin²(θ/2) = cos θ. With θ = π/3, cos(π/3) = 0.5.
References
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
- quantum.cloud.ibm.com/docs/guides/operators-overview
Meta: s1-q040 · predict-output · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: A Bell circuit applies H to qubit 0 then CX(0, 1). What does probabilities_dict() of the resulting statevector return?
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).probabilities_dict())
A.{'00': 0.5, '11': 0.5} — the two qubits are perfectly correlated
B.{'00': 0.25, '01': 0.25, '10': 0.25, '11': 0.25} — all four outcomes equally likely
C.{'01': 0.5, '10': 0.5} — the qubits are anti-correlated
D.{'00': 1.0} — CX has no effect after H
Answer: Correct: A
H puts qubit 0 into |+⟩, then CX entangles the qubits into (|00⟩ + |11⟩)/√2. Measuring gives '00' or '11', each with probability 0.5 — perfect correlation.
References
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
- quantum.cloud.ibm.com/docs/guides/operators-overview
Meta: s1-q041 · predict-output · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: For the Bell state (|00⟩ + |11⟩)/√2, what does sv.probabilities([0]) (the marginal distribution over qubit 0) return?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
sv = Statevector.from_instruction(qc)
print(sv.probabilities([0]))
A.[0.7071, 0.7071] — it returns amplitudes, not probabilities
B.[0.5, 0.5] — qubit 0 on its own is 0 or 1 with equal probability
C.[1.0, 0.0] — qubit 0 is always measured as 0
D.[0.5, 0, 0, 0.5] — probabilities([0]) still returns all four joint outcomes
Answer: Correct: B
Passing a qubit list to probabilities marginalizes over the rest. Qubit 0 of the Bell state is maximally mixed, so its marginal is [0.5, 0.5] (a length-2 vector for one qubit).
References
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
- quantum.cloud.ibm.com/docs/guides/operators-overview
Meta: s1-q042 · predict-output · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: What is the expectation value ⟨Z⟩ for the state |1⟩?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector, Pauli
qc = QuantumCircuit(1)
qc.x(0)   # prepare |1>
sv = Statevector.from_instruction(qc)
print(sv.expectation_value(Pauli('Z')))
A.+1 — |1⟩ is the +1 eigenstate of Z
B.0 — the measurement outcome is random
C.undefined — |1⟩ is not an eigenstate of Z
D.−1 — |1⟩ is the −1 eigenstate of Z
Answer: Correct: D
Z = diag(1, −1). |1⟩ is its eigenvector with eigenvalue −1, so ⟨1|Z|1⟩ = −1.
References
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
- quantum.cloud.ibm.com/docs/guides/operators-overview
Meta: s1-q043 · predict-output · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: The qubit is in the state |+⟩ = H|0⟩. Which of the following statements are TRUE? Select all that apply.
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector, Pauli
qc = QuantumCircuit(1)
qc.h(0)   # |+>
sv = Statevector.from_instruction(qc)
A.⟨Y⟩ = +1
B.⟨Z⟩ = 0
C.⟨X⟩ = +1
D.A Z-basis measurement yields outcome 1 with probability 1
E.|+⟩ is an eigenstate of X with eigenvalue +1
Answer: Correct: B, C, E
|+⟩ is the +1 eigenstate of X, so ⟨X⟩ = +1 and X|+⟩ = |+⟩ (statements C and E). Its Z-basis populations are equal, so ⟨Z⟩ = 0 (statement B).
References
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
- quantum.cloud.ibm.com/docs/guides/operators-overview
Meta: s1-q044 · multi · Difficulty 3/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: A qubit is in state |0⟩. After which of the following single operations does a computational-basis measurement STILL yield outcome 0 with probability 1? Select all that apply.
import numpy as np
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
A.Applying H
B.Applying X
C.Applying Z
D.Applying T
E.Applying RY(π/2)
Answer: Correct: C, D
Z and T are diagonal (phase) gates: on |0⟩ they only multiply by a phase and leave the population entirely on |0⟩, so P(0) stays 1. H, X, and RY(π/2) all move amplitude to |1⟩.
References
- quantum.cloud.ibm.com/docs/guides/operators-overview
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s1-q045 · multi · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: To measure |0⟩ in the X basis you apply H and then measure in the computational basis. What is the probability of the outcome 0, which corresponds to the |+⟩ result?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(1)
# state is |0>; rotate the X basis onto the Z basis with H, then read P(0)
qc.h(0)
print(Statevector.from_instruction(qc).probabilities()[0])
A.0.5 — |0⟩ has equal overlap with |+⟩ and |−⟩
B.1.0 — |0⟩ always gives the |+⟩ outcome in the X basis
C.0.0 — |0⟩ is orthogonal to |+⟩
D.0.7071 — the probability equals the amplitude 1/√2
Answer: Correct: A
|0⟩ = (|+⟩ + |−⟩)/√2, so it has probability 0.5 of each X-basis outcome. Applying H maps |0⟩ to |+⟩ = [0.7071, 0.7071], whose computational-basis probabilities are [0.5, 0.5]; P(0) = 0.5.
References
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
- quantum.cloud.ibm.com/docs/guides/operators-overview
Meta: s1-q047 · predict-output · Difficulty 3/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.