Skip to main content

High-Performance R-Matrix Solver for Nuclear Physics

Project description

HPRMAT - High-Performance R-Matrix Solver

A GPU-accelerated R-matrix solver for coupled-channel problems in nuclear physics.

Installation

From PyPI (Recommended)

pip install hprmat

Note: This installs the Python wrapper. You need to build the Fortran extension separately.

Building from Source

# Clone the repository
git clone https://github.com/jinlei/hprmat.git
cd hprmat

# Build the library
./setup.sh
make

# Build Python bindings
cd bindings
make python

Quick Start

from hprmat import RMatrixSolver, SOLVER_DENSE
import numpy as np

# Initialize solver
solver = RMatrixSolver(nr=30, ns=1, rmax=10.0)

# Single channel setup
lval = np.array([0], dtype=np.int32)
qk = np.array([0.5], dtype=np.float64)
eta = np.array([0.0], dtype=np.float64)

# Define potential (Gaussian)
cpot = np.zeros((30, 1, 1), dtype=np.complex128, order='F')
for ir, r in enumerate(solver.mesh):
    cpot[ir, 0, 0] = -50.0 * np.exp(-r**2 / 4.0)

# Solve and get S-matrix
S, nopen = solver.solve(lval, qk, eta, cpot)
print(f"S-matrix: {S[0,0]}")

Solver Types

Type Method Best For
SOLVER_DENSE (1) LAPACK ZGESV Reference, highest precision
SOLVER_MIXED (2) Mixed Precision Large matrices on CPU
SOLVER_WOODBURY (3) Woodbury Formula CPU-only systems
SOLVER_GPU (4) NVIDIA cuSOLVER Systems with GPU

Requirements

  • Python >= 3.9
  • NumPy >= 1.20
  • gfortran (for building from source)
  • LAPACK/BLAS
  • CUDA (optional, for GPU support)

License

MIT License

Author

Jin Lei

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hprmat-1.0.0.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hprmat-1.0.0-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file hprmat-1.0.0.tar.gz.

File metadata

  • Download URL: hprmat-1.0.0.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for hprmat-1.0.0.tar.gz
Algorithm Hash digest
SHA256 67a45e31138dbc7207f831ed0abc2bc8cf6d07361079f5c6d407121193a1aa06
MD5 cf6c36a563ee6ab95e0b3a2b91922058
BLAKE2b-256 9da1552a3c1d5e8980e1ce032a45dea5394b086fac32ab43172793fd1190f2da

See more details on using hashes here.

File details

Details for the file hprmat-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: hprmat-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for hprmat-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58098f9c8983fb1eccab6cc688aa51565af7542a41970cfed431f7f4b494d59b
MD5 facc089a183b59e2951a0c0f7768a7de
BLAKE2b-256 6363fbdc8552084d3e5d163d68c166caa31996408089797fac00d0b331df1678

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page