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 adding an int or a float that is zero to a `HardwareHamiltonian`
  returns an unchanged copy.
docstr_tok: ["Test","that","adding","an","int","or","a","float","that","is","zero","to","a","`","HardwareHamiltonian","`","returns","an","unchanged","copy","."]
code: def test_add_zero(self):
      """Test that adding an int or a float that is zero to a `HardwareHamiltonian`
      returns an unchanged copy."""
      coeffs = [2, 3]
      ops = [qml.PauliZ(2), qml.PauliX(0)]
  
      H = HardwareHamiltonian(
          coeffs=coeffs,
          observables=ops,
          pulses=[HardwarePulse(qml.pulse.constant, 6, 7, 8)],
      )
      orig_matrix = qml.matrix(H([0.3], 0.1))
      H1 = H + 0
      assert len(H1.ops) == len(H1.coeffs) == 2
      assert qml.math.allclose(qml.matrix(H1([0.3], 0.1)), orig_matrix)
      assert H1 is not H
      H2 = 0.0 + H
      assert len(H2.ops) == len(H2.coeffs) == 2
      assert qml.math.allclose(qml.matrix(H2([0.3], 0.1)), orig_matrix)
      assert H2 is not H
  
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 7 for calling the TestHardwareHamiltonian obj's underlying member method code with example usage: obj.test_add_zero() without return types