qml.decomposition.has_decomp

has_decomp(op)[source]

Checks whether an operator has decomposition rules defined.

Note

This function is only relevant when the new experimental graph-based decomposition system (introduced in v0.41) is enabled via enable_graph(). This new way of doing decompositions is generally more resource efficient and accommodates multiple alternative decomposition rules for an operator.

Parameters:

op (type or Operator or str) – the operator or operator type to check for decomposition rules. For symbolic operators, use strings like "Adjoint(RY)", "Pow(H)", "C(RX)", etc.

Returns:

whether decomposition rules are defined for the given operator.

Return type:

bool