2020
2121from cirq import protocols , value , linalg , qis
2222from cirq ._import import LazyLoader
23- from cirq ._compat import cached_property , cached_method
23+ from cirq ._compat import cached_method
2424from cirq .ops import common_gates , named_qubit , raw_types , pauli_gates , phased_x_z_gate
2525from cirq .ops .pauli_gates import Pauli
2626from cirq .type_workarounds import NotImplementedType
@@ -693,7 +693,7 @@ def to_phased_xz_gate(self) -> phased_x_z_gate.PhasedXZGate:
693693 """
694694 return self ._to_phased_xz_gate
695695
696- @cached_property
696+ @functools . cached_property
697697 def _to_phased_xz_gate (self ) -> phased_x_z_gate .PhasedXZGate :
698698 x_to_flip , z_to_flip = self .clifford_tableau .rs
699699 flip_index = int (z_to_flip ) * 2 + x_to_flip
@@ -792,7 +792,7 @@ def _has_unitary_(self) -> bool:
792792 def _unitary_ (self ) -> np .ndarray :
793793 return self ._unitary
794794
795- @cached_property
795+ @functools . cached_property
796796 def _unitary (self ) -> np .ndarray :
797797 mat = np .eye (2 )
798798 qubit = named_qubit .NamedQubit ('arbitrary' )
@@ -810,7 +810,7 @@ def decompose_gate(self) -> Sequence['cirq.Gate']:
810810 """
811811 return self ._decompose_gate
812812
813- @cached_property
813+ @functools . cached_property
814814 def _decompose_gate (self ) -> Sequence ['cirq.Gate' ]:
815815 if self == SingleQubitCliffordGate .H :
816816 return [common_gates .H ]
@@ -829,7 +829,7 @@ def decompose_rotation(self) -> Sequence[Tuple[Pauli, int]]:
829829 """
830830 return self ._decompose_rotation
831831
832- @cached_property
832+ @functools . cached_property
833833 def _decompose_rotation (self ) -> Sequence [Tuple [Pauli , int ]]:
834834 x_rot = self .pauli_tuple (pauli_gates .X )
835835 y_rot = self .pauli_tuple (pauli_gates .Y )
@@ -926,7 +926,7 @@ def _circuit_diagram_info_(
926926 def _value_equality_values_ (self ):
927927 return self ._value_equality_values
928928
929- @cached_property
929+ @functools . cached_property
930930 def _value_equality_values (self ):
931931 return self ._clifford_tableau .matrix ().tobytes () + self ._clifford_tableau .rs .tobytes ()
932932
0 commit comments