class_docstr: Test that arithmetic operations involving or creating ParametrizedHamiltonians behave as expected
docstr: Test that an error is raised when adding a ``ParametrizedHamiltonian`` with an invalid
  object.
docstr_tok: ["Test","that","an","error","is","raised","when","adding","a","``","ParametrizedHamiltonian","``","with","an","invalid","object","."]
code: def test_add_invalid_object_raises_error(self):
      """Test that an error is raised when adding a ``ParametrizedHamiltonian`` with an invalid
      object."""
      H = ParametrizedHamiltonian(
          [f1, f2], [qml.PauliX(0), qml.PauliY(1)]
      )
  
      with pytest.raises(TypeError, match="unsupported operand type"):
          _ = H + object()
  
      with pytest.raises(TypeError, match="unsupported operand type"):
          _ = object() + H
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.pulse import ParametrizedHamiltonian
  from pennylane.wires import Wires
label_desc: Use image node_id 3 for calling the TestInteractionWithOperators obj's underlying member method code with example usage: obj.test_add_invalid_object_raises_error() without return types