code: def test_basis_rotation_output(
      one_matrix,
      two_tensor,
      tol_factor,
      coeffs_ref,
      ops_ref,
      eigvecs_ref,
  ):
      r"""Test that basis_rotation function returns the correct values."""
      coeffs, ops, eigvecs = qml.qchem.basis_rotation(
          one_matrix, two_tensor, tol_factor
      )
  
      for i, coeff in enumerate(coeffs):
          assert np.allclose(np.sort(coeff), np.sort(coeffs_ref[i]))
  
      for j, op in enumerate(ops):
          ops_ref_str = [
              qml.pauli.pauli_word_to_string(t) for t in ops_ref[j]
          ]
          for o in op:
              assert qml.pauli.pauli_word_to_string(o) in ops_ref_str
  
      for i, vecs in enumerate(eigvecs):
          checks = []
          for vec in vecs.T:
              check = False
              for rf_vec in eigvecs_ref[i].T:
                  if np.allclose(rf_vec, vec) or np.allclose(
                      -rf_vec, vec
                  ):
                      check = True
                      break
              checks.append(check)
          assert np.all(checks)
  
file_path: pennylane/tests/qchem/test_factorization.py
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: test_basis_rotation_output(one_matrix, two_tensor, tol_factor, coeffs_ref, ops_ref, eigvecs_ref) without return types