Closed cameton closed 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))
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))
Thank you very much for reporting the issue, it will be fixed by #409
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))