H.8.1 - Error "depth"

It seems like there is a problem with line 28. Since this is not a code line we should modify I am not sure how to fix that problem.

Hi @Qimi - thank you for reaching out about this. There is indeed a problem with line 28 due to a previous update in PennyLane. In short, if you change your line 28 to
depth = qml.specs(trotter_k_XandZ)(1, 1, 1, n, optimal_k)['resources'].depth

you should be able to get rid of that error. You can see why in the example here.

We will roll out a fix for this next week (thank you for bringing this to our attention!) :smiley:

You will still need to modify Line 26, but you will able to see the plot which will help you. :muscle:

Hi @DanielNino27, thank you for your suggestion. I changed the code accordingly and I could find the optimal k by executing the code. However, when I submitted the code for the second time (with the modified optimal k in line 26) I got a network error. I have tried it multiple times since then, and it is still not working :confused:

Hi @Qimi ,

I can’t reproduce your error now :thinking:, but it is one that I’ve experienced before, and it is one that we are aware of. The fix on our end will take a while so for now, I’m afraid all I recommend is that you keep trying to submit :face_with_diagonal_mouth:.

When I experienced that error, I tried again a few minutes later and it worked for me - it sounds like it is taking longer for you, but if you can try again (maybe you can refresh the page or restart your browser too), please let me know if the error persists or if you can get it to work again.

Hi @DanielNino27 ,

Do you know how we can go to the next exercice? I try to submit the code for hours now, and I always have the same ‘Network Error’ message. Is it possible to simply copy/paste some values for k, n, etc to be able to try the next exercices?

Best,
Dylan

Hi @dylanlaplacemermoud - Unfortunately, the network error sometimes happens and there is no real quick fix. The only thing I can recommend for now is simply to try submitting again later. It doesn’t have anything to do with the values of the parameters you are trying so that should not affect the ‘Network Error’ message.

1 Like

Hi @DanielNino27 , thank you for your answer. I will keep trying.

1 Like

Hi @dylanlaplacemermoud, please let us know if this persists after trying again tomorrow.

Hi @CatalinaAlbornoz , thank you for your answer. Unfortunately, it is still not working today. I have tried on three different days, quite regularly, and on different WiFi connections. I don’t really know if it is useful that I continue trying.

It is not working for me either. I tried several times in January, and I just tried again, but I am getting the “Network error” as well.

Hi @dylanlaplacemermoud and @Qimi, I’d say that at this point the problem is more than just a random network error so it probably won’t be fixed by trying again. We’ll investigate what the cause might be.

In the meantime, could you please try using the Codebook in a different browser or in incognito mode and let us know if it works? And could you please let us know what browser you’re using at the moment?

Hi @CatalinaAlbornoz , I was using the codebook on Safari, I tried in incognito mode, and on Opera, both giving the same error message.

Hi @CatalinaAlbornoz, I tried it on Firefox and Chrome and I am getting the network error on both browsers.

Thanks @dylanlaplacemermoud and @Qimi. Could you please send us the console log?

In Chrome you can right-click on the page where you’re seeing the error and click on “inspect”. This will open a side panel. Make sure to click on the “Console” tab. Then take a screenshot of the messages you see there.

In Safari you can click on Option + ⌘ + C and the console panel will pop up. Then you can take the screenshot.

On chrome I am getting this message in the console:
Screenshot from 2024-04-11 21-15-03

Hi @Qimi,

Thank you for posting this. Unfortunately our developers are having a hard time figuring out the issue. Since you’re facing it on several browsers could you please clear the cache on one of them and let us know if the issue persists? Note that if you clear your cache your progress will be lost on that browser so please only do this in the browser where you have the least progress.

Hi @CatalinaAlbornoz , here the message I got on Safari.

Hi @CatalinaAlbornoz, I cleared the cache but it is still not working unfortunately.

Hi @dylanlaplacemermoud and @Qimi, thank you for your responses. I have a couple more questions.

  1. Do you need to wait a long time (~1 minute) before getting the network error response?
  2. Could you please send me your submission code?
  3. What country are you located in?
  4. Can you please make another submission and tell me the time when you made the submission (and your timezone)?

Hi @CatalinaAlbornoz, yes, I have to wait ~1min (or more) before getting the network error response. I am located in Germany. I have resubmitted my code at 19:36 CEST. My submission code is:

...
n = 1
##################
# YOUR CODE HERE #
##################
error_XandZ = trotter_k_error_XandZ(alpha, beta, time, n, k)
while error_XandZ > error:
    n += 1
    error_XandZ = trotter_k_error_XandZ(alpha, beta, time, n, k)
return n