How to choose the threshold for adapative circuits?

Hello everyone!

I was wondering, in the tutorial for Adapative circuits for quantum chemistry, they set the threshold of acceptance of a Givens rotation to 10^{-5}, is there a way to estimate the right threshold ?
So far, I’ve been considering it such that I don’t have to carry too many excitations around.

Thank you!!

Hi @Mohamed_SO,

You want to set a threshold such that you effectively capture the excitations that you need to build into your circuit. If you look at the values for the gradients you notice that by setting the threshold at 1.0e-5 you can get the excitations which clearly have non-zero gradients, and filter out those with gradients that are basically zero. If your threshold is too high, then you will loose some of the excitations that can help you and thus not get to an optimal result. If your threshold is too low then you may be introducing noise. So my recommendation would be to keep the current threshold, or if you want to change it then check the values of the gradients and find a threshold that produces a clean cut between useful excitations and noise.

Please let me know if this was clear, I can rephrase if it was unclear.

I hope this helps!

1 Like

Thank you for your response!

All clear!

I’m glad it was clear!

I hope you’re enjoying using PennyLane!