class_docstr: Test inputs and pre-processing.
docstr: Test that ParticleConservingU1 throws an exception if the parameter array has an illegal
  shape.
docstr_tok: ["Test","that","ParticleConservingU1","throws","an","exception","if","the","parameter","array","has","an","illegal","shape","."]
code: def test_exceptions(self, weights, n_wires, msg_match):
      """Test that ParticleConservingU1 throws an exception if the parameter array has an illegal
      shape."""
  
      wires = range(n_wires)
      init_state = np.array([1, 1, 0, 0])
      dev = qml.device("default.qubit", wires=n_wires)
  
      @qml.qnode(dev)
      def circuit():
          qml.ParticleConservingU1(
              weights=weights, wires=wires, init_state=init_state
          )
          return qml.expval(qml.PauliZ(0))
  
      with pytest.raises(ValueError, match=msg_match):
          circuit()
  
imports: import pytest
  import numpy
  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_exceptions(weights, n_wires, msg_match) and returns: qml