QuantumBFS / Yao.jl

Extensible, Efficient Quantum Algorithm Design for Humans.
https://yaoquantum.org
Other
918 stars 119 forks source link

Implementation of function to calculate circuit depth #426

Open DhruvaSambrani opened 1 year ago

DhruvaSambrani commented 1 year ago

Request for a function equivalent to circuit.depth() in Qiskit.

Here is the logic to find the depth, note that since at each step, the depth of the AbstractBlock needs to be added, which may not just be 1.

I may have missed this in the docs and the issues, or it may be called differently, and if so, please close the issue.

Roger-luo commented 1 year ago

Hi thanks for the issue, you are right we don't have this function currently.

DhruvaSambrani commented 1 year ago

Hi @Roger-luo,

I've implemented a part of the depth algorithm here - https://dhruvasambrani.github.io/html-uploads/depth-yao.html

If you think the method is scalable, let me know so I can finish writing the touches implementations for other block

Roger-luo commented 1 year ago

it seems your touches function is just occupied_locs function.

From your current implementation, it seems in general implements the steps described in the stack exchange, so I think it makes sense. Please feel free to make a PR, so we can further improve the implementation.