add `circuit_depth`
Fixes #426
Interface question, should count_measure be a kwarg? circuit_depth(circuit, count_measure=false) vs circuit_depth(circuit, false)
Yes I think it should be a keyword argument since it's an option, thanks!
Codecov Report
Patch coverage: 100.00% and project coverage change: +0.06 :tada:
Comparison is base (
c60f6d9) 88.28% compared to head (d336a6b) 88.35%.
:exclamation: Current head d336a6b differs from pull request most recent head 65e1549. Consider uploading reports for the commit 65e1549 to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## master #454 +/- ##
==========================================
+ Coverage 88.28% 88.35% +0.06%
==========================================
Files 77 77
Lines 4824 4835 +11
==========================================
+ Hits 4259 4272 +13
+ Misses 565 563 -2
| Impacted Files | Coverage Δ | |
|---|---|---|
| lib/YaoBlocks/src/blocktools.jl | 89.62% <100.00%> (+1.20%) |
:arrow_up: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
need to fix the test and make sure it passes the CI, please let me know if you have issues with that
yes sure
Thanks for the pull request, but I think the depth counting should be implemented in a recursive style. Suppose I have a nested chain, the counting of depth might be wrong.
You should add a test with the following circuit:
chain(chain(put(4, 2=>X), control(4, 2, 3=>Z)))
Its depth should be 2.
Please refer the implementation of gatecount.