AddPostCircuitBitFlipChecks

class AddPostCircuitBitFlipChecks(*args, **kwargs)[source]

Bases: TransformationPass

Add bit-flip checks at the end of the circuit on active qubits terminated by a measurement.

A post-circuit bit-flip check consists of a narrowband X-pulse located after a terminal measurement that flips the state of the qubit from the measured state \(|x\rangle\mapsto|x\oplus1\rangle\). The state is then measured, and if the QPU failed to flip the qubit on a given shot, that sample may be considered unreliable and discarded. Postselecting only samples that pass all checks can improve the fidelity of distributions sampled from the QPU.

The added measurements write to new classical registers that are copies of the DAG’s registers, with modified names (by default, appending "_ps" to the register name).

Note

These passes are only supported on Heron QPUs where fractional gates are supported.

Initialize the pass.

Parameters:
  • x_pulse_type – The type of X-pulse to apply for the post-check measurements. Either "xslow" or "rx".

  • post_check_suffix – A fixed suffix to append to the names of the classical registers when copying them.

  • ignore_creg_suffixes – A list of suffixes for classical registers that should be ignored (not copied). By default, registers ending with “_pre” are ignored to avoid adding post-check to pre-check registers.

Attributes

is_analysis_pass

Check if the pass is an analysis pass.

If the pass is an AnalysisPass, that means that the pass can analyze the DAG and write the results of that analysis in the property set. Modifications on the DAG are not allowed by this kind of pass.

is_transformation_pass

Check if the pass is a transformation pass.

If the pass is a TransformationPass, that means that the pass can manipulate the DAG, but cannot modify the property set (but it can be read).

Methods

execute(passmanager_ir, state, callback=None)

Execute optimization task for input Qiskit IR.

Parameters:
  • passmanager_ir (DAGCircuit) – Qiskit IR to optimize.

  • state (DAGCircuit) – State associated with workflow execution by the pass manager itself.

  • callback (Callable[[Task, DAGCircuit, PropertySet, float, int], None] | None) – A callback function which is called per execution of optimization task.

Returns:

Optimized Qiskit IR and state of the workflow.

Return type:

tuple[DAGCircuit, PassManagerState]

name()

Name of the pass.

Return type:

str

run(dag)[source]

Run a pass on the DAGCircuit. This is implemented by the pass developer.

Parameters:

dag (DAGCircuit) – the dag on which the pass is run.

Raises:

NotImplementedError – when this is left unimplemented for a pass.

update_status(state, run_state)

Update workflow status.

Parameters:
  • state (PassManagerState) – Pass manager state to update.

  • run_state (RunState) – Completion status of current task.

Returns:

Updated pass manager state.

Return type:

PassManagerState