Skip to main content

A Python interface to the DDalphaAMG multigrid solver library

Project description

A Python interface to the DDalphaAMG multigrid solver library

python pypi license build & test codecov pylint black

This package provides a Python interface to DDalphaAMG. DDalphaAMG is a solver library for inverting Wilson Clover and Twisted Mass fermions from lattice QCD. It provides an implementation of an adaptive aggregation-based algebraic multigrid ($\alpha$AMG) method.

Installation

NOTE: lyncs_DDalphaAMG requires a working MPI installation. This can be installed via apt-get:

sudo apt-get install libopenmpi-dev openmpi-bin

OR using conda:

conda install -c anaconda mpi4py

The package can be installed via pip:

pip install [--user] lyncs_DDalphaAMG

Documentation

The functions provided by the DDalphaAMG API are available in the Solver class lyncs_DDalphaAMG.Solver. Please, use help(Solver) to see an overview of the functionalities. In the following we present some examples on the usage of the package.

from lyncs_DDalphaAMG import Solver

# Creating the solver
solver = Solver(global_lattice=[4, 4, 4, 4],
       	 	kappa=0.125)

# Reading the configurations
conf = solver.read_configuration("test/conf.random")
plaq = solver.set_configuration(conf)
print("Plaquette:", plaq)

# Computing the solution of a random vector
vector = solver.random()
result = solver.solve(vector)

The above example is run locally and all the fields are numpy arrays.

The Solver class is also Dask compatible and by giving a distributed communicator, as in the following example, the solver instance is now distributed remotely on the dask workers and all the fields are Dask arrays.

from lyncs_mpi import Client

# Creating a client with 4 workers
client = Client(num_workers = 4)
comm = client.create_comm()
procs = [2, 2, 1, 1]
comm = comms.create_cart(procs)

solver = Solver(global_lattice=[4, 4, 4, 4],
       	 	comm = comm,
       	 	kappa=0.125)
		
# Continues as above

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

lyncs_DDalphaAMG-0.1.2.tar.gz (12.4 kB view details)

Uploaded Source

File details

Details for the file lyncs_DDalphaAMG-0.1.2.tar.gz.

File metadata

  • Download URL: lyncs_DDalphaAMG-0.1.2.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for lyncs_DDalphaAMG-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6e20993cc2d5ed73c395def09afd002d6bba2467f75463306a545118a434d0ca
MD5 4df9c720d34f30a4aa6cda9b25a07b14
BLAKE2b-256 5285c70a43c16466b5e6da5f1d690a16e66e82b399608e0cc3a7b36f1c88f6e0

See more details on using hashes here.

Supported by

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