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: Test that a two mode interferometer using the triangular mesh
  correctly gives a beamsplitter+rotation gate
docstr_tok: ["Test","that","a","two","mode","interferometer","using","the","triangular","mesh","correctly","gives","a","beamsplitter+rotation","gate"]
code: def test_two_mode_triangular(self):
      """Test that a two mode interferometer using the triangular mesh
      correctly gives a beamsplitter+rotation gate"""
      N = 2
      wires = range(N)
  
      theta = [0.321]
      phi = [0.234]
      varphi = [0.42342, 0.1121]
  
      op = qml.Interferometer(
          theta, phi, varphi, mesh="triangular", wires=wires
      )
      rec = op.expand()
  
      assert len(rec) == 3
  
      assert isinstance(rec[0], qml.Beamsplitter)
      assert rec[0].parameters == theta + phi
  
      assert isinstance(rec[1], qml.Rotation)
      assert rec[1].parameters == [varphi[0]]
  
      assert isinstance(rec[2], qml.Rotation)
      assert rec[2].parameters == [varphi[1]]
  
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 6 for calling the TestInterferometer obj's underlying member method code with example usage: obj.test_two_mode_triangular() without return types