class_docstr: Tests for the transmon drive Hamiltonian.
docstr: Test that the sum of two transmon drive Hamiltonians behaves correctly.
docstr_tok: ["Test","that","the","sum","of","two","transmon","drive","Hamiltonians","behaves","correctly","."]
code: def test_multiple_drives(self):
      """Test that the sum of two transmon drive Hamiltonians behaves correctly."""
  
      def amp(p, t):
          return np.sin(p * t)
  
      phase0 = 3.0
      phase1 = 5.0
      freq0 = 0.1
      freq1 = 0.5
  
      H1 = transmon_drive(
          amplitude=amp, phase=phase0, freq=freq0, wires=[0, 3]
      )
      H2 = transmon_drive(
          amplitude=1, phase=phase1, freq=freq1, wires=[1, 2]
      )
      Hd = H1 + H2
  
      ops_expected = [
          qml.dot([1.0, 1.0], [qml.PauliY(1), qml.PauliY(2)]),
          qml.dot([1.0, 1.0], [qml.PauliY(0), qml.PauliY(3)]),
      ]
      coeffs_expected = [
          AmplitudeAndPhaseAndFreq(np.sin, amp, phase0, freq0),
          AmplitudeAndPhaseAndFreq(np.sin, 1, phase1, freq1),
      ]
      H_expected = HardwareHamiltonian(
          coeffs_expected,
          ops_expected,
          reorder_fn=_reorder_AmpPhaseFreq,
      )
      # structure of Hamiltonian is as expected
      assert isinstance(Hd, HardwareHamiltonian)
      assert Hd.wires == Wires([0, 3, 1, 2])
      assert Hd.settings is None
      assert len(Hd.ops) == 2  # 2 terms for amplitude/phase
  
      for coeff in Hd.coeffs:
          assert isinstance(coeff, AmplitudeAndPhaseAndFreq)
      assert Hd.coeffs[0].func.__name__ == "callable_amp"
      assert Hd.coeffs[1].func.__name__ == "no_callable"
  
      # pulses were added correctly
      assert Hd.pulses == [
          HardwarePulse(amp, phase0, freq0, wires=[0, 3]),
          HardwarePulse(1, phase1, freq1, wires=[1, 2]),
      ]
      # Hamiltonian is as expected
      assert qml.math.allclose(
          qml.matrix(Hd([0.5], t=6)), qml.matrix(H_expected([0.5], t=6))
      )
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.pulse import HardwareHamiltonian, transmon_interaction, transmon_drive
  from pennylane.pulse.transmon import TransmonSettings, a, ad, AmplitudeAndPhaseAndFreq, _reorder_AmpPhaseFreq, callable_freq_to_angular
  from pennylane.pulse.hardware_hamiltonian import HardwarePulse
  from pennylane.wires import Wires
label_desc: Use image node_id 11 for calling the TestTransmonDrive obj's underlying member method code with example usage: obj.test_multiple_drives() and returns: np