cirq.google.EjectZ

class cirq.google.EjectZ(tolerance: float = 0.0, ext: cirq.extension.extensions.Extensions = None)[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, ext: cirq.extension.extensions.Extensions = None) → 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.
  • ext – Extensions object used for determining if gates are phaseable (i.e. if Z gates can pass through them).

Methods

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