class_docstr: Unit tests for the ``rydberg_drive`` function
docstr: Test that when amplitude is not specified, the drive term is correctly defined.
docstr_tok: ["Test","that","when","amplitude","is","not","specified",",","the","drive","term","is","correctly","defined","."]
code: def test_no_amplitude(self):
      """Test that when amplitude is not specified, the drive term is correctly defined."""
  
      # factors (2 * np.pi) to convert between angular and standard frequency
      def f(p, t):
          return np.cos(p * t) / (2 * np.pi)
  
      Hd = rydberg_drive(amplitude=0, phase=1, detuning=f, wires=[0, 3])
  
      ops_expected = [
          qml.Hamiltonian(
              [
                  -0.5 * (2 * np.pi),
                  -0.5 * (2 * np.pi),
                  0.5 * (2 * np.pi),
                  0.5 * (2 * np.pi),
              ],
              [
                  qml.Identity(0),
                  qml.Identity(3),
                  qml.PauliZ(0),
                  qml.PauliZ(3),
              ],
          )
      ]
      coeffs_expected = [f]
      H_expected = HardwareHamiltonian(coeffs_expected, ops_expected)
  
      actual = Hd([0.1], 10).simplify()
      expected = H_expected([0.1], 10).simplify()
      assert qml.equal(actual, expected)
      assert isinstance(Hd, HardwareHamiltonian)
      assert Hd.wires == Wires([0, 3])
      assert Hd.settings is None
      assert len(Hd.coeffs) == 1
      assert Hd.coeffs[0] is f
      assert len(Hd.ops) == 1
      assert qml.equal(Hd.ops[0], ops_expected[0])
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.pulse import rydberg_interaction, rydberg_drive
  from pennylane.pulse.hardware_hamiltonian import HardwareHamiltonian, HardwarePulse, AmplitudeAndPhase
  from pennylane.wires import Wires
  from pennylane.pulse.rydberg import RydbergSettings
label_desc: Use image node_id 3 for calling the TestRydbergDrive obj's underlying member method code with example usage: obj.test_no_amplitude() and returns: unknown