Yao and PastaQ integration library.
YaoPastaQ is a Julia Language package. To install YaoPastaQ, please open Julia's interactive session (known as REPL) and press ] key in the REPL to use the package mode, then type the following command
pkg> add https://github.com/QuantumBFS/YaoPastaQ.jl
This package provides a PastaQ register called PastaQReg
and some functions to work with it.
You can create a PastaQReg using
julia> using YaoPastaQ, Yao
julia> p = chain(3, put(1=>X), repeat(H,1:3))
nqubits: 3
chain
├─ put on (1)
│ └─ X
└─ repeat on (1, 2, 3)
└─ H
julia> apply!(create_reg(3), p)
PastaQReg{ITensors.MPS}
active qubits: 3/3
You can also use the genlist
function, which can convert a block in Yao to a list which can be read and used by the functions of PastaQ
julia> list = genlist(chain(3, put(1=>X), repeat(Rz(π/3),1:3)))
4-element Vector{Any}:
("X", 1)
("Rz", 1, (ϕ = 1.0471975511965976,))
("Rz", 2, (ϕ = 1.0471975511965976,))
("Rz", 3, (ϕ = 1.0471975511965976,))
MIT License