QuantumBFS / Yao.jl

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

Fixed KronBlock equality check #476

Closed jlbosse closed 1 year ago

jlbosse commented 1 year ago

Previously to this PR we had that

using Yao
kb1 = kron(3, 1 => X)
kb2 = kron(3, 1=>X, 2=>Z)
kb3 = kron(3, 1=>X, 2=>Z, 3=>Y)
kb1 == kb2

# output 
false  # as one would expect

kb2 == kb3

# output
ERROR: DimensionMismatch: arrays could not be broadcast to a common size; got a dimension with lengths 2 and 3

This is fixed with this PR.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: -0.62 :warning:

Comparison is base (b971dd4) 88.88% compared to head (d121b0c) 88.27%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #476 +/- ## ========================================== - Coverage 88.88% 88.27% -0.62% ========================================== Files 83 32 -51 Lines 4840 1748 -3092 ========================================== - Hits 4302 1543 -2759 + Misses 538 205 -333 ``` [see 51 files with indirect coverage changes](https://app.codecov.io/gh/QuantumBFS/Yao.jl/pull/476/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=QuantumBFS)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

GiggleLiu commented 1 year ago

The changes look good to me, thank you!