TASK 5.1/6.1: Set sampler/estimator primitive options¶
- Which snippet correctly transpiles a parameterized circuit for a chosen backend and produces an ISA circuit before using Estimator V2?
a.
from qiskit.transpiler import generate_preset_pass_manager
pm = generate_preset_pass_manager(optimization_level=1, backend=backend)
isa_circ = pm.run(circ)b.
isa_circ = circ # QPUs accept any gates; transpilation is optionalc.
from qiskit import transpile
isa_circ = transpile(circ) # omit backendd.
pm = generate_preset_pass_manager(backend=None)
isa_circ = pm.run(circ.decompose())answer
The answer is a.
You must generate a preset pass manager with a concrete backend and run it to obtain an ISA circuit; this matches the example that uses generate_preset_pass_manager(optimization_level=1, backend=backend) followed by pm.run(circuit). This step ensures the circuit uses only instructions supported by the target device prior to invoking primitives.
- You need to configure the Sampler to use 4096 shots by default for all runs in a session. Which method should you use?
a. sampler.options.default_shots = 4096
b. sampler.set_shots(4096)
c. sampler.options.shots.default = 4096
d. sampler.run(..., shots=4096)
answer
The answer is a.
Sampler exposes a top‑level option default_shots that sets the default number of repetitions used when circuits are executed. Setting sampler.options.default_shots = 4096 applies to subsequent run calls unless overridden. The other choices either refer to non‑existent attributes (set_shots, options.shots.default) or set shots per‑call rather than as the default for the options object.
- Which call correctly submits work to Estimator V2 using the Primitive Unified Bloc (PUB) tuple?
a.
job = estimator.run([(isa_circ, isa_obs, param_values)])b.
job = estimator.run([(isa_obs, isa_circ, param_values)])c.
job = estimator.run([(isa_circ, param_values)])d.
job = estimator.run((isa_circ, isa_obs, param_values))answer
The answer is a.
The Estimator expects a sequence of PUB tuples in the form (circuit, observable, parameter_values); the example shows estimator.run([(isa_circuit, isa_observable, param_values)]).
- For Sampler V2, which preparation is correct before transpilation and submission?
a.
circ.measure_all()
pm = generate_preset_pass_manager(optimization_level=1, backend=backend)
isa_circ = pm.run(circ)
job = sampler.run([(isa_circ, param_values)])b.
pm = generate_preset_pass_manager(optimization_level=3, backend=backend)
isa_circ = pm.run(circ) # no measurements needed
job = sampler.run([(isa_circ,)])c.
job = sampler.run([(circ,)])d.
isa_circ = circ.remove_final_measurements(inplace=True)
job = sampler.run([(isa_circ,)])answer
The answer is a.
The sampler example measures the circuit (measure_all()), transpiles to ISA with a preset pass manager for the chosen backend, and submits [(isa_circuit, param_values)] as the PUB.
- Which initialization correctly selects the execution mode consistent with the examples?
a.
from qiskit_ibm_runtime import EstimatorV2 as Estimator
estimator = Estimator(mode=backend)b.
from qiskit_ibm_runtime import EstimatorV2 as Estimator
estimator = Estimator(mode="session") # string literalc.
from qiskit_ibm_runtime import EstimatorV2 as Estimator
estimator = Estimator() # mode is mandatoryd.
from qiskit_ibm_runtime import EstimatorV2 as Estimator
estimator = Estimator(mode="batch").run(backend)answer
The answer is a.
When you initialize the Estimator, use the mode parameter to specify the mode you want it to run in. Possible values are batch, session, or backend objects for batch, session, and job execution mode, respectively.
- How can you request a backend that supports fractional gates per the guide?
a.
service = QiskitRuntimeService()
backend = QiskitRuntimeService(use_fractional_gates=True)b.
service = QiskitRuntimeService()
backend = service.get_backend("fractional-gates")c.
service = QiskitRuntimeService()
backend = service.least_busy(fractional=True)d.
service = QiskitRuntimeService()
backend = service.least_busy(use_fractional_gates=True)answer
The answer is d.
To use the newly supported fractional gates, set use_fractional_gates=True when requesting a backend from a QiskitRuntimeService instance.
What are fractional gates¶
Fractional gates are native hardware operations (e.g., R_X(θ), R_ZZ(θ)) that allow arbitrary-angle rotations to be executed directly on supported IBM Quantum devices, without decomposing into multiple basis gates.
When to use¶
- Circuits with many arbitrary rotations (e.g., VQE, QAOA, quantum simulation).
- To reduce circuit depth, execution time, and cumulative error.
- When the backend supports fractional gates and constraints (like angle ranges) are met.
When not to use (and why)¶
- Unsupported cases: dynamic circuits, certain error-mitigation techniques (Pauli twirling, PEC, ZNE with PEA).
- Restricted angles: R_ZZ(θ) only supports 0 < θ ≤ π/2.
- Runtime parameters may cause errors if angles are out of range.
- For simple circuits where decomposition overhead is negligible.
- It’s still an experimental feature, so stability and compatibility can change.
- Which code path best reflects a minimal, correct optimization/transpilation workflow before running primitives?
a. Create circuit → generate_preset_pass_manager(optimization_level=1, backend) → pm.run(circuit) → align observable with apply_layout → Estimator.run([...])
b. Create circuit → call Estimator.run(circuit) and let the service infer gates automatically
c. Create circuit → decompose to basis gates locally without a backend → Estimator.run([...])
d. Create circuit → add barriers to prevent changes → Estimator.run([...])
answer
The answer is a.
The documented steps show generating a preset pass manager with a specified backend, running it to obtain an ISA circuit, aligning the observable, and then submitting PUBs to the primitive.
- Which code correctly enables dynamical decoupling (DD) in Sampler V2 and selects the XpXm sequence?
a.
sampler.options.dynamical_decoupling.enable = True
sampler.options.dynamical_decoupling.sequence_type = "XpXm"b.
sampler.options.resilience.zne_mitigation = True
sampler.options.resilience.zne.extrapolator = "exponential"c.
sampler.options.twirling.enable_gates = True
sampler.options.twirling.sequence_type = "XpXm"d.
sampler.set_options(dynamical_decoupling=True, sequence_type="XpXm")answer
The answer is a.
Sampler V2 exposes DD via sampler.options.dynamical_decoupling. Set enable=True and choose a valid sequence_type such as "XpXm". Error mitigation like ZNE belongs to the Estimator, not Sampler.
Dynamic Decoupling¶
Dynamical decoupling works by inserting pulse sequences on idling qubits to approximately cancel out the effect of these errors. Each inserted pulse sequence amounts to an identity operation, but the physical presence of the pulses has the effect of suppressing errors.
- You want to randomize two‑qubit gate errors via Pauli twirling when running the Sampler. Which method most directly enables this according to the twirling options API?
a. sampler.options.twirling = {"circuit": {"enable": True}}
b. sampler.options.twirling.enable = True
c. sampler.options.transpilation.pauli_twirling = True
d. sampler.enable_pauli_twirling()
answer
The answer is b.
Twirling controls are exposed under the twirling options namespace; enabling Pauli twirling is done by toggling the boolean on that namespace (e.g., sampler.options.twirling.enable = True) and, if needed, refining sub‑options. The other choices either use non‑documented attribute paths or nonexistent helper methods.
- When is enabling dynamical decoupling most likely to help for Sampler runs on hardware?
a. Only when running on a simulator with noise disabled
b. When all qubits are busy almost all the time (densely packed schedules)
c. When circuits contain idle gaps on some qubits where no operations occur
d. Only when measuring expectation values with Estimator
answer
The answer is c.
DD is primarily beneficial when there are idle periods; pulses inserted during idle intervals can suppress coherent errors. With densely packed schedules, DD can provide little benefit or even hurt due to pulse imperfections.
- Which error‑related options are supported directly by Sampler V2?
a. Pauli twirling (suppression) via sampler.options.twirling.*
b. TREX measurement mitigation via sampler.options.resilience.measure_mitigation = True
c. Zero‑noise extrapolation via sampler.options.resilience.zne_mitigation = True
d. Probabilistic error cancellation via sampler.options.resilience.pec_mitigation = True
answer
The answer is a.
Sampler supports suppression methods like Pauli twirling and dynamical decoupling. Mitigation techniques such as TREX, ZNE, and PEC are available in Estimator; Sampler does not support them directly.
- Which snippet correctly configures Pauli twirling in Sampler V2 with 32 randomizations and 100 shots per randomization?
a.
sampler.options.twirling.enable_gates = True
sampler.options.twirling.num_randomizations = 32
sampler.options.twirling.shots_per_randomization = 100b.
sampler.options.twirling.enable = True
sampler.options.twirling.count = 32
sampler.options.twirling.shots = 100c.
sampler.options.resilience.twirling = True
sampler.options.resilience.num_randomizations = 32
sampler.options.resilience.shots_per_randomization = 100d.
sampler.enable_twirling(32, 100)answer
The answer is a.
Use the twirling options on Sampler: set enable_gates=True, then configure num_randomizations and shots_per_randomization.
num_randomizations: The number of circuit instances to draw from the ensemble of twirled circuits.shots_per_randomization: The number of shots to sample from each circuit instance. Here’s a concise English summary of the Concept and Motivation sections of Pauli twirling, along with an explanation of the difference between coherent and incoherent noise:
Pauli twirling¶
Pauli twirling is a technique where random Pauli operators (I, X, Y, Z) are inserted before and after certain gates in a quantum circuit. This process effectively transforms arbitrary noise into a Pauli channel, a simpler and more tractable noise model.
Quantum hardware noise often contains coherent errors, which accumulate quadratically with the number of operations, making them especially harmful. By applying Pauli twirling, these coherent errors are randomized and converted into incoherent (Pauli) errors, which accumulate linearly with circuit depth. This makes the errors easier to analyze and mitigate, and it allows error mitigation techniques that assume Pauli noise to be more effective.
Coherent vs. Incoherent errors¶
Coherent errors:
- Systematic and unitary in nature (e.g., consistent over-rotation or phase error in a gate).
- Error amplitudes interfere constructively over repeated operations, causing error growth to scale quadratically.
Incoherent errors:
- Probabilistic and stochastic (e.g., random bit flips, depolarizing noise).
- Errors accumulate additively, leading to linear error growth with circuit depth.
- How do you set a repetition delay of 0.5 ms between shots for Sampler V2?
a. sampler.options.execution.rep_delay = 0.5
b. sampler.options.environment.rep_delay = 0.5
c. sampler.options.execution.rep_delay = 0.0005
d. sampler.set_options(rep_delay_ms=0.5)
answer
The answer is c.
rep_delay is specified in seconds within the execution options; 0.5 ms equals 0.0005 seconds.
- When calling
SamplerV2.run, what is the correct data type for the first positional argument?
a. A single QuantumCircuit instance
b. A list of ISA circuits accepted by the runtime ([isa_circuit, ...])
c. A Distribution object
d. A dictionary mapping bitstrings to probabilities
answer
The answer is b.
SamplerV2.run expects a sequence of runtime‑compatible (ISA) circuits; passing a single QuantumCircuit or a probability distribution does not conform to the runtime’s run signature for the Sampler. (A single circuit can be provided as a one‑element list.)
- Which statement about dynamical decoupling is TRUE?
a. DD is a measurement‑error mitigation method that post‑processes bitstrings
b. Each inserted DD pulse sequence ideally implements an identity operation while suppressing coherent errors on idling qubits
c. DD is guaranteed to improve results in all cases, even with dense schedules
d. DD can only be used with Estimator, not with Sampler
answer
The answer is b.
DD inserts carefully chosen pulse sequences during idle gaps. These sequences act as identity operations but help cancel coherent errors. It is a suppression (control) technique, not a post‑processing mitigation method.
- In EstimatorV2, what does
options.default_precisioncontrol and what is its default value?
a. It sets the target standard error for expectation values (used when shots aren’t given); default is 0.015625 (1/√4096).
b. It sets the transpiler optimization level; default is 1.
c. It fixes the number of shots for each circuit configuration; default is 4096.
d. It controls backend run priority; default is “normal”.
answer
The answer is a.
default_precision defines the default statistical precision target for expectation values when neither the PUB nor run() specifies precision; EstimatorV2 chooses shots to meet this. The documented default is 0.015625 (i.e., 1/√4096).
- Regarding
options.default_shotsin EstimatorV2, which statement is correct?
a. If set, it overrides default_precision, and when twirling is enabled it is split across randomizations.
b. It is ignored whenever twirling is enabled.
c. It only applies to simulators and is ignored on hardware.
d. It sets the maximum number of shots per job but never overrides precision.
answer
The answer is a.
When default_shots is provided, it takes precedence over default_precision. If Pauli twirling is active, the total shots are divided among the circuit randomizations according to the twirling options.
- Which mapping of
resilience_levelto behavior is correct for EstimatorV2?
a. 0: No mitigation; 1: Readout mitigation + measurement twirling; 2: Adds bias‑reducing estimator mitigation (medium cost).
b. 0: Readout mitigation only; 1: Full error correction; 2: No mitigation.
c. 0: Measurement twirling; 1: Probabilistic error cancellation; 2: Zero‑noise extrapolation only.
d. 0: No mitigation; 1: Full QEC; 2: Hardware calibration reset only.
answer
The answer is a.
resilience_level increases mitigation complexity:
- 0 disables mitigation
- 1 applies minimal‑cost techniques like readout mitigation (and measurement twirling in V2)
- 2 adds medium‑cost estimator bias‑reduction methods
- For
TwirlingOptions.strategy, what best describes the default"active-accum"behavior?
a. In each twirled layer, twirl the union of instruction qubits encountered up to that layer.
b. Twirl only the instruction qubits of the current layer, ignoring earlier ones.
c. Twirl all qubits in the circuit at every twirled layer.
d. Twirl only the first two qubits of the circuit to minimize overhead.
answer
The answer is a.
"active-accum" accumulates the set of instruction qubits seen so far and twirls that growing set at each subsequent twirled layer, which is default strategy.
- What is the default of
TwirlingOptions.enable_measureand where does it apply?
a. True for Estimator, False for Sampler; enables twirling on measurement instructions not inside conditionals.
b. True for both Estimator and Sampler; always twirl all measurements.
c. False for both primitives; measurement twirling must be enabled via resilience_level only.
d. True only on simulators; False on hardware backends.
answer
The answer is a.
Measurement twirling is enabled by default for Estimator and disabled by default for Sampler. It applies to measurement operations provided they are not within a conditional block.
- When
options.resilience.zne.amplifier='pea'is selected, which effect is correct?
a. The runtime always uses twirling and performs layer noise learning before executing amplified circuits.
b. ZNE is disabled because PEA conflicts with twirling.
c. Only single‑qubit gates are folded; two‑qubit gates are untouched.
d. The extrapolator is forced to 'fallback'.
answer
The answer is a.
With PEA (Probabilistic Error Amplification), the runtime learns a twirled noise model per entangling layer (layer noise learning) and applies twirling automatically, then injects noise proportional to the learned model during execution.
- What are the documented defaults for
options.resilience.zne.noise_factors?
a. (1, 1.5, 2) for PEA and (1, 3, 5) otherwise.
b. (1, 2, 4) for PEA and (1, 3, 9) otherwise.
c. Always (1, 3, 5) regardless of amplifier.
d. Determined solely by default_precision.
answer
The answer is a.
By default, PEA uses smaller incremental factors (1, 1.5, 2), while gate‑folding–based amplification uses (1, 3, 5).
- When ZNE options are enabled in EstimatorV2, which additional data fields are returned per PUB result?
a. evs_extrapolated/stds_extrapolated and evs_noise_factors/stds_noise_factors/ensemble_stds_noise_factors.
b. Only calibration_matrix with no standard deviations.
c. zne_trace strings and fit_r2 only.
d. No additional data; ZNE affects only evs/stds.
answer
The answer is a.
With ZNE, in addition to evs and stds, the runtime returns extrapolated evaluations and per‑noise‑factor evaluations (including ensemble standard deviations) with shapes defined by the observable and parameter broadcasting.
- Which snippet correctly runs
SamplerV2on two circuits and obtains quasi‑probability results?
a.
from qiskit_ibm_runtime import SamplerV2
sampler = SamplerV2(mode=backend)
job = sampler.run([circ1_isa, circ2_isa])
result = job.result()
dists = result[0].data, result[1].datab.
from qiskit_ibm_runtime import SamplerV2
sampler = SamplerV2(mode=backend)
job = sampler.run(circ1_isa, circ2_isa)
dists = job.result().distributionsc.
from qiskit_ibm_runtime import SamplerV2
sampler = SamplerV2(mode=backend)
result = sampler.run([circ1_isa, circ2_isa], runs=2048)
dists = result.datad.
from qiskit_ibm_runtime import SamplerV2
sampler = SamplerV2(mode=backend)
job = sampler.run([circ1, circ2]) # QuantumCircuit objects
dists = job.result()answer
The answer is a.
SamplerV2.run accepts a list of ISA circuits and returns a job whose result() contains per‑circuit distribution payloads. Passing multiple positional circuit arguments or non‑ISA QuantumCircuit objects is not correct for the runtime API.
- What is
options.seed_estimatorused for in EstimatorV2?
a. To control sampling randomness (e.g., shot sampling and randomizations) via a fixed seed.
b. To seed the transpiler’s layout selection.
c. To fix the hardware qubit mapping across sessions.
d. To seed the optimizer used in VQE.
answer
The answer is a.
seed_estimator sets a seed to control stochastic parts of the estimator’s execution, such as sampling and randomized procedures, improving reproducibility across runs.
TASK 5.2/6.2: Understand the theoretical background behind the sampler/estimator primitive¶
- Which snippet best demonstrates multiple PUBs in one call to Sampler V2?
a.
pubs = [(qc1, [theta1], 2000), (qc2, [theta2], 4000)]
job = sampler.run(pubs)
res = job.result()b.
pubs = [(qc1, obs1, [theta1]), (qc2, obs2, [theta2])]
job = sampler.run(pubs)c.
pubs = [([qc1, qc2], {'shots': [2000, 4000]})]
job = sampler.run(pubs)d.
pubs = {qc1: 2000, qc2: 4000}
job = sampler.run(pubs)answer
The answer is a.
A Sampler PUB can be expressed as (circuit, <optional> parameter_values, <optional> shots). Multiple PUBs can be submitted in a single run call.
- Which of the following best describes the output of the Sampler primitive?
a. A histogram of expectation values for given observables
b. A quasi-probability distribution over bitstrings measured from the circuit
c. A sequence of transpiled circuits optimized for the backend
d. A set of error-mitigated observables in operator form
answer
The answer is b.
The Sampler outputs a quasi-probability distribution that summarizes how often each bitstring is expected to occur. This distribution captures sampling statistics, while expectation values belong to Estimator results.
- You need to obtain shot-by-shot samples from a circuit while preserving the measurement order for dynamic-circuit compatibility. Which method should you use?
a. Use EstimatorV2.run([qc]) to return expectation values per shot.
b. Use SamplerV1.run([qc]) to return a quasi-probability distribution.
c. Use SamplerV2.run([qc]) to return samples of classical outcomes, preserving shot order.
d. Use QuantumCircuit.sample_counts(qc) to return per-shot bit arrays.
answer
The answer is c.
SamplerV2 focuses on sampling the output register and returns samples of classical outcomes, preserving the shot order. This contrasts with Sampler V1, which returns quasi-probability distributions. Estimator computes expectation values, not samples.
- You want to submit several circuits, each with its own parameter values and (optionally) shots, in a single call. Which interface best matches the Sampler V2 design?
a. Provide a list of PUBs, where each PUB is (circuit, <optional> parameter_values, <optional> shots>).
b. Provide a list of (observable, circuit) pairs.
c. Provide a dictionary mapping circuits to quasi-probabilities.
d. Provide a single circuit with a batch size argument batch=True.
answer
The answer is a.
Sampler V2 accepts multiple Primitive Unified Blocs (PUBs), each tuple typically (circuit, <optional> parameter_values, <optional> shots), so you can submit many circuit evaluations together.
- In Sampler V2, results are organized by classical register names from the circuit. Which description best matches this behavior?
a. Samples are returned as raw bytes, with no register structure available.
b. Samples are grouped per classical register, aiding compatibility with dynamic circuits.
c. Samples are flattened into integers and sorted by frequency.
d. Samples are returned only as aggregate counts per register.
answer
The answer is b.
Sampler V2 organizes output by the output/classical register names defined by the input program, facilitating use with dynamic circuits.
- In the context of the Estimator primitive, what is the main theoretical effect of Pauli twirling on gate errors?
a. It only applies to single-qubit gates and leaves two-qubit noise unchanged.
b. It eliminates measurement (readout) errors by repeating measurements with majority voting.
c. It exactly cancels hardware noise by inverting it gate-by-gate.
d. It transforms arbitrary noise into a Pauli channel so that coherent errors accumulate linearly rather than quadratically.
answer
The answer is d.
Pauli twirling (randomized compiling with Pauli gates) maps general noise to a Pauli channel. This changes error growth from quadratic (coherent) to linear (Pauli), improving expectation-value estimation by the Estimator when combined with sampling over randomized circuit instances.
- You estimate expectation values of Pauli observables and see bias dominated by readout noise. Which technique directly targets measurement errors for Estimator?
a. Pauli twirling (gate twirling)
b. Twirled Readout Error eXtinction (TREX)
c. Dynamical decoupling (DD)
d. Zero-noise extrapolation (ZNE)
answer
The answer is b.
TREX performs measurement twirling (random X before measure + classical bit flip) to diagonalize the readout-error transfer matrix and remove readout bias from expectation values. Gate twirling and DD address gate/coherent errors; ZNE mitigates circuit noise via noise scaling and extrapolation, not specifically readout.
- Zero-noise extrapolation (ZNE), as used with the Estimator, is best summarized by which two-stage process?
a. Learn a quasi-probability model and sample from it to reproduce the ideal circuit exactly.
b. Amplify noise (e.g., by digital gate folding) and then extrapolate expectation values to the zero-noise limit.
c. Insert idle-pulse sequences to cancel coherent errors during “gaps” in the schedule.
d. Calibrate a confusion matrix and invert it to de-bias measurement outcomes.
answer
The answer is b.
ZNE runs the same logical circuit at different effective noise levels (e.g., via gate folding like replacing (U) with (UU^\dagger U)), then fits an extrapolator (linear, exponential, etc.) to estimate the zero-noise expectation value.
- In digital gate folding for ZNE, replacing a unitary by corresponds to which noise amplification factor?
a. 3
b. 2
c. 1
d. 0
answer
The answer is a.
Qiskit Runtime implements noise amplification by “digital gate folding,” which means that two-qubit gates are replaced with equivalent sequences of the gate and its inverse.
The sequence increases the effective number of noisy operations by a factor (noise_factors) of 3 while preserving the ideal unitary action, enabling controlled noise amplification for extrapolation.
- noise_factors: The noise factors to use for noise amplification.
- Probabilistic Error Amplification (PEA) provides a more accurate noise amplification than simple folding. Which statement captures its core idea?
a. It learns a twirled noise model for each entangling layer and then injects single-qubit noise proportionally during amplification.
b. It only repeats two-qubit gates and their inverses to scale noise without any learning.
c. It yields an exactly unbiased estimator of the expectation value without overhead.
d. It does not require ZNE to be enabled because it is a suppression (not mitigation) method.
answer
The answer is a.
PEA first learns the twirled noise per entangling layer, then amplifies by probabilistically injecting single‑qubit noise consistent with that learned model before extrapolating to the zero‑noise limit. It is typically used alongside ZNE in Estimator workflows.
- You need an unbiased estimator of ⟨O⟩ but can tolerate the highest shot overhead. Which mitigation method matches this requirement?
a. ZNE with linear extrapolation
b. PEC (probabilistic error cancellation)
c. TREX with many randomizations
d. Gate twirling only
answer
The answer is b.
PEC reconstructs the ideal channel as a quasi-probability mixture of noisy channels, yielding an unbiased expectation value estimate at the cost of large sampling overhead that scales with the quasi-probability L1 norm. ZNE often reduces bias but is not guaranteed unbiased; TREX and gate twirling address different error sources.
- In Pauli gate twirling as implemented for Estimator runs, how are randomized circuit instances and shots typically managed?
a. They change the backend’s native basis gates to Pauli-only operations.
b. Randomizations only affect calibration circuits and never the main circuit instances.
c. The parameters set the ZNE noise factors and the extrapolator form.
d. The Estimator samples multiple randomized instances (controlled by num_randomizations) and takes shots_per_randomization shots from each.
answer
The answer is d.
Gate twirling replaces a single circuit with an ensemble of randomized, Pauli‑wrapped instances that have the same ideal effect. The Estimator then draws a specified number of instances and shots per instance to estimate expectation values.
- For a Hermitian observable and real-valued expectation ⟨O⟩, what is the expected data type of the Estimator’s returned value (ignoring confidence intervals and metadata)?
a. A dictionary mapping bitstrings to counts
b. A complex number with generally nonzero imaginary part
c. A real scalar (float) expectation value
d. A list of complex amplitudes (statevector)
answer
The answer is c.
The Estimator primitive computes expectation values of observables; for Hermitian observables, the expectation is real and is returned as a real scalar. Counts dictionaries and statevectors belong to different primitives/tools; a nonzero imaginary part would contradict Hermiticity.
- Conceptually, how do error suppression and error mitigation differ for Estimator‑based workflows?
a. Suppression modifies the implemented circuit/pulse schedule to reduce noise during execution (e.g., DD, gate twirling), whereas mitigation post‑processes or re‑processes experimental data to adjust expectation values (e.g., TREX, ZNE, PEC).
b. Both terms mean the same thing and are interchangeable in practice.
c. Mitigation changes gate calibrations in hardware; suppression extrapolates to the zero‑noise limit.
d. Suppression is only about measurement, while mitigation is only about two‑qubit gates.
answer
The answer is a.
Suppression techniques alter what is executed (added pulses, randomized wrappers) to reduce error accumulation, while mitigation techniques change how results are estimated (diagonalizing readout noise, extrapolating to zero noise, or canceling errors via quasi‑probabilities) to recover better expectation values.
- Which Estimator option enables measurement error mitigation via TREX according to the documented resilience settings?
a. estimator.options.twirling.enable_gates = True
b. estimator.options.resilience.measure_mitigation = True
c. estimator.options.dynamical_decoupling.enable = True
d. estimator.options.resilience.zne_mitigation = True
answer
The answer is b.
resilience.measure_mitigation turns on TREX-based readout mitigation for Estimator. Gate twirling and DD are different options; zne_mitigation enables ZNE, not measurement mitigation.
- You want ZNE with specific amplification factors and an exponential extrapolator. Which option pair matches the documented keys?
a. estimator.options.zne.noise_factors, estimator.options.zne.extrapolator
b. estimator.options.resilience.zne.noise_factors, estimator.options.resilience.zne.extrapolator
c. estimator.options.zne.factors, estimator.options.zne.method='exponential'
d. estimator.options.resilience.zne.factors, estimator.options.resilience.zne.fit='exp'
answer
The answer is b.
ZNE is configured under options.resilience.zne, with keys like noise_factors and extrapolator (e.g., (1, 3, 5) and "exponential"). Other key paths/names are not documented.