Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK. Go to the latest version

RXCalibrationBuilder

class qiskit.transpiler.passes.RXCalibrationBuilder(*args, **kwargs)

GitHub

Bases: CalibrationBuilder

Add single-pulse RX calibrations that are bootstrapped from the SX calibration.

Note

Requirement: NormalizeRXAngles pass (one of the optimization passes).

It is recommended to place this pass in the post-optimization stage of a passmanager. A simple demo:

from qiskit.providers.fake_provider import GenericBackendV2
from qiskit.transpiler import PassManager, PassManagerConfig
from qiskit.transpiler.preset_passmanagers import level_1_pass_manager
from qiskit.circuit import Parameter
from qiskit.circuit.library import QuantumVolume
from qiskit.circuit.library.standard_gates import RXGate
 
from qiskit.transpiler.passes import RXCalibrationBuilder
 
qv = QuantumVolume(4, 4, seed=1004)
 
# Transpiling with single pulse RX gates enabled
backend_with_single_pulse_rx = GenericBackendV2(5)
rx_inst_props = {}
for i in range(backend_with_single_pulse_rx.num_qubits):
  rx_inst_props[(i,)] = None
backend_with_single_pulse_rx.target.add_instruction(RXGate(Parameter("theta")), rx_inst_props)
config_with_rx = PassManagerConfig.from_backend(backend=backend_with_single_pulse_rx)
pm_with_rx = level_1_pass_manager(pass_manager_config=config_with_rx)
rx_builder = RXCalibrationBuilder(target=backend_with_single_pulse_rx.target)
pm_with_rx.post_optimization = PassManager([rx_builder])
transpiled_circ_with_single_pulse_rx = pm_with_rx.run(qv)
transpiled_circ_with_single_pulse_rx.count_ops()
 
# Conventional transpilation: each RX gate is decomposed into a sequence with two SX gates
original_backend = GenericBackendV2(5)
original_config = PassManagerConfig.from_backend(backend=original_backend)
original_pm = level_1_pass_manager(pass_manager_config=original_config)
original_transpiled_circ = original_pm.run(qv)
original_transpiled_circ.count_ops()

References

Bootstrap single-pulse RX gate calibrations from the (hardware-calibrated) SX gate calibration.

Parameters

  • target (Target) – Should contain a SX calibration that will be
  • calibrations. (used for bootstrapping RX) –

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

execute(passmanager_ir, state, callback=None)

GitHub

Execute optimization task for input Qiskit IR.

Parameters

  • passmanager_ir (Any) – Qiskit IR to optimize.
  • state (PassManagerState) – State associated with workflow execution by the pass manager itself.
  • callback (Callable | None) – A callback function which is caller per execution of optimization task.

Returns

Optimized Qiskit IR and state of the workflow.

Return type

tuple[Any, qiskit.passmanager.compilation_status.PassManagerState]

get_calibration

get_calibration(node_op, qubits)

GitHub

Generate RX calibration for the rotation angle specified in node_op.

Return type

Schedule | ScheduleBlock

name

name()

GitHub

Name of the pass.

Return type

str

run

run(dag)

GitHub

Run the calibration adder pass on dag.

Parameters

dag (DAGCircuit) – DAG to schedule.

Returns

A DAG with calibrations added to it.

Return type

DAGCircuit

supported

supported(node_op, qubits)

GitHub

Check if the calibration for SX gate exists and it’s a single DRAG pulse.

Return type

bool

update_status

update_status(state, run_state)

GitHub

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

Was this page helpful?
Report a bug or request content on GitHub.