Closed
Description
Description of the issue
When you create a matrix gate with a name and exponentiate it, the initial name is lost as the name is not handed over to the power gate:
def pow(self, exponent: Any) -> 'MatrixGate':
if not isinstance(exponent, (int, float)):
return NotImplemented
new_mat = linalg.map_eigenvalues(self._matrix, lambda b: b**exponent)
return MatrixGate(new_mat, qid_shape=self._qid_shape)
How to reproduce the issue
Create a matrix gate with name and print a circuit containing a power of the gate
u = cirq.MatrixGate(np.identity(2), name = "U")
print(cirq.Circuit(u(cirq.LineQubit(1)),u(cirq.LineQubit(1))**2))