Simplification

The simplification for YaoBlocks is currently implemented in a limited and straightforward fashion, there is only one interface simplify to call.

APIs

YaoBlocks.Optimise.is_pauliMethod
is_pauli(x)

Check if x is an element of pauli group.

Note

this function is just a binding of SimpleTraits.istrait, it will not work if the type is not registered as a trait with @traitimpl.

YaoBlocks.Optimise.replace_blockMethod
replace_block(actor, tree::AbstractBlock) -> AbstractBlock
replace_block(pair::Pair{Type{ST}, TT}, tree::AbstractBlock) -> AbstractBlock

replace blocks in a circuit, where actor is a function that given input block, returns the block to replace, or nothing for skip replacing and visit sibling. If pair is provided, then replace original block with type ST with new block (pair.second).