code: def test_givens_matrix(a, b, left):
      r"""Test that `_givens_matrix` builds the correct Givens rotation matrices."""
  
      grot_mat = _givens_matrix(a, b, left)
      assert np.isreal(grot_mat[0, 1]) and np.isreal(grot_mat[1, 1])
  
      rotated_vector = grot_mat @ np.array([a, b]).T
      result_element = (
          b / np.abs(b) * np.hypot(np.abs(a), np.abs(b)) if b else 1.0
      )
      rvec = (
          np.array([0.0, result_element]).T
          if left
          else np.array([result_element, 0.0]).T
      )
      assert np.allclose(rotated_vector, rvec)
  
      res1 = np.round(grot_mat @ grot_mat.conj().T, 5)
      res2 = np.round(grot_mat.conj().T @ grot_mat, 5)
      assert np.all(res1 == res2) and np.all(res1 == np.eye(2))
  
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 1 for calling a global function with example usage: test_givens_matrix(a, b, left) without return types