Failing public test (but not private) in Certificate Challenge: Introduction to PennyLane

Hello! I am having problems in the first certificate challenge, as in title.

In particular, the encoding S and the trainable block W seems to be working, however the public test with ‘PauliY’ returns wrong probabilities.
I suspect there is some kind of hidden problem with the generator PauliY, as all the other tests (including the private ones) give the correct probabilities.

The encoding block makes use of

qml.ops.Evolution

Am I missing something?

Hi @dan_lb, welcome to the Forum!

Your solution must work in general so in this case it looks like it’s working only in some specific situations.

Have you tried using qml.exp? It might make things easier for you.

I hope this helps!

It is every likely because, qml.evolve computes e^{-ixO} while the problem requires e^{ixO}.

You may be right @LdBeth ! It’s good that you pointed it out.