QuantumBFS / ZXCalculus.jl

An implementation of ZX-calculus in Julia
http://yaoquantum.org/ZXCalculus.jl/dev/
MIT License
48 stars 7 forks source link

Reducing CNOT count during circuit extraction #70

Closed ChenZhao44 closed 3 years ago

ChenZhao44 commented 3 years ago

I use SWAP gates to reduce CNOT counts. More tests are needed. Please do not merge until tests are added.

codecov[bot] commented 3 years ago

Codecov Report

Merging #70 (f957110) into master (e9a872a) will increase coverage by 1.41%. The diff coverage is 87.58%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #70      +/-   ##
==========================================
+ Coverage   82.18%   83.59%   +1.41%     
==========================================
  Files          11       11              
  Lines        1532     1652     +120     
==========================================
+ Hits         1259     1381     +122     
+ Misses        273      271       -2     
Impacted Files Coverage Δ
src/ir.jl 62.50% <64.70%> (+25.51%) :arrow_up:
src/simplify.jl 87.59% <92.94%> (+9.33%) :arrow_up:
src/circuit_extraction.jl 79.56% <100.00%> (+3.22%) :arrow_up:
src/phase.jl 64.06% <100.00%> (ø)
src/phase_teleportation.jl 100.00% <100.00%> (ø)
src/zx_diagram.jl 84.94% <100.00%> (-9.62%) :arrow_down:
src/zx_graph.jl 92.14% <100.00%> (ø)
src/rules.jl 89.91% <0.00%> (+0.17%) :arrow_up:
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e9a872a...f957110. Read the comment docs.

ChenZhao44 commented 3 years ago

@Roger-luo it's ready to be merged now.

Roger-luo commented 3 years ago

can we chat about this in the next meeting? I'll merge it after that.

ChenZhao44 commented 3 years ago

@Roger-luo CI failed because the SWAP PR of YaoHIR is not merged.

ChenZhao44 commented 3 years ago

@Roger-luo Naive simplification methods (e.g. simplify_swap!) for Chain are temporarily in this package. We need to make a new package for them later.

Roger-luo commented 3 years ago

Yeah I think there are a few better ways of doing SWAP simplification. let's do that in the exact match package later.