Skip to main content

GALUMPH

pipeline status

Calculate ALM (scattering amplitude decomposed into spherical harmonics) at Hyperspeed using GPU acceleration.

This is a preliminary implementation using PyOpenCL.

Example code:

import numpy as np
import Bio.PDB
import periodictable
import pyopencl
import galumph


ctx = pyopencl.create_some_context()

NS = 4096   # Number of S values at which to calculate the scattering
smax = 1.0  # Maximum S value
LMAX = 63   # Maximum harmonic order to use for the calculations

## Initialise the S array and allocate the ALM storage on the GPU
s = np.linspace(0, smax, NS)
kernel = galumph.AtomicScattering(LMAX, s, ctx=ctx)

## Use Bio.PDB to read the structure and periodictable to calculate the atomic form factors
pdb = Bio.PDB.PDBParser().get_structure("6lyz", "6lyz.pdb")
xyz = np.array([aa.get_vector().get_array() for aa in pdb.get_atoms()])
ff = np.array([periodictable.elements.symbol(aa.element).xray.f0(s) for aa in pdb.get_atoms()])

## Run the GPU calculation
alm = kernel.zeros()
kernel.add_many_atoms(alm, xyz, ff)
Icalc = kernel.sum_intensity(alm)

Metadata

Release files for galumph 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for galumph 0.3.0
File Size Uploaded
galumph-0.3.0.tar.gz 37.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for galumph 0.3.0
File Interpreter ABI Platform
galumph-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 71.2 kB

Release files / galumph-0.3.0.tar.gz

Download URL galumph-0.3.0.tar.gz
Size 37.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7a132b529f378e2ce56e0abbea3b1c923fdd556d22a95c72de1ff73eeb62b715
BLAKE2b-256 checksum
How to use checksums
417362f45c396b0f9cee79e0e9aeabc07d7df91962db06efc221edfec688dd1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

Release files / galumph-0.3.0-py3-none-any.whl

Download URL galumph-0.3.0-py3-none-any.whl
Size 34.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fe83340cd14a5ae06e161074a064afbd1b0ca8928c1162dc34b8a65c2dc5e94
BLAKE2b-256 checksum
How to use checksums
ab54ac897f7fecfabae2e069599639721a075e7dc09c494ab76776c2c0cfd3f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.3.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page