Title: CertiQ — C1000-179 / 2 · Visualize quantum circuits, measurements, and states

Question: What does this script print?
from qiskit import QuantumCircuit
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
print(type(qc.draw()).__name__)
print(type(qc.draw("mpl")).__name__)
A.str then Figure
B.TextDrawing then Figure
C.TextDrawing then Axes
D.str then AxesImage
Answer: Correct: B
With no output argument, QuantumCircuit.draw() defaults to the text renderer and returns a TextDrawing object (its __str__ produces the ASCII art). draw("mpl") returns a full matplotlib.figure.Figure — the object you can savefig() or embed — so the two printed class names are TextDrawing and Figure.
References
- quantum.cloud.ibm.com/docs/guides/visualize-circuits
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q010 · predict-output · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: This 3-qubit circuit has operations only on qubits 0 and 2; qubit 1 is untouched. Which draw() call removes the empty qubit-1 wire from the rendering, so only the active qubits are shown?
from qiskit import QuantumCircuit
qc = QuantumCircuit(3)
qc.x(0)
qc.x(2)
# qubit 1 carries no operations
A.qc.draw("text", idle_wires=True)
B.qc.draw("text", idle_wires=False)
C.qc.draw("text", plot_barriers=False)
D.qc.draw("text", reverse_bits=True)
Answer: Correct: B
idle_wires=False tells the drawer to omit any qubit (or clbit) wire that has no operations on it, so the qubit-1 line disappears and only qubits 0 and 2 are drawn. It works the same across the text, mpl, and latex renderers.
References
- quantum.cloud.ibm.com/docs/guides/visualize-circuits
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q011 · mcq · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: In the default text drawing of this circuit, qubit q_0 is on the top wire. What does passing reverse_bits=True to draw() change?
from qiskit import QuantumCircuit
qc = QuantumCircuit(2)
qc.x(0)
print(qc.draw("text", reverse_bits=True))
A.The wires are reordered so q_1 is drawn on top and q_0 on the bottom.
B.The control and target roles of two-qubit gates such as CX are swapped.
C.Only the classical bits are relabeled; the qubit wire order is unchanged.
D.The endianness of the measurement counts produced by the circuit is reversed.
Answer: Correct: A
reverse_bits is a rendering-only option: it flips the top-to-bottom order in which the qubit (and clbit) wires are drawn. By default Qiskit puts qubit 0 on top; with reverse_bits=True the highest-index qubit goes on top, so q_1 moves above q_0. The circuit's operations and its results are untouched.
References
- quantum.cloud.ibm.com/docs/guides/visualize-circuits
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q012 · mcq · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: You want a circuit in which an X on qubit 0 runs only when the earlier measurement stored a 1 in c[0], and you want it to render with a classical-control (If) block when drawn. In Qiskit SDK 2.x, which line correctly adds that conditional operation?
from qiskit import QuantumCircuit
qc = QuantumCircuit(1, 1)
qc.h(0)
qc.measure(0, 0)
# ... add the conditional X here, then qc.draw("text")
A.with qc.if_test((qc.clbits[0], 1)): then qc.x(0) inside the block
B.qc.x(0).c_if(qc.clbits[0], 1)
C.qc.x(0).condition = (qc.clbits[0], 1)
D.qc.x(0, condition=(qc.clbits[0], 1))
Answer: Correct: A
In Qiskit 2.x classical feedforward is expressed with the if_test context manager. Operations added inside the with qc.if_test((clbit, value)): block run only when the condition holds, and the drawer renders them inside a boxed If-0 ... End-0 block attached to the classical wire.
References
- quantum.cloud.ibm.com/docs/guides/classical-feedforward-and-control-flow
- quantum.cloud.ibm.com/docs/guides/visualize-circuits
Meta: s2-q013 · mcq · Difficulty 3/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: Instead of the qc.draw() method, you want to use the standalone drawer function to render circuit qc as text. Which import and call is correct in Qiskit 2.x?
from qiskit import QuantumCircuit
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
A.from qiskit.visualization import circuit_drawer then circuit_drawer(qc, output="text")
B.from qiskit.tools import circuit_drawer then circuit_drawer(qc, "text")
C.from qiskit import circuit_drawer then circuit_drawer(qc)
D.from qiskit.visualization import draw_circuit then draw_circuit(qc)
Answer: Correct: A
circuit_drawer is the function form of QuantumCircuit.draw() and lives in qiskit.visualization. Called as circuit_drawer(qc, output="text") it returns the same TextDrawing the method would; the two APIs are equivalent.
References
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
- quantum.cloud.ibm.com/docs/guides/visualize-circuits
Meta: s2-q014 · mcq · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: This cell is meant to produce a Matplotlib figure of the circuit but raises an error. What is the correct fix?
from qiskit import QuantumCircuit
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
fig = qc.draw(output="matplotlib")   # raises VisualizationError
A.Use qc.draw(output="mpl") — "matplotlib" is not a valid output type.
B.Use qc.draw(output="figure").
C.Keep the string but add the flag: qc.draw(output="matplotlib", interactive=True).
D.The string is correct; install pylatexenc to make the Matplotlib renderer work.
Answer: Correct: A
The output argument selects the renderer by a short name. The Matplotlib renderer's name is "mpl", not "matplotlib". Any unrecognized value raises VisualizationError; the accepted values are text, mpl, latex, and latex_source.
References
- quantum.cloud.ibm.com/docs/guides/visualize-circuits
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q015 · spot-bug · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: When drawing this circuit you want each qubit wire annotated at its left edge with its starting state |0⟩. Which draw() call adds those initial-state labels?
from qiskit import QuantumCircuit
qc = QuantumCircuit(2)
qc.h(0)
A.qc.draw("text", plot_barriers=True)
B.qc.draw("text", with_initial_state=True)
C.qc.draw("text", initial_state=True)
D.qc.draw("text", vertical_compression="high")
Answer: Correct: C
The initial_state argument (default False) tells the drawer to prefix every qubit and clbit wire with its initial value, so each qubit line begins with a |0> label. It is accepted by all of the drawer's output backends.
References
- quantum.cloud.ibm.com/docs/guides/visualize-circuits
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q016 · mcq · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: Select the TWO calls that each return a matplotlib.figure.Figure for circuit qc. (Select 2.)
from qiskit import QuantumCircuit
from qiskit.visualization import circuit_drawer
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
A.qc.draw("mpl")
B.circuit_drawer(qc, output="mpl")
C.qc.draw("matplotlib")
D.qc.draw()
E.circuit_drawer(qc, output="figure")
Answer: Correct: A, B
The Matplotlib renderer is selected by the output name "mpl", and it is available both as the method qc.draw("mpl") and as the function circuit_drawer(qc, output="mpl"). Both return a matplotlib.figure.Figure.
References
- quantum.cloud.ibm.com/docs/guides/visualize-circuits
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q017 · multi · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: You are preparing a figure of a quantum circuit for a published paper: you want colored gate boxes, a clean layout, and to save it as a high-resolution PNG with savefig. Which draw() output should you use?
A.output="mpl" — returns a Matplotlib Figure you can style and save with savefig.
B.output="text" — returns ASCII art, ideal for quick inspection in a terminal.
C.output="latex_source" — returns a raw LaTeX string rather than a rendered image.
D.the default draw() with no argument — gives you the same ASCII text drawing.
Answer: Correct: A
The mpl renderer returns a matplotlib.figure.Figure, which supports colored gate boxes, style customization, and fig.savefig(...) to any raster or vector format. That is exactly what a publication-quality circuit figure needs.
References
- quantum.cloud.ibm.com/docs/guides/visualize-circuits
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q018 · mcq · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: This runs on a noiseless simulator. Which single bitstring carries probability 1 — i.e., where would plot_histogram place its one bar?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(3)
qc.x(0)
qc.x(2)
sv = Statevector.from_instruction(qc)
print(sv.probabilities_dict())
A.{'011': 1.0}
B.{'101': 1.0}
C.{'110': 1.0}
D.{'5': 1.0}
Answer: Correct: B
Qiskit labels outcomes little-endian: the string is written q2 q1 q0 (highest-index qubit on the left). X flips qubits 0 and 2 to |1>, qubit 1 stays |0>, so the label is 1·0·1 = '101'. The single histogram bar sits at '101'.
References
- quantum.cloud.ibm.com/docs/guides/visualize-results
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q019 · predict-output · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: You have a raw counts dictionary from 1024 shots. Compared with plot_histogram(counts), what does plot_distribution(counts) display for the same data?
from qiskit.visualization import plot_histogram, plot_distribution
counts = {"00": 500, "11": 500, "01": 20, "10": 4}
# plot_histogram(counts)  vs  plot_distribution(counts)
A.plot_distribution normalizes the bars into a distribution summing to 1, whereas plot_histogram shows the raw integer counts (summing to the shot total).
B.They are identical; plot_distribution is a deprecated alias of plot_histogram.
C.plot_distribution shows raw counts and plot_histogram normalizes to probabilities — the roles are reversed.
D.plot_distribution requires a Statevector rather than a counts dict, so it raises a TypeError here.
Answer: Correct: A
plot_histogram plots the raw counts (its y-axis is labeled Count and the bar heights add up to the number of shots). plot_distribution plots a normalized (quasi-)probability distribution, so its bar heights add up to 1. Both accept the same counts dict.
References
- quantum.cloud.ibm.com/docs/guides/visualize-results
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q020 · mcq · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: The counts dict has four distinct bitstrings. What does plot_histogram(counts, number_to_keep=2) put on the x-axis?
from qiskit.visualization import plot_histogram
counts = {"01": 20, "00": 500, "10": 4, "11": 500}
fig = plot_histogram(counts, number_to_keep=2)
A.The two highest-count bitstrings ('00' and '11') plus one aggregated bar labeled 'rest'.
B.Only the two highest-count bitstrings ('00' and '11'); the other outcomes are dropped entirely.
C.The first two bitstrings in insertion order ('01' and '00'), with no aggregation.
D.All four bitstrings; number_to_keep only changes the figure width.
Answer: Correct: A
number_to_keep=N keeps the N bitstrings with the largest counts and folds every remaining outcome into a single bar labeled 'rest', so no probability weight is lost. Here the two largest are '00' and '11' (500 each), giving bars ['00', '11', 'rest'].
References
- quantum.cloud.ibm.com/docs/guides/visualize-results
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q021 · mcq · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: After running a SamplerV2 job, this code tries to plot the measurement results but raises AttributeError. Which change plots the histogram correctly?
from qiskit.visualization import plot_histogram
# result = SamplerV2(mode=backend).run([isa_qc]).result()
data = result[0].data.meas      # a BitArray
fig = plot_histogram(data)      # AttributeError
A.plot_histogram(result[0].data)
B.plot_histogram(result[0])
C.plot_histogram(result[0].data.meas.get_counts())
D.Keep the BitArray but pass shots: plot_histogram(data, shots=1024)
Answer: Correct: C
plot_histogram expects a counts mapping (bitstring -> integer). A SamplerV2 result stores per-shot data as a BitArray; call its .get_counts() to obtain the counts dict, then pass that. result[0].data.meas.get_counts() is the fix.
References
- quantum.cloud.ibm.com/docs/guides/visualize-results
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q022 · spot-bug · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: You ran the same circuit before and after error mitigation and want one histogram that overlays the two count dictionaries side by side, with a labeled legend. Which call does this?
from qiskit.visualization import plot_histogram
before = {"00": 480, "11": 300, "01": 120, "10": 124}
after  = {"00": 500, "11": 500, "01": 12, "10": 12}
A.plot_histogram(before + after, legend=["before", "after"])
B.plot_histogram(before, after, legend=["before", "after"])
C.plot_histogram({"before": before, "after": after})
D.plot_histogram([before, after], legend=["before", "after"])
Answer: Correct: D
To overlay several result sets, pass a LIST of counts dicts as the single data argument and give a matching legend list. plot_histogram([before, after], legend=[...]) draws grouped bars per bitstring with the two runs color-coded and labeled.
References
- quantum.cloud.ibm.com/docs/guides/visualize-results
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q023 · mcq · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: Noiseless simulation. What outcome probabilities does this print — i.e., which bar dominates the histogram?
import numpy as np
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(1)
qc.ry(2 * np.pi / 3, 0)
sv = Statevector.from_instruction(qc)
print({k: round(v, 3) for k, v in sv.probabilities_dict().items()})
A.{'0': 0.933, '1': 0.067}
B.{'0': 0.75, '1': 0.25} — the '0' bar is taller.
C.{'0': 0.5, '1': 0.5} — the two bars are equal.
D.{'0': 0.25, '1': 0.75} — the '1' bar is three times taller.
Answer: Correct: D
RY(θ)|0> = cos(θ/2)|0> + sin(θ/2)|1>, so P(1) = sin²(θ/2). With θ = 2π/3, θ/2 = π/3 and sin²(π/3) = 3/4. Thus P(0) = 0.25 and P(1) = 0.75, and the histogram's '1' bar is three times the height of the '0' bar.
References
- quantum.cloud.ibm.com/docs/guides/visualize-results
- quantum.cloud.ibm.com/docs/guides/plot-quantum-states
Meta: s2-q024 · predict-output · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: The counts dictionary below is built in a scrambled order. With no extra arguments, how does plot_histogram(counts) arrange the bars, and what does it return?
from qiskit.visualization import plot_histogram
counts = {"11": 10, "00": 40, "10": 5, "01": 7}
fig = plot_histogram(counts)
A.In the dictionary's insertion order ('11','00','10','01'); returns a matplotlib Figure.
B.Sorted by count with the tallest bar first; returns a matplotlib Figure.
C.Sorted in ascending bitstring order ('00','01','10','11'); returns a matplotlib Figure.
D.Sorted ascending, but the call returns an Axes object rather than a Figure.
Answer: Correct: C
By default plot_histogram sorts the x-axis labels in ascending lexicographic (bitstring) order, independent of insertion order or bar height, and returns a matplotlib.figure.Figure. So the bars appear as '00','01','10','11'.
References
- quantum.cloud.ibm.com/docs/guides/visualize-results
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q025 · mcq · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: You call plot_bloch_multivector(state) on this 3-qubit statevector. How many Bloch spheres are drawn, and what does the call return?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
from qiskit.visualization import plot_bloch_multivector
qc = QuantumCircuit(3)
qc.h(0)
qc.x(1)
state = Statevector.from_instruction(qc)
fig = plot_bloch_multivector(state)
A.A single Bloch sphere summarizing the whole 3-qubit state; returns a Figure.
B.One Bloch sphere per qubit (3 spheres); returns a matplotlib Figure.
C.2^3 = 8 Bloch spheres, one per computational basis state; returns a Figure.
D.One sphere per qubit, but the call returns a list of Axes instead of a Figure.
Answer: Correct: B
plot_bloch_multivector computes each qubit's reduced (single-qubit) state and draws one Bloch sphere per qubit, packed into a single matplotlib.figure.Figure. A 3-qubit state therefore yields 3 spheres.
References
- quantum.cloud.ibm.com/docs/guides/plot-quantum-states
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q026 · mcq · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: After this circuit, plot_bloch_multivector draws the single qubit's arrow along which axis, and which state does that arrow represent?
from qiskit import QuantumCircuit
qc = QuantumCircuit(1)
qc.h(0)
qc.s(0)
A.The +X axis — the state |+> = (|0> + |1>)/√2.
B.The −Z axis — the state |1>.
C.The +Y axis — the state (|0> + i|1>)/√2.
D.The +Z axis — the state |0>.
Answer: Correct: C
H sends |0> to |+> (Bloch +X). The S gate = diag(1, i) adds a phase i to the |1> amplitude, rotating the vector 90° about Z from +X to +Y. The resulting state (|0> + i|1>)/√2 has Bloch vector (⟨X⟩,⟨Y⟩,⟨Z⟩) = (0, 1, 0), so the arrow points along +Y.
References
- quantum.cloud.ibm.com/docs/guides/plot-quantum-states
- quantum.cloud.ibm.com/docs/guides/visualize-results
Meta: s2-q027 · mcq · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: On a single-qubit Bloch sphere the arrow points along the −X axis, i.e. the Bloch vector is (−1, 0, 0). Which state does this visualization represent?
A.|0>
B.|−> = (|0> − |1>)/√2
C.|1>
D.|+> = (|0> + |1>)/√2
Answer: Correct: B
The Bloch vector is (⟨X⟩,⟨Y⟩,⟨Z⟩). A vector on the −X axis, (−1,0,0), means ⟨X⟩ = −1: the state is the −1 eigenstate of X, which is |−> = (|0> − |1>)/√2.
References
- quantum.cloud.ibm.com/docs/guides/plot-quantum-states
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q028 · mcq · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: You have a Statevector sv and want to render it as a q-sphere figure directly from the object. Which call does that?
from qiskit.quantum_info import Statevector
sv = Statevector.from_label("01")
A.sv.qsphere()
B.plot_qsphere(sv)
C.sv.draw("qsphere")
D.sv.draw("q_sphere")
Answer: Correct: C
Statevector.draw(output=...) is the object's entry point to the state-visualization drawers. Passing "qsphere" returns the q-sphere Figure (equivalent to plot_state_qsphere(sv)). Other valid tokens include "bloch", "city", "hinton", and "paulivec".
References
- quantum.cloud.ibm.com/docs/guides/plot-quantum-states
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q029 · mcq · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: You prepare the Bell state (|00> + |11>)/√2 and call plot_bloch_multivector(state). What do the two Bloch spheres show?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
state = Statevector.from_instruction(qc)
A.Both arrows point to the north pole — each qubit is in |0>.
B.Both arrows point along +X — each qubit is in |+>.
C.The two spheres are joined by a single shared arrow representing the entanglement.
D.Each arrow shrinks to the center (zero length): each qubit's reduced state is maximally mixed.
Answer: Correct: D
plot_bloch_multivector draws each qubit's reduced (single-qubit) state, obtained by tracing out the other qubit. For a Bell pair each reduced state is the maximally mixed I/2, whose Bloch vector is (0,0,0). So both arrows collapse to the center — the visual signature of maximal entanglement.
References
- quantum.cloud.ibm.com/docs/guides/plot-quantum-states
- quantum.cloud.ibm.com/docs/api/qiskit/quantum_info
Meta: s2-q030 · mcq · Difficulty 3/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: On a q-sphere, a node (marker) is drawn at every computational basis state whose amplitude is nonzero. For the state below, which basis states appear as nodes? (Select 2.)
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
from qiskit.visualization import plot_state_qsphere
qc = QuantumCircuit(2)
qc.h(0)
qc.x(1)
state = Statevector.from_instruction(qc)
fig = plot_state_qsphere(state)
A.|00>
B.|01>
C.|10>
D.|11>
Answer: Correct: C, D
H puts qubit 0 into a superposition and X sets qubit 1 to |1>. In Qiskit's little-endian labels (q1 q0) the state is (|10> + |11>)/√2, so only |10> and |11> have nonzero amplitude and appear as q-sphere nodes. Node size encodes each amplitude's magnitude and node color its phase.
References
- quantum.cloud.ibm.com/docs/guides/plot-quantum-states
- quantum.cloud.ibm.com/docs/guides/visualize-results
Meta: s2-q031 · multi · Difficulty 3/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: On the q-sphere of this state, the node for |01> is drawn in a different color from the node for |10>, and the two nodes are the same size. What does that color difference encode?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
from qiskit.visualization import plot_state_qsphere
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.x(0)
qc.z(0)
state = Statevector.from_instruction(qc)
fig = plot_state_qsphere(state)
A.The amplitude magnitude — the |01> node stands for a larger amplitude than |10>.
B.The relative phase of the amplitude — the |01> branch carries phase π while |10> has phase 0.
C.The Hamming weight (number of 1-bits) of the basis state.
D.Nothing meaningful — q-sphere nodes are all the same color and any difference is a rendering artifact.
Answer: Correct: B
On a q-sphere a node's SIZE encodes the amplitude magnitude and its COLOR encodes the amplitude's complex phase. Here |01> and |10> have equal magnitude (same size) but the Z gate multiplies the |01> branch by −1, giving it phase π versus phase 0 for |10> — so the colors differ.
References
- quantum.cloud.ibm.com/docs/guides/plot-quantum-states
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q032 · mcq · Difficulty 3/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: What input does each of plot_bloch_vector and plot_bloch_multivector expect?
A.Both take a quantum state; they differ only in the resulting figure size.
B.plot_bloch_vector takes a quantum state; plot_bloch_multivector takes a 3-number vector [x, y, z].
C.plot_bloch_vector takes a 3-number Bloch vector [x, y, z]; plot_bloch_multivector takes a quantum state and draws one sphere per qubit.
D.Both take a 3-number vector [x, y, z]; plot_bloch_multivector just repeats it on several spheres.
Answer: Correct: C
plot_bloch_vector draws a single sphere from an explicit Bloch vector [x, y, z] (Cartesian by default). plot_bloch_multivector takes a quantum state (Statevector or DensityMatrix), computes each qubit's reduced state, and draws one Bloch sphere per qubit. Their inputs are different kinds of object.
References
- quantum.cloud.ibm.com/docs/guides/plot-quantum-states
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q033 · mcq · Difficulty 1/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: You have the 2-qubit Bell state and want one Bloch sphere per qubit, but this line does not do that — plot_bloch_vector treats its argument as a raw [x, y, z] vector. Which call draws one sphere per qubit?
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
from qiskit.visualization import plot_bloch_vector, plot_bloch_multivector
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
state = Statevector.from_instruction(qc)
fig = plot_bloch_vector(state)   # does NOT produce per-qubit spheres
A.plot_bloch_vector(state, coord_type="spherical") — reinterpret the same input as spherical coordinates.
B.plot_bloch_vector(state.data) — pass the raw amplitude array instead.
C.plot_bloch_multivector([0, 0, 1]) — hand a Bloch vector to the multivector function.
D.plot_bloch_multivector(state) — pass the quantum state to the multivector drawer.
Answer: Correct: D
plot_bloch_multivector is the function that takes a quantum state and renders one Bloch sphere per qubit (each from that qubit's reduced state). For the 2-qubit Bell state it produces two spheres. plot_bloch_vector, by contrast, only ever draws a single sphere from a 3-number vector.
References
- quantum.cloud.ibm.com/docs/guides/plot-quantum-states
- quantum.cloud.ibm.com/docs/api/qiskit/visualization
Meta: s2-q034 · spot-bug · Difficulty 2/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.

Question: Each snippet is applied to a fresh single-qubit circuit qc = QuantumCircuit(1). For which TWO does plot_bloch_multivector place the arrow exactly on the equator of the Bloch sphere (⟨Z⟩ = 0)? (Select 2.)
import numpy as np
from qiskit import QuantumCircuit
# each option acts on a fresh:  qc = QuantumCircuit(1)
A.qc.h(0)
B.qc.x(0)
C.qc.ry(np.pi / 3, 0)
D.qc.h(0); qc.s(0)
E.no gates at all (leave qc empty)
Answer: Correct: A, D
A point is on the equator when ⟨Z⟩ = 0. h(0) makes |+> with Bloch (1,0,0), and h(0); s(0) makes (|0>+i|1>)/√2 with Bloch (0,1,0) — both have ⟨Z⟩ = 0, so their arrows lie on the equator.
References
- quantum.cloud.ibm.com/docs/guides/plot-quantum-states
- quantum.cloud.ibm.com/docs/guides/visualize-results
Meta: s2-q035 · multi · Difficulty 3/3
AI-generated, execution-verified — CertiQ. Unofficial: not affiliated with, endorsed by, or sponsored by IBM.