class_docstr: Tests for the Interferometer from the pennylane.template.layers module.
class_docstr_tok: ["Tests","for","the","Interferometer","from","the","pennylane.template.layers","module","."]
docstr: Integration test for the CVNeuralNetLayers method.
docstr_tok: ["Integration","test","for","the","CVNeuralNetLayers","method","."]
code: def test_interferometer_wrong_dim(self):
      """Integration test for the CVNeuralNetLayers method."""
      dev = qml.device("default.gaussian", wires=4)
  
      @qml.qnode(dev)
      def circuit(theta, phi, varphi):
          qml.Interferometer(
              theta=theta, phi=phi, varphi=varphi, wires=range(4)
          )
          return qml.expval(qml.QuadX(0))
  
      theta = np.array(
          [
              3.28406182,
              3.0058243,
              3.48940764,
              3.41419504,
              4.7808479,
              4.47598146,
          ]
      )
      phi = np.array(
          [
              3.89357744,
              2.67721355,
              1.81631197,
              6.11891294,
              2.09716418,
              1.37476761,
          ]
      )
      varphi = np.array([0.4134863, 6.17555778, 0.80334114, 2.02400747])
  
      with pytest.raises(
          ValueError, match=r"Theta must be of shape \(6,\)"
      ):
          wrong_theta = np.array([0.1, 0.2])
          circuit(wrong_theta, phi, varphi)
  
      with pytest.raises(
          ValueError, match=r"Phi must be of shape \(6,\)"
      ):
          wrong_phi = np.array([0.1, 0.2])
          circuit(theta, wrong_phi, varphi)
  
      with pytest.raises(
          ValueError, match=r"Varphi must be of shape \(4,\)"
      ):
          wrong_varphi = np.array([0.1, 0.2])
          circuit(theta, phi, wrong_varphi)
  
file_path: pennylane/tests/templates/test_subroutines/test_interferometer.py
imports: import pytest
  import numpy
  import pennylane
  from pennylane.wires import Wires
label_desc: Use image node_id 11 for calling the TestInterferometer obj's underlying member method code with example usage: obj.test_interferometer_wrong_dim() and returns: qml