ValidatePulseGates
class qiskit.transpiler.passes.ValidatePulseGates(*args, **kwargs)
Bases: AnalysisPass
Check custom gate length.
This is a control electronics aware analysis pass.
Quantum gates (instructions) are often implemented with shaped analog stimulus signals. These signals may be digitally stored in the waveform memory of the control electronics and converted into analog voltage signals by electronic components known as digital to analog converters (DAC).
In Qiskit SDK, we can define the pulse-level implementation of custom quantum gate instructions, as a pulse gate, thus user gates should satisfy all waveform memory constraints imposed by the backend.
This pass validates all attached calibration entries and raises TranspilerError
to kill the transpilation process if any invalid calibration entry is found. This pass saves users from waiting until job execution time to get an invalid pulse error from the backend control electronics.
Create new pass.
Parameters
- granularity – Integer number representing the minimum time resolution to define the pulse gate length in units of
dt
. This value depends on the control electronics of your quantum processor. - min_length – Integer number representing the minimum data point length to define the pulse gate in units of
dt
. This value depends on the control electronics of your quantum processor.
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)
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
run
run(dag)
Run the pulse gate validation attached to dag
.
Parameters
dag (DAGCircuit) – DAG to be validated.
Returns
DAG with consistent timing and op nodes annotated with duration.
Return type
Raises
TranspilerError – When pulse gate violate pulse controller constraints.
update_status
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