qp.resource_rep

resource_rep(op_type, **params)[source]

Binds an operator type with additional resource parameters.

Note

This function is only relevant when the new experimental graph-based decomposition system (introduced in v0.41) is enabled via qp.decomposition.enable_graph(). This new way of doing decompositions is generally more resource efficient and accommodates multiple alternative decomposition rules for an operator. In this new system, custom decomposition rules are defined as quantum functions, and it is currently required that every decomposition rule declares its required resources using register_resources().

Parameters:
  • op_type – the operator class to create a resource representation for.

  • **params – parameters relevant to the resource estimate of the operator’s decompositions. This should be consistent with op_type.resource_keys.

Returns:

a lightweight representation of the operator.

Return type:

pennylane.decomposition.resources.CompressedResourceOp

Contents

Using PennyLane

Release news

Development

API

Internals