Day 4 — Running Circuits
Question Bank
20 questions. One correct answer each. Answers in solution-bank.md.
Q1. Which of the following is a valid channel value for
QiskitRuntimeService.save_account() in current qiskit-ibm-runtime?
- A)
"ibm_q" - B)
"ibm_quantum_platform" - C)
"ibm_quantum_experience" - D)
"aer"
Q2. You are running VQE: each Estimator job's parameters depend on the classical optimizer's processing of the previous job's result. Which execution mode is recommended?
- A) Job mode, submitting each iteration separately
- B) Batch mode, so iterations are parallelized
- C) Session mode
- D) Local testing mode, since VQE cannot run on hardware
Q3. You have 40 independent circuits, all fully specified up front, and you want to compare error-mitigation settings across them as cheaply as possible. Recommended mode?
- A) Session mode, for exclusive access
- B) Job mode, one job per circuit
- C) A session per circuit
- D) Batch mode
Q4. According to IBM's guidance, which mode should you always use to submit a single primitive request?
- A) Job mode
- B) Batch mode, since the overhead is zero
- C) Session mode, since it guarantees earliest start
- D) Any mode — queue time for a single job is lower in sessions
Q5. What execution mode does this code use?
backend = service.least_busy(operational=True, simulator=False)
sampler = SamplerV2(mode=backend)
job = sampler.run([isa_pub])- A) Session mode, created implicitly
- B) Batch mode
- C) Job mode
- D) Local testing mode
Q6. What happens when the with Session(backend=backend) as session:
block exits?
- A) The session stays open until the interactive timeout closes it
- B) The session is canceled and all queued jobs are terminated immediately
- C) Nothing — you must call
session.close()explicitly - D) The session is closed: it stops accepting new jobs, but jobs already submitted run to completion
Q7. Which call returns the real, operational QPU with the fewest pending jobs?
- A)
service.backend(least_busy=True) - B)
service.least_busy(operational=True, simulator=False) - C)
service.backends(sort="queue")[0] - D)
QiskitRuntimeService.least_busy(hardware=True)
Q8. You submit a circuit containing an h gate directly to
EstimatorV2(mode=backend) where backend is an IBM QPU whose basis gates
are rz, sx, x, ecr. What happens?
- A) The primitive transpiles the circuit automatically before running
- B) The job is rejected with an error because the circuit is not an ISA circuit
- C) The
hgate is skipped and the rest of the circuit runs - D) The job runs but results carry a warning flag
Q9. Which tuple is a valid Estimator PUB with parameter values?
- A)
(observables, circuit, parameter_values) - B)
(circuit, parameter_values, observables) - C)
(circuit, observables, parameter_values) - D)
(parameter_values, observables, circuit)
Q10. An Estimator PUB has observables of shape (2, 1) and 5 parameter
value sets (shape (5,)). What is the shape of result[0].data.evs?
- A)
(2, 5) - B)
(5, 2) - C)
(7,) - D) Broadcasting fails — shapes must match exactly
Q11. Which statement about job = sampler.run(pubs) is TRUE?
- A)
run()blocks until all PUBs complete, then returns results - B)
run()returns a job object immediately;job.result()blocks until done - C)
run()returns results directly for local primitives, a job for hardware - D)
run()requires exactly one PUB per call
Q12. In an active session, no new job is submitted within the interactive TTL after the last job completes. What happens?
- A) The session is permanently closed and cannot be used again
- B) The session's max TTL timer pauses until the next job arrives
- C) The session is temporarily deactivated; a later job can reactivate it via the normal queue if max TTL has not been reached
- D) All primitives bound to the session raise an exception
Q13. A session reaches its maximum TTL (max_time) while several of its
jobs are still waiting in its queue. What happens to those queued jobs?
- A) They fail
- B) They run to completion because they were accepted before the deadline
- C) They are moved into a new automatically created session
- D) They fall back to job mode in the regular queue
Q14. Which statement about batch mode is TRUE?
- A) Batch jobs are guaranteed to execute in submission order
- B) A batch gives you exclusive access to the QPU between its jobs
- C) Batch jobs are independent and share no state; they may run out of order
- D) Later jobs in a batch can read the results of earlier jobs on the server
Q15. Which limitation applies to Open Plan users?
- A) They cannot submit batch jobs
- B) They cannot submit session jobs
- C) They cannot use
least_busy() - D) They cannot run jobs with more than 100 shots
Q16. You want to check your algorithm's ideal (noise-free) output locally without an IBM account. Which is the most direct choice?
- A)
SamplerV2(mode="ibm_brisbane") - B)
StatevectorSamplerfromqiskit.primitives - C)
Session(backend=FakeManilaV2())withSamplerV2 - D)
service.least_busy(simulator=True)
Q17. What do the fake backends in qiskit_ibm_runtime.fake_provider
provide?
- A) Live connections to retired IBM devices
- B) Ideal, noise-free statevector simulation only
- C) QPU snapshots including coupling map, basis gates, and a noise model applied automatically during simulation
- D) A remote cloud simulator that requires saved credentials
Q18. What does this code print or raise?
from qiskit import QuantumCircuit
from qiskit_ibm_runtime import SamplerV2
from qiskit_ibm_runtime.fake_provider import FakeManilaV2
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()
job = SamplerV2(mode=FakeManilaV2()).run([qc])
print(job.result()[0].data.meas.get_counts())- A) Noisy Bell-state counts near 50/50
00/11 - B) Exact 50/50 counts, since fake backends are ideal
- C) An error: the circuit is not an ISA circuit for the fake backend's target
- D) An error: fake backends do not support SamplerV2
Q19. Which snippet correctly runs an estimator inside a session?
- A)
with Session(backend=backend) as session:
estimator = EstimatorV2(mode=session)
job = estimator.run(pubs)- B)
with Session(backend) as session:
estimator = EstimatorV2(session=True)
job = estimator.run(pubs)- C)
session = Session(mode=backend)
estimator = EstimatorV2(backend=session)
job = estimator.run(pubs)- D)
with Session(backend=backend):
estimator = EstimatorV2(mode="session")
job = estimator.run(pubs)Q20. Which set of objects can be passed as mode= when instantiating
SamplerV2?
- A) Only a
Sessionobject - B) A backend object, a
Session, or aBatch - C) Only the strings
"job","batch","session" - D) A
QiskitRuntimeServiceinstance or a backend name list