code: def check_matrix_equivalence(
      matrix_expected, matrix_obtained, atol=1e-8
  ):
      """Takes two matrices and checks if multiplying one by the conjugate
      transpose of the other gives the identity."""
  
      mat_product = qml.math.dot(
          qml.math.conj(qml.math.T(matrix_obtained)), matrix_expected
      )
      mat_product = mat_product / mat_product[0, 0]
  
      return qml.math.allclose(
          mat_product, qml.math.eye(matrix_expected.shape[0]), atol=atol
      )
  
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 1 for calling a global function with example usage: check_matrix_equivalence(matrix_expected, matrix_obtained, atol) and returns: qml