Skip to content

Qiskit

The in-app starter (Bell state — runnable as-is):

from qiskit import QuantumCircuit
# Create a Bell State
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])
StageBehavior
DiscoveryAfter exec(), the last QuantumCircuit instance in the namespace wins — define two circuits and the most recently assigned one is rendered/simulated.
Gate namesThree-tier mapping: gate class name via GATE_NAME_MAP (HGateH, CXGateCNOT, CCXGateToffoli, …) → lowercase op.name fallback (cxCNOT, …) → unknown gates pass through as op.name.upper().
LayeringShared greedy algorithm: each gate lands in the earliest layer where all of its qubits are free.
classical_bit_countThe circuit’s num_clbits.

Canonical gate vocabulary (incl. the Qiskit-only U1/U2/U3) is on the schemas page.

Two separate AerSimulator passes per execute:

  1. Exact statevector — a copy of the circuit with remove_final_measurements() + save_statevector(), run once on AerSimulator(method="statevector"). Produces state_vector, exact probabilities, and per-qubit Bloch coordinates via partial trace.
  2. Sampled counts — the original circuit (measurements intact) on a default AerSimulator with the requested shots. Produces measurements.

Bitstring keys follow Qiskit’s little-endian convention — qubit 0 is the rightmost character. See bitstring-key conventions.

  • Symbolic Parameters raise. Snapshot extraction calls float() on every gate parameter, so an unbound Parameter fails the parse — surfaced as adapter_error. Call assign_parameters(...) with concrete values first.
  • Measurement-less circuits fail on execute. The sampled pass calls get_counts(), which Aer rejects when the circuit has no measurements — surfaced as simulation_error (the snapshot still arrives, so the diagram renders; live-typing parse is unaffected). Add qc.measure(...) or qc.measure_all().
  • No transpilation locally. The local simulation runs your circuit verbatim; transpilation to a basis gate set only happens on hardware submission (e.g. IBM transpiles against the selected backend).
  • Mid-circuit measurements are kept in the sampled pass but stripped only as final measurements in the statevector pass — remove_final_measurements() does not remove mid-circuit ones, and Aer’s statevector method will then sample them, making state_vector shot-dependent for such circuits.