import DecompositionRule from 'projectq/src/cengines/replacer/decompositionrule.js'
A rule for breaking down specific gates into sequences of simpler gates.
The type of gate that this rule decomposes.
The gate class is redundant information used to make lookups faster when iterating over a circuit and deciding "which rules apply to this gate?" again and again.
Note that this parameter is a gate type, not a gate instance. You supply gate_class=MyGate or gate_class=MyGate().class, not gate_class=MyGate().
Function which, given the command to decompose, applies a sequence of gates corresponding to the high-level function of a gate of type gate_class.
A predicate that determines if the decomposition applies to the given command (on top of the filtering by gate_class).
For example, a decomposition rule may only to apply rotation gates that rotate by a specific angle.
If no gate_recognizer is given, the decomposition applies to all gates matching the gate_class.