https://github.com/quantumbfs/cuyao.jl
CUDA extension for Yao.jl
https://github.com/quantumbfs/cuyao.jl
circuit cuda gpu quantum yao
Last synced: 3 months ago
JSON representation
CUDA extension for Yao.jl
- Host: GitHub
- URL: https://github.com/quantumbfs/cuyao.jl
- Owner: QuantumBFS
- License: other
- Created: 2018-11-02T10:43:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-02T07:47:40.000Z (over 1 year ago)
- Last Synced: 2025-03-22T13:37:41.470Z (4 months ago)
- Topics: circuit, cuda, gpu, quantum, yao
- Language: Julia
- Homepage: https://yaoquantum.org
- Size: 219 KB
- Stars: 36
- Watchers: 6
- Forks: 8
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
**Build status**: [![][gitlab-img]][gitlab-url]
[gitlab-img]: https://gitlab.com/JuliaGPU/CuYao.jl/badges/master/pipeline.svg
[gitlab-url]: https://gitlab.com/JuliaGPU/CuYao.jl/pipelinesCUDA support for [Yao.jl](https://github.com/QuantumBFS/Yao.jl).
**Only tested locally, expect some adventures and rough edges.**
## Installation
CuYao is a
![]()
Julia Language
package. It provides CUDA support for Yao.jl. To install CuYao,
please open
Julia's interactive session (known as REPL) and press ] key in the REPL to use the package mode, then type the following commandFor stable release
```julia
pkg> add CuYao
```For current master
```julia
pkg> add CuYao#master
```You don't need to install Yao if you have `CuYao` installed. They share the same API except CUDA backend.
## Documentation
For documentation of [Yao](https://github.com/QuantumBFS/Yao.jl), please refer to [documentation (stable)](https://quantumbfs.github.io/Yao.jl/stable).
`CuYao.jl` provides only two extra APIs, `reg |> cu` to upload a register to GPU, and `cureg |> cpu` to download a register to CPU.
To start, see the following example
```julia
using CuYaocureg = rand_state(9; nbatch=1000) |> cu # or `curand_state(9; nbatch=1000)`.
cureg |> put(9, 2=>Z)
measure!(cureg |> append_qubits!(1) |> focus!(4,1,3))
cureg |> relax!(4,1,3) |> cpu
```Constructors `curand_state`, `cuzero_state`, `cuproduct_state`, `cuuniform_state` and `cughz_state` are tailored for GPU,
they are faster than uploading a CPU register to CPU.## Features
### Supported Gates- general U(N) gate
- general U(1) gate
- better X, Y, Z gate
- better T, S gate
- SWAP gate
- better control gates
- BP diff blocks### Supported Register Operations
- measure!, measure_reset!, measure_remove!, select
- append_qudits!, append_qubits!
- insert_qudit!, insert_qubits!
- focus!, relax!
- join
- density_matrix
- fidelity (not including density matrix)
- expect### Other Operations
- autodiff is supported when the only parameterized gates are rotation gates in a circuit.## The Team
This project is an effort of QuantumBFS, an open source organization for quantum science. Yao is currently maintained by [Xiu-Zhe (Roger) Luo](https://github.com/Roger-luo) and [Jin-Guo Liu](https://github.com/GiggleLiu) with contributions from open source community. All the contributors are listed in the [contributors](https://github.com/QuantumBFS/Yao.jl/graphs/contributors).
## License
**CuYao** is released under the Apache 2 license.