@@ -196,9 +196,10 @@ def _decompose_(self, qubits) -> Iterator['cirq.OP_TREE']:
196
196
yield cirq .CZ (a , b ) ** (- self .phi / np .pi )
197
197
198
198
def _circuit_diagram_info_ (self , args : 'cirq.CircuitDiagramInfoArgs' ) -> Tuple [str , ...]:
199
- t = args .format_radians (self .theta )
200
- p = args .format_radians (self .phi )
201
- return f'FSim({ t } , { p } )' , f'FSim({ t } , { p } )'
199
+ with np .printoptions (legacy = '1.25' ):
200
+ t = args .format_radians (self .theta )
201
+ p = args .format_radians (self .phi )
202
+ return f'FSim({ t } , { p } )' , f'FSim({ t } , { p } )'
202
203
203
204
def __pow__ (self , power ) -> 'FSimGate' :
204
205
return FSimGate (cirq .mul (self .theta , power ), cirq .mul (self .phi , power ))
@@ -476,15 +477,16 @@ def to_exponent(angle_rads: 'cirq.TParamVal') -> 'cirq.TParamVal':
476
477
yield cirq .Z (q1 ) ** to_exponent (after [1 ])
477
478
478
479
def _circuit_diagram_info_ (self , args : 'cirq.CircuitDiagramInfoArgs' ) -> Tuple [str , ...]:
479
- theta = args .format_radians (self .theta )
480
- zeta = args .format_radians (self .zeta )
481
- chi = args .format_radians (self .chi )
482
- gamma = args .format_radians (self .gamma )
483
- phi = args .format_radians (self .phi )
484
- return (
485
- f'PhFSim({ theta } , { zeta } , { chi } , { gamma } , { phi } )' ,
486
- f'PhFSim({ theta } , { zeta } , { chi } , { gamma } , { phi } )' ,
487
- )
480
+ with np .printoptions (legacy = '1.25' ):
481
+ theta = args .format_radians (self .theta )
482
+ zeta = args .format_radians (self .zeta )
483
+ chi = args .format_radians (self .chi )
484
+ gamma = args .format_radians (self .gamma )
485
+ phi = args .format_radians (self .phi )
486
+ return (
487
+ f'PhFSim({ theta } , { zeta } , { chi } , { gamma } , { phi } )' ,
488
+ f'PhFSim({ theta } , { zeta } , { chi } , { gamma } , { phi } )' ,
489
+ )
488
490
489
491
def __repr__ (self ) -> str :
490
492
theta = proper_repr (self .theta )
0 commit comments