def test_control_export():
    """
    Tests exporting the control to a file.
    """
    _rabi_rates = [5 * np.pi, 4 * np.pi, 3 * np.pi]
    _azimuthal_angles = [np.pi / 4, np.pi / 3, 0]
    _detunings = [0, 0, np.pi]
    _durations = [2, 2, 1]

    _name = "driven_control"

    driven_control = DrivenControl(
        rabi_rates=_rabi_rates,
        azimuthal_angles=_azimuthal_angles,
        detunings=_detunings,
        durations=_durations,
        name=_name,
    )

    _filename = "driven_control_qctrl_cylindrical.csv"
    driven_control.export_to_file(
        filename=_filename,
        file_format="Q-CTRL expanded",
        file_type="CSV",
        coordinates="cylindrical",
    )

    _filename = "driven_control_qctrl_cartesian.csv"
    driven_control.export_to_file(
        filename=_filename,
        file_format="Q-CTRL expanded",
        file_type="CSV",
        coordinates="cartesian",
    )

    _filename = "driven_control_qctrl_cylindrical.json"
    driven_control.export_to_file(
        filename=_filename,
        file_format="Q-CTRL expanded",
        file_type="JSON",
        coordinates="cylindrical",
    )

    _filename = "driven_control_qctrl_cartesian.json"
    driven_control.export_to_file(
        filename=_filename,
        file_format="Q-CTRL expanded",
        file_type="JSON",
        coordinates="cartesian",
    )

    _remove_file("driven_control_qctrl_cylindrical.csv")
    _remove_file("driven_control_qctrl_cartesian.csv")
    _remove_file("driven_control_qctrl_cylindrical.json")
    _remove_file("driven_control_qctrl_cartesian.json")
def test_control_export():

    """Tests exporting the control to a file
    """
    _rabi_rates = [5 * np.pi, 4 * np.pi, 3 * np.pi]
    _azimuthal_angles = [np.pi / 4, np.pi / 3, 0]
    _detunings = [0, 0, np.pi]
    _durations = [2, 2, 1]

    _name = 'driven_control'

    driven_control = DrivenControl(
        rabi_rates=_rabi_rates,
        azimuthal_angles=_azimuthal_angles,
        detunings=_detunings,
        durations=_durations,
        name=_name
    )

    _filename = 'driven_control_qctrl_cylindrical.csv'
    driven_control.export_to_file(
        filename=_filename,
        file_format='Q-CTRL expanded',
        file_type='CSV',
        coordinates='cylindrical')

    _filename = 'driven_control_qctrl_cartesian.csv'
    driven_control.export_to_file(
        filename=_filename,
        file_format='Q-CTRL expanded',
        file_type='CSV',
        coordinates='cartesian')

    _filename = 'driven_control_qctrl_cylindrical.json'
    driven_control.export_to_file(
        filename=_filename,
        file_format='Q-CTRL expanded',
        file_type='JSON',
        coordinates='cylindrical')

    _filename = 'driven_control_qctrl_cartesian.json'
    driven_control.export_to_file(
        filename=_filename,
        file_format='Q-CTRL expanded',
        file_type='JSON',
        coordinates='cartesian')

    _remove_file('driven_control_qctrl_cylindrical.csv')
    _remove_file('driven_control_qctrl_cartesian.csv')
    _remove_file('driven_control_qctrl_cylindrical.json')
    _remove_file('driven_control_qctrl_cartesian.json')