# cirq.EjectZ¶

class cirq.EjectZ(tolerance: float = 0.0)[source]

Pushes Z gates towards the end of the circuit.

As the Z gates get pushed they may absorb other Z gates, get absorbed into
measurements, cross CZ gates, cross W gates (by phasing them), etc.
__init__(tolerance: float = 0.0) → None[source]
Parameters: tolerance – Maximum absolute error tolerance. The optimization is permitted to simply drop negligible combinations of Z gates, with a threshold determined by this tolerance.

Methods

 optimize_circuit(circuit) Rewrites the given circuit to make it better.