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. 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 vector
vector = solver.random()
result = solver.solve(vector)
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.1.tar.gz (11.8 kB view hashes)

Uploaded Source

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