class_docstr: Unit tests for the properties of the HardwareHamiltonian class.
class_docstr_tok: ["Unit","tests","for","the","properties","of","the","HardwareHamiltonian","class","."]
docstr: Test that an error is raised when adding two HardwareHamiltonians where one Hamiltonian
  contains pulses on wires that are not present in the register.
docstr_tok: ["Test","that","an","error","is","raised","when","adding","two","HardwareHamiltonians","where","one","Hamiltonian","contains","pulses","on","wires","that","are","not","present","in","the","register","."]
code: def test_add_raises_warning(self):
      """Test that an error is raised when adding two HardwareHamiltonians where one Hamiltonian
      contains pulses on wires that are not present in the register."""
      coords = [[0, 0], [0, 5], [5, 0]]
  
      Hd = rydberg_interaction(register=coords, wires=[0, 1, 2])
      Ht = drive(2, 3, wires=3)
  
      with pytest.warns(
          UserWarning,
          match="The wires of the laser fields are not present in the Rydberg ensemble",
      ):
          _ = Hd + Ht
  
      with pytest.warns(
          UserWarning,
          match="The wires of the laser fields are not present in the Rydberg ensemble",
      ):
          _ = Ht + Hd
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.pulse import HardwareHamiltonian, drive, rydberg_interaction
  from pennylane.pulse.hardware_hamiltonian import HardwarePulse, AmplitudeAndPhase, amplitude_and_phase, _reorder_parameters
  from pennylane.pulse.transmon import TransmonSettings
  from pennylane.pulse.rydberg import RydbergSettings
  from pennylane.wires import Wires
label_desc: Use image node_id 8 for calling the TestHardwareHamiltonian obj's underlying member method code with example usage: obj.test_add_raises_warning() without return types