Esempio n. 1
0
 def test_gauss_square_extremes(self):
     """Test that the gaussian square pulse can build a gaussian."""
     duration = 125
     sigma = 4
     amp = 0.5j
     gaus_square = GaussianSquare(duration=duration, sigma=sigma, amp=amp, width=0)
     gaus = Gaussian(duration=duration, sigma=sigma, amp=amp)
     np.testing.assert_almost_equal(gaus_square.get_sample_pulse().samples,
                                    gaus.get_sample_pulse().samples)
     gaus_square = GaussianSquare(duration=duration, sigma=sigma, amp=amp, width=121)
     const = ConstantPulse(duration=duration, amp=amp)
     np.testing.assert_almost_equal(gaus_square.get_sample_pulse().samples[2:-2],
                                    const.get_sample_pulse().samples[2:-2])
Esempio n. 2
0
 def test_constant_samples(self):
     """Test the constant pulse and its sampled construction."""
     const = ConstantPulse(duration=150, amp=0.1 + 0.4j)
     self.assertEqual(const.get_sample_pulse().samples[0], 0.1 + 0.4j)
     self.assertEqual(len(const.get_sample_pulse().samples), 150)
Esempio n. 3
0
 def test_deprecated_parametric_pulses(self):
     """Test deprecated parametric pulses."""
     with self.assertWarns(DeprecationWarning):
         const = ConstantPulse(duration=150, amp=0.1 + 0.4j)
         self.assertEqual(const.get_sample_pulse().samples[0], 0.1 + 0.4j)
         self.assertEqual(len(const.get_sample_pulse().samples), 150)