https://github.com/quantumbfs/yaopastaq.jl
YaoPastaQ integration
https://github.com/quantumbfs/yaopastaq.jl
Last synced: 10 months ago
JSON representation
YaoPastaQ integration
- Host: GitHub
- URL: https://github.com/quantumbfs/yaopastaq.jl
- Owner: QuantumBFS
- License: mit
- Created: 2021-05-18T23:32:52.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-16T00:26:11.000Z (over 4 years ago)
- Last Synced: 2025-05-30T22:27:58.161Z (about 1 year ago)
- Language: Julia
- Size: 118 KB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YaoPastaQ
[](https://QuantumBFS.github.io/YaoPastaQ.jl/stable)
[](https://QuantumBFS.github.io/YaoPastaQ.jl/dev)
[](https://github.com/QuantumBFS/YaoPastaQ.jl/actions)
[](https://codecov.io/gh/QuantumBFS/YaoPastaQ.jl)
[Yao](https://github.com/QuantumBFS/Yao.jl) and [PastaQ](https://github.com/GTorlai/PastaQ.jl) integration library.
## Installation
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
```julia
pkg> add https://github.com/QuantumBFS/YaoPastaQ.jl
```
## Usage
This package provides a PastaQ register called `PastaQReg` and some functions to work with it.
You can create a PastaQReg using
```julia
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](https://github.com/GTorlai/PastaQ.jl)
```julia
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,))
```
## License
MIT License