Stuck on HS.1.4

Hi. I’m currently stuck on codercise HS.1.4. I think I understand the theory, but somehow can manage to get my code accepted. Can anyone help me ? Here are my attempts :

Hi @lemjm ! Welcome to the Forum!

This question is a little trickier because it is not conventional; you have to run the circuit and read from the graph before you can submit your final answer.

Remember that you have access to trotter_k_error_XandZ(alpha, beta, time, n, k) from the previous codercise, which estimates error :wink: .

You have to find both the k and the n simultaneously. Usually, we’d optimise both simultaneously, but here we fix the k outside of trotter_steps_XandZ :speak_no_evil_monkey:

I hope that helps, @lemjm ! Good luck!

Best wishes,

David