Newer
Older
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
## What Is CUDA Quantum?
CUDA Quantum streamlines hybrid application development and promotes productivity and scalability in quantum computing. It offers a unified programming model designed for a hybrid setting—that is, CPUs, GPUs, and QPUs working together.
For more information, see the [official documentation][1].
## How to Install Version Without GPU Acceleration
Use (preferably in conda environment)
```bash
pip install cuda-quantum
```
## How to Install Version With GPU Acceleration Using Conda
Run:
```bash
conda create -y -n cuda-quantum python=3.10 pip
conda install -y -n cuda-quantum -c "nvidia/label/cuda-11.8.0" cuda
conda install -y -n cuda-quantum -c conda-forge mpi4py openmpi cxx-compiler cuquantum
conda env config vars set -n cuda-quantum
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CONDA_PREFIX/envs/cuda-quantum/lib"
conda env config vars set -n cuda-quantum
MPI_PATH=$CONDA_PREFIX/envs/cuda-quantum
conda run -n cuda-quantum pip install cuda-quantum
conda activate cuda-quantum
source $CONDA_PREFIX/lib/python3.10/site-packages/distributed_interfaces/activate_custom_mpi.sh
```
Then configure the MPI:
``` bash
export OMPI_MCA_opal_cuda_support=true OMPI_MCA_btl='^openib'
```
## How to Test Your Installation?
You can test your installation by running the following script:
```bash
import cudaq
kernel = cudaq.make_kernel()
qubit = kernel.qalloc()
kernel.x(qubit)
kernel.mz(qubit)
result = cudaq.sample(kernel)
```
## Further Questions Considering the Installation?
See the Cuda Quantum PyPI website at [https://pypi.org/project/cuda-quantum/][2].
In the *qnn_example.py* you find a script that loads FashionMNIST dataset, chooses two data type (shirts and pants), then we create a Neural Network with quantum layer.This network is then trained on our data and later tested on the test dataset. You are free to try it on your own. Download the [QNN example][a] and rename it to `qnn_example.py`.

[1]: https://nvidia.github.io/cuda-quantum/latest/index.html
[2]: https://pypi.org/project/cuda-quantum/