class_docstr: Tests the gates with special drawing methods.
class_docstr_tok: ["Tests","the","gates","with","special","drawing","methods","."]
docstr: Test SWAP gate special call
code: def test_SWAP(self):
      """Test SWAP gate special call"""
  
      with qml.queuing.AnnotatedQueue() as q_tape:
          qml.SWAP(wires=(0, 1))
  
      tape = QuantumScript.from_queue(q_tape)
      _, ax = tape_mpl(tape)
      layer = 0
  
      # two wires produce two lines and SWAP contains 5 more lines
      assert len(ax.lines) == 7
  
      connecting_line = ax.lines[2]
      assert connecting_line.get_data() == ((layer, layer), [0, 1])
  
      dx = 0.2
      # check the coordinates of the swap lines
      x_lines = ax.lines[3:]
      for line in x_lines:
          assert line.get_xdata() == (layer - dx, layer + dx)
  
      assert x_lines[0].get_ydata() == (-dx, dx)
      assert x_lines[1].get_ydata() == (dx, -dx)
  
      assert x_lines[2].get_ydata() == (1 - dx, 1 + dx)
      assert x_lines[3].get_ydata() == (1 + dx, 1 - dx)
  
      plt.close()
  
imports: import pytest
  import pennylane
  from pennylane.drawer import tape_mpl
  from pennylane.tape import QuantumScript
label_desc: Use image node_id 1 for calling the TestSpecialGates obj's underlying member method code with example usage: obj.test_SWAP() without return types