class_docstr: Test that two-qubit unitary operations are correctly decomposed.
class_docstr_tok: ["Test","that","two-qubit","unitary","operations","are","correctly","decomposed","."]
docstr: Test SU(2) x SU(2) can be correctly factored into tensor products.
docstr_tok: ["Test","SU","(","2",")","x","SU","(","2",")","can","be","correctly","factored","into","tensor","products","."]
code: def test_su2su2_to_tensor_products(self, U_pair):
      """Test SU(2) x SU(2) can be correctly factored into tensor products."""
  
      true_matrix = qml.math.kron(
          np.array(U_pair[0]), np.array(U_pair[1])
      )
      A, B = _su2su2_to_tensor_products(true_matrix)
      assert check_matrix_equivalence(qml.math.kron(A, B), true_matrix)
  
imports: from functools import reduce
  import pytest
  from gate_data import I, Z, S, T, H, X, Y, CNOT, SWAP
  import pennylane
  from pennylane import numpy
  from pennylane.wires import Wires
  from pennylane.ops.op_math.decompositions import one_qubit_decomposition
  from pennylane.ops.op_math.decompositions import two_qubit_decomposition
  from pennylane.ops.op_math.decompositions.two_qubit_unitary import _convert_to_su4, _su2su2_to_tensor_products, _compute_num_cnots
label_desc: Use image node_id 2 for calling the TestTwoQubitUnitaryDecomposition obj's underlying member method code with example usage: obj.test_su2su2_to_tensor_products(U_pair) without return types