# I.5.4 T-depth calculation

Hello!
I am wondering why the original T-depth for the circuit is 6 (solution answer) and not 5. There are maximally 5 T gates acting on 1 qubit and all wires are independent (no 2-qubit gates).
Thank you!

Hi @avylor, welcome to the forum!

The depth is measured not by how many T gates are on a single qubit but how many ‘columns’ of gates you have. If you look a the image before you can see there are 6 columns.

I hope this helps!

Thank you so much for your reply and help!

I thought that the gates can be rearranged so that there are only five columns, since the second column is almost empty.
It is possible to move the gates in the second wire to the left so that there are only five columns with Ts.

Similarly, the codebook solution for “original depth” is 8, although in the original gate arrangement there are 9 columns in total. After moving gates to the left, there are 8 left and this is the correct answer.

Could you please let me know where my misunderstanding comes from?
Thank you!!

Good question @avylor!

I have rearranged the circuit the way you suggested. Can you count how many layers or “columns” include at least one T? You will notice that the number is still 6. However the original depth (the total number of layers) is in fact 8. This is why the answer to “original depth” is 8 but the answer to “original T-depth” is 6.

Please let me know if this is solves your question!

Thank you @CatalinaAlbornoz!!

The original depth calculation is clear.
I have one follow-up question about the t-depth calculation.
If the circuit is rearranged as below

there are 5 columns with a T-gate (green dots) and one column without a T-gate (orange dot). Does that mean that what matters for t-depth is the number of columns in between the first and the last column with a T, here 6?

Hi @avylor, I understand what you mean. The true T-depth is with everything pushed to the left, this is why the T-depth is 6. We should probably replace the original image since it’s confusing, and instead keep this one. Thank you for making us aware that this is confusing.

It seems I did not understand the T-depth definition the right way.

Thank you so much for all your help, clarifications and diagrams. I really appreciate it!

Thanks to you @avylor for helping us realize that this was confusing! It will help us improve the Codebook. Please let us know if you encounter other confusing questions, or if you have any other suggestions.

Enjoy using PennyLane!

1 Like