@@ -393,20 +393,15 @@ def test_quadratic_sequence():
393393 _rabi_rotations [0 :outer_offset_count , - 1 ] = np .pi
394394 _detuning_rotations [0 : (outer_offset_count + 1 ), 0 :inner_offset_count ] = np .pi
395395
396- _offsets = np .reshape (_offsets , (- 1 ,))
397- _rabi_rotations = np .reshape (_rabi_rotations , (- 1 ,))
398- _detuning_rotations = np .reshape (_detuning_rotations , (- 1 ,))
396+ _reshaped_offsets = np .reshape (_offsets , (- 1 ,))[0 :- 1 ]
397+ _reshaped_rabi_rotations = np .reshape (_rabi_rotations , (- 1 ,))[0 :- 1 ]
398+ _reshaped_detuning_rotations = np .reshape (_detuning_rotations , (- 1 ,))[0 :- 1 ]
399+ _azimuthal_angles = np .zeros (_reshaped_offsets .shape )
399400
400- _offsets = _offsets [0 :- 1 ]
401- _rabi_rotations = _rabi_rotations [0 :- 1 ]
402- _detuning_rotations = _detuning_rotations [0 :- 1 ]
403-
404- _azimuthal_angles = np .zeros (_offsets .shape )
405-
406- assert np .allclose (_offsets , sequence .offsets )
407- assert np .allclose (_rabi_rotations , sequence .rabi_rotations )
401+ assert np .allclose (_reshaped_offsets , sequence .offsets )
402+ assert np .allclose (_reshaped_rabi_rotations , sequence .rabi_rotations )
408403 assert np .allclose (_azimuthal_angles , sequence .azimuthal_angles )
409- assert np .allclose (_detuning_rotations , sequence .detuning_rotations )
404+ assert np .allclose (_reshaped_detuning_rotations , sequence .detuning_rotations )
410405
411406 sequence = new_quadratic_sequence (
412407 duration = duration ,
@@ -415,21 +410,25 @@ def test_quadratic_sequence():
415410 pre_post_rotation = True ,
416411 )
417412
418- _offsets = np .insert (_offsets , [0 , _offsets .shape [0 ]], [0 , duration ])
419- _rabi_rotations = np .insert (
420- _rabi_rotations , [0 , _rabi_rotations .shape [0 ]], [np .pi / 2 , np .pi / 2 ]
413+ _reshaped_offsets = np .insert (
414+ _reshaped_offsets , [0 , _reshaped_offsets .shape [0 ]], [0 , duration ]
421415 )
422- _detuning_rotations = np .insert (
423- _detuning_rotations , [0 , _detuning_rotations .shape [0 ]], [0 , 0 ]
416+ _reshaped_rabi_rotations = np .insert (
417+ _reshaped_rabi_rotations ,
418+ [0 , _reshaped_rabi_rotations .shape [0 ]],
419+ [np .pi / 2 , np .pi / 2 ],
420+ )
421+ _reshaped_detuning_rotations = np .insert (
422+ _reshaped_detuning_rotations , [0 , _reshaped_detuning_rotations .shape [0 ]], [0 , 0 ]
424423 )
425424
426- _azimuthal_angles = np .zeros (_offsets .shape )
425+ _azimuthal_angles = np .zeros (_reshaped_offsets .shape )
427426 _azimuthal_angles [- 1 ] = np .pi
428427
429- assert np .allclose (_offsets , sequence .offsets )
430- assert np .allclose (_rabi_rotations , sequence .rabi_rotations )
428+ assert np .allclose (_reshaped_offsets , sequence .offsets )
429+ assert np .allclose (_reshaped_rabi_rotations , sequence .rabi_rotations )
431430 assert np .allclose (_azimuthal_angles , sequence .azimuthal_angles )
432- assert np .allclose (_detuning_rotations , sequence .detuning_rotations )
431+ assert np .allclose (_reshaped_detuning_rotations , sequence .detuning_rotations )
433432
434433
435434def test_x_concatenated_sequence ():
0 commit comments