class_docstr: Unit tests for the ``rect`` function.
class_docstr_tok: ["Unit","tests","for","the","``","rect","``","function","."]
docstr: Test that the callable returned by the ``rect`` function is jittable.
docstr_tok: ["Test","that","the","callable","returned","by","the","``","rect","``","function","is","jittable","."]
code: def test_rect_is_jittable(self):
      """Test that the callable returned by the ``rect`` function is jittable."""
      import jax
  
      def f(p, t):
          return p * t
  
      c = jax.jit(
          qml.pulse.rect(x=f, windows=[(4, 8), (0, 1), (9, 10)])
      )
  
      times = np.arange(0, 10, step=1e-2)
      param = 10
      for t in times:
          if 4 <= t <= 8 or 0 <= t <= 1 or 9 <= t <= 10:
              assert qml.math.allclose(c(p=param, t=t), f(param, t))
          else:
              assert c(p=param, t=t) == 0
  
imports: import inspect
  from functools import reduce
  import numpy
  import pytest
  import pennylane
  from pennylane.pulse import ParametrizedHamiltonian
label_desc: Use image node_id 6 for calling the TestRect obj's underlying member method code with example usage: obj.test_rect_is_jittable() and returns: unknown