# Approximation ratio for QAOA - Public Tests validity

**URL:** <https://discuss.pennylane.ai/t/approximation-ratio-for-qaoa-public-tests-validity/9593>\
**Category:** QHack 2026\
**Created:** [October 19, 2026, 7:14pm UTC](https://discuss.pennylane.ai/t/approximation-ratio-for-qaoa-public-tests-validity/9593 "2026-10-19T19:14:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jajapuramshivasai](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/jajapuramshivasai/32/4440_2.png) [@jajapuramshivasai](https://discuss.pennylane.ai/u/jajapuramshivasai)\
**Post date:** [October 19, 2026, 7:14pm UTC](https://discuss.pennylane.ai/t/approximation-ratio-for-qaoa-public-tests-validity/9593/1 "2026-10-19T19:14:07Z")

</div>

Hi everyone,

By using a warm start and the Adam optimizer on public test #1, I got an approximation ratio of ~0.89 (beating the expected ~0.58). However, my solution failed because the grader uses `np.allclose()` to demand an exact match.

Since the goal of QAOA is to optimize performance, shouldn’t the pass condition be `approximation_ratio >= target_threshold`? It makes you wonder if an exact-match checker is really the fairest way to evaluate a variational algorithm, since it actively penalizes you for finding a better minimum.

Has anyone else run into this?

---

<div class="post-metadata">

**Author:** ![Fonken](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/fonken/32/4555_2.png) [@Fonken](https://discuss.pennylane.ai/u/Fonken)\
**Post date:** [October 19, 2026, 8:34pm UTC](https://discuss.pennylane.ai/t/approximation-ratio-for-qaoa-public-tests-validity/9593/2 "2026-10-19T20:34:21Z")

</div>

Same problem, I don’t understand how others have managed  
to pass the grader?

---

<div class="post-metadata">

**Author:** ![Fonken](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/fonken/32/4555_2.png) [@Fonken](https://discuss.pennylane.ai/u/Fonken)\
**Post date:** [October 19, 2026, 9:57pm UTC](https://discuss.pennylane.ai/t/approximation-ratio-for-qaoa-public-tests-validity/9593/3 "2026-10-19T21:57:09Z")

</div>

For anyone still stuck on this…

There’s an exploit in how the grader checks the result, think about how broadcasting  
would behave if you compare a scalar with an empty list…

---

<div class="post-metadata">

**Author:** ![Aliyyiakbar](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/aliyyiakbar/32/3597_2.png) [@Aliyyiakbar](https://discuss.pennylane.ai/u/Aliyyiakbar)\
**Post date:** [October 19, 2026, 10:06pm UTC](https://discuss.pennylane.ai/t/approximation-ratio-for-qaoa-public-tests-validity/9593/4 "2026-10-19T22:06:49Z")

</div>

Insane find bro, how did they leave such vulnerabilities on checker? This competition is a joke at this point…

---

<div class="post-metadata">

**Author:** ![Javi512](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/javi512/32/3413_2.png) [@Javi512](https://discuss.pennylane.ai/u/Javi512)\
**Post date:** [October 20, 2026, 3:49am UTC](https://discuss.pennylane.ai/t/approximation-ratio-for-qaoa-public-tests-validity/9593/5 "2026-10-20T03:49:48Z")

</div>

Don’t know if using exploits should be way to go in these code challenges. I got the same ratio as @jajapuramshivasai by improving the initial parameters selection method; at the end, its a better ratio and my probabilities-vs-state plot shows the yielded answer is a solution for the problem. I think this QAOA challenge should be checked by the reviewers.

---

<div class="post-metadata">

**Author:** ![Fonken](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/fonken/32/4555_2.png) [@Fonken](https://discuss.pennylane.ai/u/Fonken)\
**Post date:** [October 20, 2026, 11:11am UTC](https://discuss.pennylane.ai/t/approximation-ratio-for-qaoa-public-tests-validity/9593/6 "2026-10-20T11:11:02Z")

</div>

I agree it’s embarrassing almost to the point that you start to wonder  
if they intentionally left it in to try and trip up the AI sloppers.

---

<div class="post-metadata">

**Author:** ![Tanay\_Jalan](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/tanay_jalan/32/4544_2.png) [@Tanay\_Jalan](https://discuss.pennylane.ai/u/Tanay_Jalan)\
**Post date:** [October 20, 2026, 1:00pm UTC](https://discuss.pennylane.ai/t/approximation-ratio-for-qaoa-public-tests-validity/9593/7 "2026-10-20T13:00:39Z")

</div>

in my case public test passed but it is saying that one or more private test failed, i have tried multiple approach but nothing works.

---

<div class="post-metadata">

**Author:** ![Aliyyiakbar](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/aliyyiakbar/32/3597_2.png) [@Aliyyiakbar](https://discuss.pennylane.ai/u/Aliyyiakbar)\
**Post date:** [October 20, 2026, 1:15pm UTC](https://discuss.pennylane.ai/t/approximation-ratio-for-qaoa-public-tests-validity/9593/8 "2026-10-20T13:15:05Z")

</div>

That doesn’t make sense. AI wouldn’t suddenly write “return []” as the solution for such a problem, and I don’t even think they’ll rejudge the solutions if they ever fix the checker.
