class_docstr: Unit tests for the pwc function
class_docstr_tok: ["Unit","tests","for","the","pwc","function"]
docstr: Tests that both shapes for input t work when creating a pwc function
docstr_tok: ["Tests","that","both","shapes","for","input","t","work","when","creating","a","pwc","function"]
code: def test_t_input_types(self):
      """Tests that both shapes for input t work when creating a pwc function"""
      constants = np.linspace(0, 12, 13)
  
      # should be identical
      f1 = qml.pulse.pwc(10)
      f2 = qml.pulse.pwc((0, 10))
  
      assert np.all(
          [
              f1(constants, t) == f2(constants, t)
              for t in np.linspace(-2, 12, 200)
          ]
      )
      assert f1(constants, 10) == 0
      assert f2(constants, 10) == 0
      assert f1(constants, 0) == constants[0]
      assert f2(constants, 0) == constants[0]
  
      # should set t1=1 instead of default t1=0
      f3 = qml.pulse.pwc((1, 3))
      assert f3(constants, 3) == 0
      assert f3(constants, 1) == constants[0]
      assert f3(constants, 0) == 0
  
imports: import inspect
  from functools import partial
  import numpy
  import pytest
  import pennylane
  from pennylane.pulse.parametrized_hamiltonian import ParametrizedHamiltonian
label_desc: Use image node_id 4 for calling the TestPWC obj's underlying member method code with example usage: obj.test_t_input_types() without return types