# cirq.ExpandComposite¶

class cirq.ExpandComposite(no_decomp: Callable[cirq.ops.raw_types.Operation, bool] = <function ExpandComposite.<lambda>>)[source]

An optimizer that expands composite operations via cirq.decompose.

For each operation in the circuit, this pass examines if the operation can
be decomposed. If it can be, the operation is cleared out and and replaced
with its decomposition using a fixed insertion strategy.
__init__(no_decomp: Callable[cirq.ops.raw_types.Operation, bool] = <function ExpandComposite.<lambda>>) → None[source]

Construct the optimization pass.

Parameters: no_decomp – A predicate that determines whether an operation should be decomposed or not. Defaults to decomposing everything.

Methods

 optimization_at(circuit, index, op) Describes how to change operations near the given location. optimize_circuit(circuit) Rewrites the given circuit to make it better.