# PennyLane Challenge: Returning probabilities

**URL:** <https://discuss.pennylane.ai/t/pennylane-challenge-returning-probabilities/4497>\
**Category:** PennyLane Challenges\
**Created:** [April 24, 2024, 3:10pm UTC](https://discuss.pennylane.ai/t/pennylane-challenge-returning-probabilities/4497 "2024-04-24T15:10:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [April 24, 2024, 3:10pm UTC](https://discuss.pennylane.ai/t/pennylane-challenge-returning-probabilities/4497/1 "2024-04-24T15:10:57Z")

</div>

Use this topic to ask your questions about the [PennyLane Challenge: Returning probabilities](https://pennylane.ai/challenges/returning_probabilities/).

---

<div class="post-metadata">

**Author:** ![Kamal\_Mohamed](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/kamal_mohamed/32/1184_2.png) [@Kamal\_Mohamed](https://discuss.pennylane.ai/u/Kamal_Mohamed)\
**Post date:** [April 27, 2024, 11:28pm UTC](https://discuss.pennylane.ai/t/pennylane-challenge-returning-probabilities/4497/2 "2024-04-27T23:28:01Z")

</div>

The run function in this challenge performs part of the challenge. Specifically, the challenge description says

> [`qml.probs(wire)`](https://pennylane.readthedocs.io/en/stable/code/api/pennylane.probs.html?highlight=probs#pennylane.probs) returns a probability for each of the different computational basis states, but we are only interested in the probability that the qubit is in the _ground state_ ∣0⟩∣ Therefore, you will need to select the probability the qubit is in the state ∣0⟩

However, the run function already does `output = simple_circuit(angle)[0]`, which means returning just `qml.probs(0)` would be an accepted answer even though the description suggests otherwise.

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [April 29, 2024, 6:53pm UTC](https://discuss.pennylane.ai/t/pennylane-challenge-returning-probabilities/4497/3 "2024-04-29T18:53:12Z")

</div>

Hi @Kamal_Mohamed, you’re right, thanks for the feedback!
