code: def _decomposition_1_cnot(U, wires):
      r"""If there is just one CNOT, we can write the circuit in the form
       -╭U- = -C--╭C--A-
       -╰U- = -D--╰X--B-
  
      To do this decomposition, first we find G, H in SO(4) such that
          G (Edag V E) H = (Edag U E)
  
      where V depends on the central CNOT gate, and both U, V are in SU(4). This
      is done following the methods in https://arxiv.org/abs/quant-ph/0308045.
  
      Once we find G and H, we can use the fact that E SO(4) Edag gives us
      something in SU(2) x SU(2) to give A, B, C, D.
      """
      # We will actually find a decomposition for the following circuit instead
      # of the original U
      # -╭U-╭SWAP- = -C--╭C-╭SWAP--B-
      # -╰U-╰SWAP- = -D--╰X-╰SWAP--A-
      # This ensures that the internal part of the decomposition has determinant 1.
      swap_U = np.exp(1j * np.pi / 4) * math.dot(
          math.cast_like(SWAP, U), U
      )
  
      # First let's compute gamma(u). For the one-CNOT case, uuT is always real.
      u = math.dot(
          math.cast_like(Edag, U),
          math.dot(swap_U, math.cast_like(E, U)),
      )
      uuT = math.dot(u, math.T(u))
  
      # Since uuT is real, we can use eigh of its real part. eigh also orders the
      # eigenvalues in ascending order.
      _, p = math.linalg.eigh(qml.math.real(uuT))
  
      # Fix the determinant if necessary so that p is in SO(4)
      p = math.dot(
          p, math.diag([1, 1, 1, math.sign(math.linalg.det(p))])
      )
  
      # Now, we must find q such that p uu^T p^T = q vv^T q^T.
      # For this case, our V = SWAP CNOT01 is constant. Thus, we can compute v,
      # vvT, and its eigenvalues and eigenvectors directly. These matrices are stored
      # above as the constants v_one_cnot and q_one_cnot.
  
      # Once we have p and q properly in SO(4), we compute G and H in SO(4) such
      # that U = G V H
      G = math.dot(p, q_one_cnot.T)
      H = math.dot(
          math.conj(math.T(v_one_cnot)), math.dot(math.T(G), u)
      )
  
      # We now use the magic basis to convert G, H to SU(2) x SU(2)
      AB = math.dot(E, math.dot(G, Edag))
      CD = math.dot(E, math.dot(H, Edag))
  
      # Extract the tensor prodcts to SU(2) x SU(2)
      A, B = _su2su2_to_tensor_products(AB)
      C, D = _su2su2_to_tensor_products(CD)
  
      # Recover the operators in the decomposition; note that because of the
      # initial SWAP, we exchange the order of A and B
      A_ops = one_qubit_decomposition(A, wires[1])
      B_ops = one_qubit_decomposition(B, wires[0])
      C_ops = one_qubit_decomposition(C, wires[0])
      D_ops = one_qubit_decomposition(D, wires[1])
  
      return C_ops + D_ops + [qml.CNOT(wires=wires)] + A_ops + B_ops
  
file_path: pennylane/pennylane/ops/op_math/decompositions/two_qubit_unitary.py
imports: import numpy
  import pennylane
  from pennylane import math
  from .single_qubit_unitary import one_qubit_decomposition
label_desc: Use image node_id 6 for calling a global function with example usage: _decomposition_1_cnot(U, wires) and returns: unknown