 # What is wrong in this

Hi @Vedant_Dwivedi. Thank you for posting your question here and welcome to the forum!

What node does this coding exercise correspond to?

I.9 Measurements. I think my y_basis rotation is wrong but somehow in exercise previous to this(attached) is made to pass correct.

Hi @Vedant_Dwivedi.
Your solution to the previous exercise is in fact correct.

In the last exercise look carefully into the rotation back to the computational basis. What is the effect of the operations you are using? What happens if you do an operation and then its adjoint? Do you really need to do both?

I hope this helps you!

I have been stuck in this exercise for quite a lot of time, and I think that the problem is either that the line:

is not working properly or I haven’t understood how to use it.

In the following image, I use what I was expecting from the adjoint and I finally get this exercise correctly.

@Guillem, `qml.adjoint` is a type of operation in PennyLane that we call a transform. Loosely, transforms take functions as input, and return functions as outputs. What `qml.adjoint` does is take a function (or operation) as input and returns a function that constructs the adjoint:

``````adjoint_of_S = qml.adjoint(qml.S)
``````

But these are just functions - they don’t actually execute anything unless you call them; the new functions take exactly the same arguments as the old ones. `qml.S` normally takes just a wires argument, so we use:

``````adjoint_of_S(wires=0)
``````

and this is equivalent to just doing

``````qml.adjoint(qml.S)(wires=0)
``````

And similarly for the `y_basis_rotation`, which takes no arguments,

``````adjoint_of_y_basis_rotation()
``````

or all in one line,

``````qml.adjoint(y_basis_rotation)()
``````

There is some more information, and other examples in the PennyLane docs for the transforms module. (In particular, `qml.ctrl` is a similar case, which you will find in later exercises in the Codebook!)

Aaaahh I see, thank you ^^