# qgear


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

> paper link: https://arxiv.org/pdf/2504.03967

![image.png](index_files/figure-commonmark/05381a41-1-image.png)

## Preliminary

- Let’s assume you already have a computational GPU node allocated on
  HPC
- Checking the NVIDIA GPU
  - `nvidia-smi`
- Create a env (we do not recommend using default such .local / HOME)
- Note that more than one GPU support need to enable
  [MPI](https://nvidia.github.io/cuda-quantum/latest/using/quick_start.html#install-cuda-q)
  \> the way we choose is high performance lustre file system

## 1. Install ENV

clone repo

``` bash
git clone git@github.com:gzquse/qgear.git`

cd qgear
```

``` bash
module load conda
conda create --prefix=/pscratch/sd/{location}/{username}/qgear -y python=3.11 pip
conda activate $SCRATCH/qgear
```

``` bash
pip install -u qgear 
pip install -u ipykernel
python -m ipykernel install --user --name qgear --display-name qgear
```

## 2. Open Jupyter Notebook

### NERSC jupyter

https://jupyter.nersc.gov/

Select the kernel
![image.png](index_files/figure-commonmark/efeebc44-3-image.png)

go to nbs/example.ipynb; run example
![image-2.png](index_files/figure-commonmark/efeebc44-2-image-2.png)

### Pypi

https://pypi.org/project/qgear/

### Demos

#### 1. simple speed up with random circuit and QFT

https://gzquse.github.io/qgear/examples.html

#### 2. quantum image encoding

> see appendix F in the paper https://gzquse.github.io/qgear/apps.html

![image.png](index_files/figure-commonmark/efeebc44-1-f37fd8db-fa15-4b4a-989b-df3d7a05f0a5.png)

## local development

``` sh
. ./pm_martin.dev.source

# make sure qgear package is installed in development mode
https://nbdev.fast.ai/tutorials/tutorial.html
pip3 install -e '.[dev]'
pip3 install qgear

# compile to have changes apply to qgear
nbdev_prepare
```

### Goal

build the versatile all-in-one quantum accelerator for HPC-QPU hybrid
regime that supports all the mainstream quantum frameworks.
