class_docstr: Test inputs and pre-processing.
class_docstr_tok: ["Test","inputs","and","pre-processing","."]
docstr: Test that UCCSD throws an exception if the parameters have illegal
  shapes, types or values.
docstr_tok: ["Test","that","UCCSD","throws","an","exception","if","the","parameters","have","illegal","shapes",",","types","or","values","."]
code: def test_uccsd_xceptions(
      self, weights, s_wires, d_wires, init_state, msg_match
  ):
      """Test that UCCSD throws an exception if the parameters have illegal
      shapes, types or values."""
      N = 4
      wires = range(4)
      dev = qml.device("default.qubit", wires=N)
  
      def circuit(
          weights=weights,
          wires=wires,
          s_wires=s_wires,
          d_wires=d_wires,
          init_state=init_state,
      ):
          qml.UCCSD(
              weights=weights,
              wires=wires,
              s_wires=s_wires,
              d_wires=d_wires,
              init_state=init_state,
          )
          return qml.expval(qml.PauliZ(0))
  
      qnode = qml.QNode(circuit, dev)
  
      with pytest.raises(ValueError, match=msg_match):
          qnode(
              weights=weights,
              wires=wires,
              s_wires=s_wires,
              d_wires=d_wires,
              init_state=init_state,
          )
  
file_path: pennylane/tests/templates/test_subroutines/test_uccsd.py
imports: import pytest
  import numpy
  from pennylane import numpy
  import pennylane
label_desc: Use image node_id 1 for calling the TestInputs obj's underlying member method code with example usage: obj.test_uccsd_xceptions(weights, s_wires, d_wires, init_state, msg_match) and returns: qml