Abstract
In this paper we present a generic construction to obtain an optimal T depth quantum circuit for any arbitrary n-input m-output Boolean function f: {0,1}ⁿ → {0,1}^m having algebraic degree k≤ n, and it achieves an exact Toffoli (and T) depth of log₂ k . This is a broader generalization of the recent result establishing the optimal Toffoli (and consequently T) depth for multi-controlled Toffoli decompositions (Dutta et al., Phys. Rev. A, 2025). We achieve this by inspecting the Algebraic Normal Form (ANF) of a Boolean function. Obtaining a benchmark for the minimum T depth of such circuits are of prime importance for efficient implementation of quantum algorithms by enabling greater parallelism, reducing time complexity, and minimizing circuit latency, making them suitable for near-term quantum devices with limited coherence times. The implications of our results are highlighted explaining the provable lower bounds on S-box and block cipher implementations, for example AES.