Known restrictions

"Hidden" FLO circuits

Yao.jl allows to express the same circuit in different forms. E.g.

chain(nq, put(1 => X), put(2 => X))

and

kron(nq, 1 => X, 2 => X)

represent the same FLO circuit, but only the latter will be recognised as such. Similarly

kron(nq, 1 => X, 2 => X, 3 => X, 4 => X)

and

chain(nq, kron(1 => X, 2 => X), kron(3 => X, 4 => X))

represent the same FLO circuit but only the latter will be recognised as such. This is because

  • We don't check if a whole ChainBlock is a FLO circuit, even if its single gates are not. Instead a ChainBlock is applied gate by gate, each of which has to be a FLO gate.
  • For KronBlocks we first try if each factor is a FLO gate and then if the whole block altogether is of the form kron(nq, i => σ1, i+1 => Z, ⋯, i-1 => Z, j => σ2) with σ1, σ2 ∈ [X, Y].

If you run into a case that is a FLO circuit / gate but not recognised as such please open an issue or even pull request.