code: def test_givens_decomposition(shape):
      r"""Test that `givens_decomposition` perform correct Givens decomposition."""
  
      matrix = unitary_group.rvs(shape)
  
      phase_mat, ordered_rotations = givens_decomposition(matrix)
      decomposed_matrix = np.diag(phase_mat)
      for grot_mat, (i, j) in ordered_rotations:
          rotation_matrix = np.eye(shape, dtype=complex)
          rotation_matrix[i, i], rotation_matrix[j, j] = (
              grot_mat[0, 0],
              grot_mat[1, 1],
          )
          rotation_matrix[i, j], rotation_matrix[j, i] = (
              grot_mat[0, 1],
              grot_mat[1, 0],
          )
          decomposed_matrix = decomposed_matrix @ rotation_matrix
  
      # check if U = D x Π T_{m, n}
      assert np.allclose(matrix, decomposed_matrix)
  
imports: import pytest
  from scipy.stats import unitary_group
  from pennylane import numpy
  from pennylane.qchem.givens_decomposition import _givens_matrix, givens_decomposition
label_desc: Use image node_id 3 for calling a global function with example usage: test_givens_decomposition(shape) without return types