class_docstr: Tests for input validation of `CommutingEvolution`.
class_docstr_tok: ["Tests","for","input","validation","of","`","CommutingEvolution","`","."]
docstr: Tests TypeError is raised if `hamiltonian` is not type `qml.Hamiltonian`.
docstr_tok: ["Tests","TypeError","is","raised","if","`","hamiltonian","`","is","not","type","`","qml.Hamiltonian","`","."]
code: def test_invalid_hamiltonian(self):
      """Tests TypeError is raised if `hamiltonian` is not type `qml.Hamiltonian`."""
  
      invalid_operator = qml.PauliX(0)
  
      assert pytest.raises(
          TypeError, qml.CommutingEvolution, invalid_operator, 1
      )
  
file_path: pennylane/tests/templates/test_subroutines/test_commuting_evolution.py
imports: import pytest
  from scipy.linalg import expm
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 1 for calling the TestInputs obj's underlying member method code with example usage: obj.test_invalid_hamiltonian() without return types