class_docstr: Tests for the Hilbert-Schmidt template.
docstr: Test if the HS operation is correctly decomposed for 2 qubits with custom wires.
docstr_tok: ["Test","if","the","HS","operation","is","correctly","decomposed","for","2","qubits","with","custom","wires","."]
code: def test_hs_decomposition_2_qubits_custom_wires(self):
      """Test if the HS operation is correctly decomposed for 2 qubits with custom wires."""
      with qml.queuing.AnnotatedQueue() as q_U:
          qml.SWAP(wires=["a", "b"])
  
      U = qml.tape.QuantumScript.from_queue(q_U)
  
      def v_circuit(params):
          qml.RZ(params[0], wires="c")
          qml.CNOT(wires=["c", "d"])
  
      op = qml.HilbertSchmidt(
          [0.1], v_function=v_circuit, v_wires=["c", "d"], u_tape=U
      )
  
      with qml.queuing.AnnotatedQueue() as q_tape_dec:
          op.decomposition()
  
      # make sure it works in non-queuing situations too.
      decomp = op.decomposition()
  
      tape_dec = qml.tape.QuantumScript.from_queue(q_tape_dec)
      expected_operations = [
          qml.Hadamard(wires=["a"]),
          qml.Hadamard(wires=["b"]),
          qml.CNOT(wires=["a", "c"]),
          qml.CNOT(wires=["b", "d"]),
          qml.SWAP(wires=["a", "b"]),
          qml.RZ(-0.1, wires=["c"]),
          qml.CNOT(wires=["c", "d"]),
          qml.CNOT(wires=["b", "d"]),
          qml.CNOT(wires=["a", "c"]),
          qml.Hadamard(wires=["a"]),
          qml.Hadamard(wires=["b"]),
      ]
  
      for op1, op2 in zip(tape_dec.operations, expected_operations):
          assert qml.equal(op1, op2)
  
      for op1, op2 in zip(decomp, expected_operations):
          assert qml.equal(op1, op2)
  
imports: import pytest
  import pennylane
label_desc: Use image node_id 3 for calling the TestHilbertSchmidt obj's underlying member method code with example usage: obj.test_hs_decomposition_2_qubits_custom_wires() without return types