# (Minor) error running X8 tutorial

**URL:** <https://discuss.pennylane.ai/t/minor-error-running-x8-tutorial/1389>\
**Category:** Strawberry Fields\
**Created:** [October 4, 2021, 5:33pm UTC](https://discuss.pennylane.ai/t/minor-error-running-x8-tutorial/1389 "2021-10-04T17:33:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Damian\_Pope](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Damian\_Pope](https://discuss.pennylane.ai/u/Damian_Pope)\
**Post date:** [October 4, 2021, 5:33pm UTC](https://discuss.pennylane.ai/t/minor-error-running-x8-tutorial/1389/1 "2021-10-04T17:33:15Z")

</div>

Hello! Excellent work with SF and PL.

I just started playing around with SF and tried the X8 tutorial: ([https://strawberryfields.ai/photonics/demos/tutorial\_X8.html](https://strawberryfields.ai/photonics/demos/tutorial_X8.html))

When I ran it, I got the following error message:

```nohighlight
Traceback (most recent call last):

  File "C:\Users\dpope\Documents\personal\QML\strawberryFields\most recently downloaded\tutorial_X8.py", line 349, in <module>
    result = job.result

  File "C:\Users\dpope\Anaconda3\lib\site-packages\strawberryfields\api\job.py", line 119, in result
    raise AttributeError(

AttributeError: The result is undefined for jobs that are not completed (current status: open)

```

Just curious but is this what I should be getting? I’m using SF 0.19

It’s totally _not_ a problem as I can just comment out the following two lines & then everything works OK:

```auto
result = job.result
print(result.samples.shape)

```

(Or change the code to:

```auto
if job.status=="complete":
    result = job.result
    print(result.samples.shape)

else: 
    print("Job has not been completed."))

```

It’s just that I got the impression from the documentation that I should be getting something _slightly_ different. Specifically, reading the “Job management” section of the X8 tutorial.

Anyway, many thanks!

Damian

---

<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:** [October 5, 2021, 12:56am UTC](https://discuss.pennylane.ai/t/minor-error-running-x8-tutorial/1389/2 "2021-10-05T00:56:51Z")

</div>

Hi @Damian_Pope, it’s great to see you here in the forum!

According to the Demo, if the job isn’t complete you should get an `InvalidJobOperationError`. It is a different error type to what you’re getting, but the explanation of the error is exactly what we expect.

We should probably update the demo, adding the change you suggested. Would you like to open a pull-request with this change? If not just let me know.

Thank you for bringing this up!

---

<div class="post-metadata">

**Author:** ![Damian\_Pope](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Damian\_Pope](https://discuss.pennylane.ai/u/Damian_Pope)\
**Post date:** [October 5, 2021, 3:59am UTC](https://discuss.pennylane.ai/t/minor-error-running-x8-tutorial/1389/3 "2021-10-05T03:59:47Z")

</div>

Hi @CatalinaAlbornoz , great to see you here too! Thanks for your informative reply. Yes, I’d love to open a pull request. I’m just not sure exactly where to do it 🙂 I searched the strawberryfields repository on GitHub but couldn’t find the file “tutorial\_X8.py”. Maybe I’m missing something???

Thanks again!

---

<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:** [October 5, 2021, 2:09pm UTC](https://discuss.pennylane.ai/t/minor-error-running-x8-tutorial/1389/4 "2021-10-05T14:09:26Z")

</div>

Hi @Damian_Pope, the repo is private 🙈 sorry! That’s why you couldn’t find it. I will create the issue in the repo.

Thank you again for pointing this out!

---

<div class="post-metadata">

**Author:** ![Damian\_Pope](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Damian\_Pope](https://discuss.pennylane.ai/u/Damian_Pope)\
**Post date:** [October 5, 2021, 3:52pm UTC](https://discuss.pennylane.ai/t/minor-error-running-x8-tutorial/1389/5 "2021-10-05T15:52:10Z")

</div>

Thanks! That’s very helpful.
