@@ -74,8 +74,11 @@ def test_rzx_number_native_weyl_decomposition(self):
7474 circuit .cx (qr [0 ], qr [1 ])
7575
7676 unitary_circuit = qi .Operator (circuit ).data
77-
78- after = EchoRZXWeylDecomposition (self .inst_map )(circuit )
77+ with self .assertWarnsRegex (
78+ DeprecationWarning ,
79+ expected_regex = "The entire Qiskit Pulse package" ,
80+ ):
81+ after = EchoRZXWeylDecomposition (self .inst_map )(circuit )
7982
8083 unitary_after = qi .Operator (after ).data
8184
@@ -97,11 +100,19 @@ def test_h_number_non_native_weyl_decomposition_1(self):
97100 circuit_non_native .rzz (theta , qr [1 ], qr [0 ])
98101
99102 dag = circuit_to_dag (circuit )
100- pass_ = EchoRZXWeylDecomposition (self .inst_map )
103+ with self .assertWarnsRegex (
104+ DeprecationWarning ,
105+ expected_regex = "The entire Qiskit Pulse package" ,
106+ ):
107+ pass_ = EchoRZXWeylDecomposition (self .inst_map )
101108 after = dag_to_circuit (pass_ .run (dag ))
102109
103110 dag_non_native = circuit_to_dag (circuit_non_native )
104- pass_ = EchoRZXWeylDecomposition (self .inst_map )
111+ with self .assertWarnsRegex (
112+ DeprecationWarning ,
113+ expected_regex = "The entire Qiskit Pulse package" ,
114+ ):
115+ pass_ = EchoRZXWeylDecomposition (self .inst_map )
105116 after_non_native = dag_to_circuit (pass_ .run (dag_non_native ))
106117
107118 circuit_rzx_number = self .count_gate_number ("rzx" , after )
@@ -127,11 +138,19 @@ def test_h_number_non_native_weyl_decomposition_2(self):
127138 circuit_non_native .swap (qr [1 ], qr [0 ])
128139
129140 dag = circuit_to_dag (circuit )
130- pass_ = EchoRZXWeylDecomposition (self .inst_map )
141+ with self .assertWarnsRegex (
142+ DeprecationWarning ,
143+ expected_regex = "The entire Qiskit Pulse package" ,
144+ ):
145+ pass_ = EchoRZXWeylDecomposition (self .inst_map )
131146 after = dag_to_circuit (pass_ .run (dag ))
132147
133148 dag_non_native = circuit_to_dag (circuit_non_native )
134- pass_ = EchoRZXWeylDecomposition (self .inst_map )
149+ with self .assertWarnsRegex (
150+ DeprecationWarning ,
151+ expected_regex = "The entire Qiskit Pulse package" ,
152+ ):
153+ pass_ = EchoRZXWeylDecomposition (self .inst_map )
135154 after_non_native = dag_to_circuit (pass_ .run (dag_non_native ))
136155
137156 circuit_rzx_number = self .count_gate_number ("rzx" , after )
@@ -166,7 +185,11 @@ def test_weyl_decomposition_gate_angles(self):
166185 unitary_circuit = qi .Operator (circuit ).data
167186
168187 dag = circuit_to_dag (circuit )
169- pass_ = EchoRZXWeylDecomposition (self .inst_map )
188+ with self .assertWarnsRegex (
189+ DeprecationWarning ,
190+ expected_regex = "The entire Qiskit Pulse package" ,
191+ ):
192+ pass_ = EchoRZXWeylDecomposition (self .inst_map )
170193 after = dag_to_circuit (pass_ .run (dag ))
171194 dag_after = circuit_to_dag (after )
172195
@@ -221,7 +244,11 @@ def test_weyl_unitaries_random_circuit(self):
221244 unitary_circuit = qi .Operator (circuit ).data
222245
223246 dag = circuit_to_dag (circuit )
224- pass_ = EchoRZXWeylDecomposition (self .inst_map )
247+ with self .assertWarnsRegex (
248+ DeprecationWarning ,
249+ expected_regex = "The entire Qiskit Pulse package" ,
250+ ):
251+ pass_ = EchoRZXWeylDecomposition (self .inst_map )
225252 after = dag_to_circuit (pass_ .run (dag ))
226253
227254 unitary_after = qi .Operator (after ).data
0 commit comments