QuantumBFS / Yao.jl

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

Incorrect Definition for ishermitian for ChainBlock #406

Closed cameton closed 2 years ago

cameton commented 2 years ago

In Yao.jl/lib/YaoBlocks/src/composite/chain.jl, the definition for ishermitian seems to be the same as isreflexive, rather than actually checking if the ChainBlock is hermitian.

YaoAPI.isreflexive(c::ChainBlock) = (iscommute(c.blocks...) && all(isreflexive, c.blocks)) || isreflexive(mat(c)) LinearAlgebra.ishermitian(c::ChainBlock) = (all(isreflexive, c.blocks) && iscommute(c.blocks...)) || isreflexive(mat(c))

GiggleLiu commented 2 years ago

Thank you very much for reporting the issue, it will be fixed by #409