qml.decomposition.controlled_resource_rep¶
- controlled_resource_rep(base_class, base_params, num_control_wires, num_zero_control_values=0, num_work_wires=0, work_wire_type='dirty')[source]¶
Creates a
CompressedResourceOp
representation of a controlled operator.This function mirrors the custom logic in
qml.ctrl
which does the following:Flattens nested controlled operations.
Dispatches to custom-controlled operations when applicable.
- Parameters:
base_class – the base operator type
base_params (dict) – the resource params of the base operator
num_control_wires (int) – the number of control wires
num_zero_control_values (int) – the number of control values that are 0
num_work_wires (int) – the number of work wires
work_wire_type (str) – the type of work wire
code/api/pennylane.decomposition.controlled_resource_rep
Download Python script
Download Notebook
View on GitHub