The cirq.EigenGate
class is not one specific gate; it's more like a framework for describing gates in a way that makes it easy to do things like compute the square root of the gate. For example, cirq.X
, cirq.H
, cirq.Z
, and cirq.S
are all implemented using classes that derive from eigengate. As a result, you can compute roots like cirq.Z**0.5 == cirq.S
.
The underlying machinery of the class is based on working with the eigendecomposition of the unitary matrix defining the gate. This is of course a very common way of working with matrices, taught in every linear algebra course. The class deriving from eigengate will provide the eigenvalues and eigenvectors of the decomposition, and the eigengate class will handle combining them into a matrix and operating on the eigenvalues when a function of the gate is requested.