示例#1
0
 def _value_equality_values_(self):
     c = self._canonical()
     return (
         value.PeriodicValue(c._x_exponent, 2),
         value.PeriodicValue(c._z_exponent, 2),
         value.PeriodicValue(c._axis_phase_exponent, 2),
     )
示例#2
0
文件: eigen_gate.py 项目: yy8yy/Cirq
 def _value_equality_approximate_values_(self):
     period = self._period()
     if not period or protocols.is_parameterized(self._exponent):
         exponent = self._exponent
     else:
         exponent = value.PeriodicValue(self._exponent, period)
     return exponent, self._global_shift
示例#3
0
 def _value_equality_approximate_values_(self):
     period = self._period()
     if not period or isinstance(self._exponent, value.Symbol):
         exponent = self._exponent
     else:
         exponent = value.PeriodicValue(self._exponent, period)
     return exponent, self._global_shift
示例#4
0
 def _value_equality_values_(self) -> Any:
     v = self.canonicalize(atol=0)
     return (value.PeriodicValue(v.angle, period=math.pi * 2), v.axis,
             v.global_phase)