Skip to content

Commit 222c2e0

Browse files
authored
misc: Remove default value in new_corpse_in_scrofulous_control(#163)
1 parent 0ce53eb commit 222c2e0

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

qctrlopencontrols/driven_controls/predefined.py

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -726,9 +726,9 @@ def new_corpse_in_sk1_control(
726726

727727
def new_corpse_in_scrofulous_control(
728728
rabi_rotation: float,
729+
maximum_rabi_rate: float,
729730
azimuthal_angle: float = 0.0,
730-
maximum_rabi_rate: float = 2.0 * np.pi,
731-
**kwargs
731+
name: Optional[str] = None,
732732
) -> DrivenControl:
733733
r"""
734734
Creates a CORPSE concatenated within SCROFULOUS (CORPSE in SCROFULOUS) driven control.
@@ -741,24 +741,18 @@ def new_corpse_in_scrofulous_control(
741741
rabi_rotation : float
742742
The total Rabi rotation :math:`\theta` to be performed by the driven control. Must be either
743743
:math:`\pi/4`, :math:`\pi/2`, or :math:`\pi`.
744-
maximum_rabi_rate : float, optional
744+
maximum_rabi_rate : float
745745
The maximum Rabi frequency :math:`\Omega_{\rm max}` for the driven control.
746-
Defaults to :math:`2\pi`.
747746
azimuthal_angle : float, optional
748747
The azimuthal angle :math:`\phi` for the rotation. Defaults to 0.
749-
kwargs : dict
750-
Other keywords required to make a :py:obj:`DrivenControl`.
748+
name : str, optional
749+
An optional string to name the control. Defaults to ``None``.
751750
752751
Returns
753752
-------
754753
DrivenControl
755754
The driven control :math:`\{(\delta t_n, \Omega_n, \phi_n, \Delta_n)\}`.
756755
757-
Raises
758-
------
759-
ArgumentsValueError
760-
Raised when an argument is invalid.
761-
762756
See Also
763757
--------
764758
new_corpse_control, new_scrofulous_control
@@ -825,6 +819,12 @@ def new_corpse_in_scrofulous_control(
825819
rabi_rotation=rabi_rotation, maximum_rabi_rate=maximum_rabi_rate
826820
)
827821

822+
check_arguments(
823+
np.any(np.isclose(rabi_rotation, [np.pi, np.pi / 2, np.pi / 4])),
824+
"rabi_rotation angle must be either pi, pi/2 or pi/4",
825+
{"rabi_rotation": rabi_rotation},
826+
)
827+
828828
# Create a lookup table for rabi rotation and phase angles, taken from
829829
# the Cummins paper. Note: values in the paper are in degrees.
830830
def degrees_to_radians(angle_in_degrees):
@@ -842,17 +842,12 @@ def degrees_to_radians(angle_in_degrees):
842842
-np.pi * np.cos(theta_1) / 2 / theta_1 / np.sin(rabi_rotation / 2)
843843
)
844844
phi_2 = phi_1 - np.arccos(-np.pi / 2 / theta_1)
845-
elif np.isclose(rabi_rotation, 0.25 * np.pi):
845+
else:
846846
theta_1 = theta_3 = degrees_to_radians(96.7)
847847
phi_1 = phi_3 = np.arccos(
848848
-np.pi * np.cos(theta_1) / 2 / theta_1 / np.sin(rabi_rotation / 2)
849849
)
850850
phi_2 = phi_1 - np.arccos(-np.pi / 2 / theta_1)
851-
else:
852-
raise ArgumentsValueError(
853-
"rabi_rotation angle must be either pi, pi/2 or pi/4",
854-
{"rabi_rotation": rabi_rotation},
855-
)
856851

857852
theta_2 = np.pi
858853

@@ -885,7 +880,7 @@ def degrees_to_radians(angle_in_degrees):
885880
azimuthal_angles=azimuthal_angles,
886881
detunings=detunings,
887882
durations=durations,
888-
**kwargs,
883+
name=name,
889884
)
890885

891886

0 commit comments

Comments
 (0)