Metadata-Version: 2.1
Name: PyQUDA-Utils
Version: 0.10.52.post0
Summary: Utility scripts based on PyQUDA
Author-email: SaltyChiang <SaltyChiang@users.noreply.github.com>
Maintainer-email: SaltyChiang <SaltyChiang@users.noreply.github.com>
License: MIT License
        
        Copyright (c) 2022-2024 PyQUDA Developers
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/CLQCD/PyQUDA
Project-URL: Documentation, https://github.com/CLQCD/PyQUDA/wiki/Documentation
Project-URL: Repository, https://github.com/CLQCD/PyQUDA.git
Project-URL: Issues, https://github.com/CLQCD/PyQUDA/issues
Keywords: lattice-gauge-theory,lattice-field-theory,lattice-qcd,hep-lat
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Cython
Classifier: Operating System :: POSIX :: Linux
Classifier: Environment :: GPU
Classifier: Environment :: GPU :: NVIDIA CUDA
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyQUDA

# PyQUDA

Python wrapper for [QUDA](https://github.com/lattice/quda) written in Cython.

This project aims to benefit from the optimized linear algebra library [CuPy](https://cupy.dev/) in Python based on CUDA. CuPy and QUDA will allow us to perform most lattice QCD research operations with high performance. [PyTorch](https://pytorch.org/) is an alternative option. [DPNP](https://intelpython.github.io/dpnp/) is the recommendation for Intel GPU.

This project is based on the latest QUDA `develop` branch. PyQUDA should be compatible with any commit of QUDA after https://github.com/lattice/quda/pull/1489, but leave some features disabled.

## Feature

- Multi-GPU supported
  - with [MPI for Python](https://mpi4py.readthedocs.io/en/stable/) package
- File I/O
  - Read gauge and propagator in Chroma format (with checksum)
  - Read gauge and propagator in MILC format (with checksum)
  - Read/write gauge and propagator in KYU format
  - Read/write gauge and propagator in XQCD format
  - Read/write gauge in NERSC format
  - Read/write gauge in OpenQCD format
  - Read/write lattice field in NPY format (numpy)
  - Read/write lattice field in HDF5 format (h5py)
- Quark propagator
  - Isotropic/anisotropic Wilson fermion action with multigrid support
  - Isotropic/anisotropic Clover fermion action with multigrid support
  - Isotropic HISQ fermion action
- HMC
  - Isotropic gauge action
  - 1-flavor isotropic clover fermion action
  - 2-flavor isotropic clover fermion action
  - N-flavor isotropic HISQ fermion action
- Gauge fixing
  - Rotation field with over-relaxation method (waiting for QUDA merge)
- Gauge smearing
  - 3D/4D APE smearing
  - 3D/4D stout smearing
  - 3D/4D HYP smearing
- Fermion smearing
  - Gaussian smearing
- Gradient flow
  - Wilson/Symanzik flow
  - Wilson/Symanzik flow with fermion
  - Adjoint Wilson/Symanzik flow with fermion

## Installation

### Install from PyPI (Recommend)

Assuming the QUDA installation path is `/path/to/quda/build/usqcd`

```bash
export QUDA_PATH=/path/to/quda/build/usqcd
python3 -m pip install pyquda pyquda-utils
```

### Install from source

```bash
export QUDA_PATH=/path/to/quda/build/usqcd
git clone --recursive https://github.com/CLQCD/PyQUDA.git
cd PyQUDA/pyquda_core
python3 -m pip install .
cd ..
python3 -m pip install .
```

## Benchmark

Refer to https://github.com/CLQCD/PyQUDA/wiki/Benchmark for detailed instructions to run the PyQUDA benchmark.

## Documentation (draft)

https://github.com/CLQCD/PyQUDA/wiki/Documentation

## Plugin

Refer to https://github.com/CLQCD/PyQUDA/wiki/Plugin for detailed instructions to build PyQUDA plugins.

Here are plugins developed by PyQUDA developers:
- [pycontract](https://github.com/CLQCD/contract)

## Development

We recommend building PyQUDA using in-place mode instead of installing PyQUDA for development.

```bash
export QUDA_PATH=/path/to/quda/build/usqcd
git clone --recursive https://github.com/CLQCD/PyQUDA.git
cd PyQUDA/pyquda_core
python3 setup.py build_ext --inplace
cd ..
python3 setup.py egg_info
ln -s pyquda_core/pyquda_comm ./
ln -s pyquda_core/pyquda ./
```

Now you can modify Python files in the project and immediately get the new result by running scripts. Adding the root directory to `sys.path` is needed if you are running scripts from other directories.

## Maintenance

Function definitions (mainly in `quda.in.pxd` and `quda.in.pyx`) and most docstrings (mainly in `pyquda.pyi` and `enum_quda.in.py`) should be manually updated as they cannot be autogenerated now. This also means PyQUDA should work well with future versions if the API remains unchanged.
