qml.decomposition.DecompositionRule

class DecompositionRule(func, resources=None, work_wires=None)[source]

Bases: object

Represents a decomposition rule for an operator.

compute_resources(*args, **kwargs)

Computes the resources required to implement this decomposition rule.

is_applicable(*args, **kwargs)

Checks whether this decomposition rule is applicable.

set_condition(condition)

Sets the condition for this decomposition rule.

set_resources(resources)

Sets the resources for this decomposition rule.

set_work_wire_spec(work_wires)

Sets the work wire usage of this decomposition rule.

work_wire_spec(*args, **kwargs)

Gets the work wire requirements of this decomposition rule

compute_resources(*args, **kwargs)[source]

Computes the resources required to implement this decomposition rule.

is_applicable(*args, **kwargs)[source]

Checks whether this decomposition rule is applicable.

set_condition(condition)[source]

Sets the condition for this decomposition rule.

set_resources(resources)[source]

Sets the resources for this decomposition rule.

set_work_wire_spec(work_wires)[source]

Sets the work wire usage of this decomposition rule.

work_wire_spec(*args, **kwargs)[source]

Gets the work wire requirements of this decomposition rule