QuantumBFS / Yao.jl

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

Retrieving a Unitary from a circuit #429

Closed BoltzmannEntropy closed 1 year ago

BoltzmannEntropy commented 1 year ago

Dear team, Is that possible? If yes, how? I wasn't able to find anything like that in the documentation.

Thanks,

GiggleLiu commented 1 year ago

Hi, thanks for the issue. If you are mentioning about manipulating the circuit structure, maybe you will find the Manipulate the block tree section of this notebook be useful: https://giggleliu.github.io/notebooks/notebooks/yaoblocks.html

The subblocks API might be the one most relevant. If you want the matrix representation of a unitary, just call mat.