H.8.1 - Error "depth"

Hi @Qimi,

If you modify your code do you still get the network error?

Eg. if you try a slightly modified version of the code like the one below do you still get the error?

n = 1
while trotter_k_error_XandZ(alpha, beta, time, n, k) > error:
    n += 1
return n

Hi @CatalinaAlbornoz, yes, I am still getting the network error if I modify my code.

Hi @CatalinaAlbornoz ,

Here is the code I submitted:

    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

I submitted once more at 10h25 CEST, I am located in France. I have waited approximately 90 secondes to have the error message.

But I have a very good news, I tried the piece of code you sent to @Qimi and it worked, I finally have the “Correct!” message. Thank you!

Hi @Qimi and @dylanlaplacemermoud,

Thank you for your responses.
@dylanlaplacemermoud, please let us know here on the forum if you experience the network issue again.

@Qimi can you please take a screenshot of your code and the error that you get? Try using the code that I sent you.

Hi @CatalinaAlbornoz , thanks a lot for your help, I was able to finish the codercises, without seeing this error again.

Hi @CatalinaAlbornoz, I think I figured out what went wrong. My mistake was to use an optimal_k = 10. As soon as I decreased the value sufficiently enough, I did not get the network error anymore and I could pass the codercise.

Hi @dylanlaplacemermoud and @Qimi, I’m glad we solved the network error mystery!

I hope you’ve been enjoying the Codebook.
If you haven’t tried them already I encourage you to try the PennyLane Coding Challenges too! You can even get limited-time badges if you complete the challenges in certain categories by the end of April.

Hi @CatalinaAlbornoz , thanks for the advice, I am already have a look at them!

That’s great @dylanlaplacemermoud, enjoy using PennyLane!

1 Like