I.5.4. why more than 2 T gates needed?

In I.5.4, we are asked to reduce sequences of T gates. On wire 2, we have three T_adjoint gates. Since a T_adjoint gate is a -pi/4 degree rotation, then 3 T_adjoints is a -3pi/4 rotation, so is it possible to replace this with an RZ gate that performs this rotation? I tried to do that, but I got an error message saying “Incorrect: more than 2 T gates are needed”.

Now, I understand that 2 T_adjoints make an S_adjoint and this leaves a T_adjoint (which is the correct answer here), but I am wondering if it is possible to replace them with an RZ gate, and whether this actually helps with the “resource-intensive” problem that I.5.4 mentions.

Hi @Kamal_Mohamed! You’re right that an RZ gate could work. We have a test that checks the number of T’s so it will mark your answer as incorrect. We should change the description of the problem so that it’s clear that only S and T gates are allowed. Thank you for pointing this out!

I have made an issue for this on the GitHub repo.