# Grader issue with PennyLane Certificate Challenge

**URL:** <https://discuss.pennylane.ai/t/grader-issue-with-pennylane-certificate-challenge/4313>\
**Category:** PennyLane Feedback\
**Created:** [March 19, 2024, 7:14pm UTC](https://discuss.pennylane.ai/t/grader-issue-with-pennylane-certificate-challenge/4313 "2024-03-19T19:14:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![diemilio](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/diemilio/32/1413_2.png) [@diemilio](https://discuss.pennylane.ai/u/diemilio)\
**Post date:** [March 19, 2024, 7:14pm UTC](https://discuss.pennylane.ai/t/grader-issue-with-pennylane-certificate-challenge/4313/1 "2024-03-19T19:14:38Z")

</div>

Hi,

I don’t see a category for “Challenges” but I assume the discussion forum is the right place to post this.

I just completed the recently-released “PennyLane Certificate Challenge” and noticed there’s a small issue that might be worth correcting or clarifying.

The function `W` takes as an input the `params`, which are supposed to be `type` `numpy.array` according to the function’s documentation. However, the grader actually checks `W` on its own, but passes an argument of type `list` instead of `numpy.array`. This will throw an error if you try to use, for example, `params.shape` to get the shape of the matrix.

Same is true for `param_set` used by `quantum_model`.

This is usually not a big deal but I though I would bring it up because it did take me a little while to figure out where to make changes because I didn’t realize `W` is being checked by the grader individually.

Thanks!

---

<div class="post-metadata">

**Author:** ![ludmilaaasb](https://avatars.discourse-cdn.com/v4/letter/l/d78d45/32.png) [@ludmilaaasb](https://discuss.pennylane.ai/u/ludmilaaasb)\
**Post date:** [March 20, 2024, 9:18am UTC](https://discuss.pennylane.ai/t/grader-issue-with-pennylane-certificate-challenge/4313/2 "2024-03-20T09:18:42Z")

</div>

Hello @diemilio !

Thank you for the post! Good catch! 🧐  
I’ll reach the devs team and this bug will be fixed right away!

---

<div class="post-metadata">

**Author:** ![thomas.ehmer](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@thomas.ehmer](https://discuss.pennylane.ai/u/thomas.ehmer)\
**Post date:** [March 22, 2024, 2:12am UTC](https://discuss.pennylane.ai/t/grader-issue-with-pennylane-certificate-challenge/4313/3 "2024-03-22T02:12:52Z")

</div>

Hello, jumping onboard for Pennylane from earlier IBM-Qiskit challenges, and missing a bit the discord-server discussion boards …

So I taking this post as beginning of a “Certificate Challenge” Thread if you don’t mind.

Now, I wonder what I got wrong in the definition of `S`in `def S(g, x, num_wires):`

Having spent some hours now, I found different ways that failed 😀, and finally one that I used resulted that I pass the _public_ test (yay!), but … I do fail the _private_ test.  
Any hint what is behind the private test would be helpful.

I did have to check in an IF-statement if the g is `PauliX` or `PauliY` - and then assign the function, then it works, without the IF, it does not work ?

I do not want to spoil with my solution - I first replaced it with `RX` and `RY` etc. and then ended currently with `qml.exp(...)` of `g(wire)` and `coeff` of 1j\*x?

If there is any other way (or maybe I am wrong and do not know the right way?) to get insight or a pointer to a docu for me to learn what else I can do would be appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![thomas.ehmer](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@thomas.ehmer](https://discuss.pennylane.ai/u/thomas.ehmer)\
**Post date:** [March 22, 2024, 4:53pm UTC](https://discuss.pennylane.ai/t/grader-issue-with-pennylane-certificate-challenge/4313/4 "2024-03-22T16:53:33Z")

</div>

I found the error in the `for` loop in the `def quantum_model(param_set, g, x):`. Magic.

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [March 26, 2024, 2:59pm UTC](https://discuss.pennylane.ai/t/grader-issue-with-pennylane-certificate-challenge/4313/5 "2024-03-26T14:59:52Z")

</div>

Hey @thomas.ehmer! Welcome to the forum 🕶

Apologies for the wait. Were you able to solve your problem?

---

<div class="post-metadata">

**Author:** ![zgreco](https://avatars.discourse-cdn.com/v4/letter/z/5e9695/32.png) [@zgreco](https://discuss.pennylane.ai/u/zgreco)\
**Post date:** [April 2, 2024, 4:58pm UTC](https://discuss.pennylane.ai/t/grader-issue-with-pennylane-certificate-challenge/4313/6 "2024-04-02T16:58:28Z")

</div>

I habe the same issue I pass the public test but not the private!

![image](https://canada1.discourse-cdn.com/flex012/uploads/pennylane/original/2X/f/f69936be8040363c968923586c5d6ca47a818c82.png)

---

<div class="post-metadata">

**Author:** ![Alvaro\_Ballon](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/alvaro_ballon/32/874_2.png) [@Alvaro\_Ballon](https://discuss.pennylane.ai/u/Alvaro_Ballon)\
**Post date:** [April 2, 2024, 7:03pm UTC](https://discuss.pennylane.ai/t/grader-issue-with-pennylane-certificate-challenge/4313/7 "2024-04-02T19:03:48Z")

</div>

Hello @zgreco welcome to the forum!

Since this challenge earns you a certificate, we can’t help you with it much. It’s likely that your code does not solve the challenge in full generality. You are welcome to discuss with other people in the #pennylane-challenges channel in the [Xanadu Public Slack](https://join.slack.com/t/xanadu-quantum/shared_invite/zt-2fv5e1p5j-Dc8xeI4OXuHjphHsba2zfA). Maybe someone can give you a pointer in the right direction!

Cheers,

Alvaro

---

<div class="post-metadata">

**Author:** ![zgreco](https://avatars.discourse-cdn.com/v4/letter/z/5e9695/32.png) [@zgreco](https://discuss.pennylane.ai/u/zgreco)\
**Post date:** [April 2, 2024, 7:28pm UTC](https://discuss.pennylane.ai/t/grader-issue-with-pennylane-certificate-challenge/4313/8 "2024-04-02T19:28:41Z")

</div>

Can you please give the inputs for the private test? I think the problem can be the type of the input

---

<div class="post-metadata">

**Author:** ![zgreco](https://avatars.discourse-cdn.com/v4/letter/z/5e9695/32.png) [@zgreco](https://discuss.pennylane.ai/u/zgreco)\
**Post date:** [April 2, 2024, 8:58pm UTC](https://discuss.pennylane.ai/t/grader-issue-with-pennylane-certificate-challenge/4313/9 "2024-04-02T20:58:42Z")

</div>

![image](https://canada1.discourse-cdn.com/flex012/uploads/pennylane/original/2X/f/f9d7c0082655050b08a681af2be167e99c2fcd0f.png)  
finally it worked!

---

<div class="post-metadata">

**Author:** ![thomas.ehmer](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@thomas.ehmer](https://discuss.pennylane.ai/u/thomas.ehmer)\
**Post date:** [April 3, 2024, 9:20am UTC](https://discuss.pennylane.ai/t/grader-issue-with-pennylane-certificate-challenge/4313/10 "2024-04-03T09:20:14Z")

</div>

Yes, thanks and sorry for the late answer, I had used a coincidence where the composition of the overall circuit was wrongly indexed in my loop. Doing the loop correct it worked.
