cirq.flatten_to_ops

cirq.flatten_to_ops(root: Union[cirq.ops.raw_types.Operation, cirq.ops.op_tree.OpTree]) → Iterator[cirq.ops.raw_types.Operation][source]

Performs an in-order iteration of the operations (leaves) in an OP_TREE.

Parameters

root – The operation or tree of operations to iterate.

Yields

Operations or moments from the tree.

Raises

TypeError – root isn’t a valid OP_TREE.