Skip to main contentIBM Quantum Documentation

NormalizeRXAngle

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

GitHub

Bases: TransformationPass

Normalize theta parameter of RXGate instruction.

The parameter normalization is performed with following steps.

1) Wrap RX Gate theta into [0, pi]. When theta is negative value, the gate is decomposed into the following sequence.

   ┌───────┐┌─────────┐┌────────┐
q:Rz(π) ├┤ Rx(|θ|) ├┤ Rz(-π)
   └───────┘└─────────┘└────────┘
  1. If the operation is supported by target, convert RX(pi/2) to SX, and RX(pi) to X.
  2. Quantize theta value according to the user-specified resolution.

This will help reduce the size of calibration data sent over the wire, and allow us to exploit the more accurate, hardware-calibrated pulses. Note that pulse calibration might be attached per each rotation angle.

NormalizeRXAngle initializer.

Parameters

  • target (Target) – The Target representing the target backend. If the target contains SX and X calibrations, this pass will replace the corresponding RX gates with SX and X gates.
  • resolution_in_radian (float) – Resolution for RX rotation angle quantization. If set to zero, this pass won’t modify the rotation angles in the given DAG. (=Provides arbitrary-angle 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]

name

name()

GitHub

Name of the pass.

Return type

str

quantize_angles

quantize_angles(qubit, original_angle)

GitHub

Quantize the RX rotation angles by assigning the same value for the angles that differ within a resolution provided by the user.

Parameters

  • qubit (qiskit.circuit.Qubit) – This will be the dict key to access the list of quantized rotation angles.
  • original_angle (float) – Original rotation angle, before quantization.

Returns

Quantized angle.

Return type

float

run

run(dag)

GitHub

Run the NormalizeRXAngle pass on dag.

Parameters

dag (DAGCircuit) – The DAG to be optimized.

Returns

A DAG with RX gate calibration.

Return type

DAGCircuit

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.