def METHOD_NAME(self):
    """Test low rank decomposition error threshold and max rank."""
    driver = PySCFDriver(atom="Li 0 0 0; H 0 0 1.6")
    driver_result = driver.run()
    electronic_energy = driver_result.hamiltonian
    two_body_tensor = unfold(electronic_energy.electronic_integrals.alpha["++--"])
    with self.subTest("max rank"):
        max_vecs = 20
        diag_coulomb_mats, orbital_rotations = double_factorized(
            two_body_tensor, max_vecs=max_vecs
        )
        reconstructed = np.einsum(
            "tpk,tqk,tkl,trl,tsl->pqrs",
            orbital_rotations,
            orbital_rotations,
            diag_coulomb_mats,
            orbital_rotations,
            orbital_rotations,
        )
        self.assertEqual(len(orbital_rotations), max_vecs)
        np.testing.assert_allclose(reconstructed, two_body_tensor, atol=1e-5)
    with self.subTest("error threshold"):
        error_threshold = 1e-4
        diag_coulomb_mats, orbital_rotations = double_factorized(
            two_body_tensor, error_threshold=error_threshold
        )
        reconstructed = np.einsum(
            "tpk,tqk,tkl,trl,tsl->pqrs",
            orbital_rotations,
            orbital_rotations,
            diag_coulomb_mats,
            orbital_rotations,
            orbital_rotations,
        )
        self.assertLessEqual(len(orbital_rotations), 18)
        np.testing.assert_allclose(reconstructed, two_body_tensor, atol=error_threshold)
    with self.subTest("error threshold and max rank"):
        diag_coulomb_mats, orbital_rotations = double_factorized(
            two_body_tensor, error_threshold=error_threshold, max_vecs=max_vecs
        )
        reconstructed = np.einsum(
            "tpk,tqk,tkl,trl,tsl->pqrs",
            orbital_rotations,
            orbital_rotations,
            diag_coulomb_mats,
            orbital_rotations,
            orbital_rotations,
        )
        self.assertLessEqual(len(orbital_rotations), 18)
        np.testing.assert_allclose(reconstructed, two_body_tensor, atol=error_threshold)