decompose_from_cirq_style_method#

Return a CompositeBloq decomposition using a cirq-style decompose method.

The bloq must have a method with the given name (by default: “decompose_from_registers”) that satisfies the following function signature:

def decompose_from_registers(
    self, *, context: cirq.DecompositionContext, **quregs: NDArray[cirq.Qid]
) -> cirq.OP_TREE:

This must yield a list of cirq.Operations using cirq.Gate.on(...), Bloq.on(…), GateWithRegisters.on_registers(…), or Bloq.on_registers(…).

If Bloq.on() is used, the bloqs will be retained in their native form in the returned composite bloq. If cirq.Gate.on() is used, the gates will be wrapped in CirqGateAsBloq.

bloq

The bloq to decompose.

method_name

The string name of the method that can be found on the bloq that yields the cirq-style decomposition.