@@ -180,8 +180,8 @@ def convert_dds_to_qiskit_quantum_circuit(
180180
181181 if offset_distance < 0 :
182182 raise ArgumentsValueError (
183- "Offsets cannot be placed properly. Spacing between the rotations "
184- "is smaller than the time required to perform the rotation. Provide "
183+ "Offsets cannot be placed properly. Spacing between the rotations"
184+ "is smaller than the time required to perform the rotation. Provide"
185185 "a longer dynamic decoupling sequence or shorted gate time." ,
186186 {'dynamic_decoupling_sequence' : dynamic_decoupling_sequence ,
187187 'gate_time' : gate_time })
@@ -192,11 +192,14 @@ def convert_dds_to_qiskit_quantum_circuit(
192192 quantum_circuit .barrier (quantum_registers [qubit ]) # pylint: disable=no-member
193193 time_covered += gate_time
194194
195- rotations = np .array ([rabi_rotation * np .cos (azimuthal_angle ),
196- rabi_rotation * np .sin (azimuthal_angle ),
197- detuning_rotation ])
198- zero_pulse_count = np .sum (np .isclose (rotations , 0.0 ).astype (np .int ))
199- if zero_pulse_count < 2 :
195+ x_rotation = rabi_rotation * np .cos (azimuthal_angle )
196+ y_rotation = rabi_rotation * np .sin (azimuthal_angle )
197+ z_rotation = detuning_rotation
198+
199+ rotations = np .array ([x_rotation , y_rotation , z_rotation ])
200+ zero_pulses = np .isclose (rotations , 0.0 ).astype (np .int )
201+ nonzero_pulse_counts = 3 - np .sum (zero_pulses )
202+ if nonzero_pulse_counts > 1 :
200203 raise ArgumentsValueError (
201204 'Open Controls support a sequence with one '
202205 'valid rotation at any offset. Found a sequence '
@@ -209,7 +212,7 @@ def convert_dds_to_qiskit_quantum_circuit(
209212 )
210213
211214 for qubit in target_qubits :
212- if zero_pulse_count == 3 :
215+ if nonzero_pulse_counts == 0 :
213216 quantum_circuit .u3 (
214217 0. , 0. , 0. , # pylint: disable=no-member
215218 quantum_registers [qubit ])
0 commit comments