def test_sech_deriv(self):
        """Test sech derivative pulse."""
        amp = 0.5
        center = 20
        sigma = 2
        times = np.linspace(0, 40, 1000)

        sech_deriv_arr = continuous.sech_deriv(times, amp, center, sigma)

        self.assertEqual(sech_deriv_arr.dtype, np.complex_)

        self.assertAlmostEqual(continuous.sech_deriv(np.array([0]), amp, center, sigma)[0],
                               0, places=3)
 def test_sech_deriv(self):
     """Test discrete sampled sech derivative pulse."""
     amp = 0.5
     sigma = 2
     duration = 10
     center = duration/2
     times = np.arange(0, duration)
     sech_deriv_ref = continuous.sech_deriv(times, amp, center, sigma)
     sech_deriv_pulse = pulse_lib.sech_deriv(duration, amp, sigma)
     self.assertIsInstance(sech_deriv_pulse, SamplePulse)
     np.testing.assert_array_almost_equal(sech_deriv_pulse.samples, sech_deriv_ref)