Skip to main content

Fast multiplications of quaternion-valued matrices.

Project description

qmatmul: Fast multiplication of quaternion-valued matrices - algorithm and its implementations for sequential and CUDA computations

We present an algorithm for fast multiplication of matrices whose elements are quaternions - hypercomplex numbers consisting of one real and three imaginary parts. The number of elementary floating-point multiplications involved in the algorithm is reduced twice with respect to the definition-based formula, regardless of the input matrices. This is owed to a suitable representation and decomposition into two products, one of which takes advantage of certain diagonal symmetry properties, the other of sparsity.

The qmatmul package is suitable for Python's ecosystem. Altogether, we provide 8 implementation variants of matrix-matrix multiplication for quaternion-valued inputs. The variants cover several approaches based on NumPy, thus supported by BLAS, but also several approaches employing Numba - a just-in-time compiler targeting both CPU and GPU (CUDA). Our design of CUDA computations for the proposed algorithm involves: 6 kernel functions with 11 invocations, tiling and shared memory, and few host-device memory transfers.

Installation

pip install qmatmul

For usage examples and more information see the repository at: https://github.com/pklesk/quaternions.

Documentation

Developer documentation of the project is accessible at: https://pklesk.github.io/quaternions.

License

This project is licensed under the MIT License.

Acknowledgments and credits

  • NumPy: the fundamental package for scientific computing with Python.
  • Numba: a high-performance just-in-time Python compiler.

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

qmatmul-1.0.3.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

qmatmul-1.0.3-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file qmatmul-1.0.3.tar.gz.

File metadata

  • Download URL: qmatmul-1.0.3.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for qmatmul-1.0.3.tar.gz
Algorithm Hash digest
SHA256 9cc610818379a862367faede7f3b53b585e66ffe0e20ffa1b5b581b2a365bfe4
MD5 efd0135f65e1439cec63411d1acecc5d
BLAKE2b-256 f6a2949c9c9511fb92bbd53a6ad36d1e99b494e44dc7a2970742a6a54fb7c4fc

See more details on using hashes here.

File details

Details for the file qmatmul-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: qmatmul-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for qmatmul-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bf7e4e49cd45f26c93822babf72c60570ff728da2c0e476ff1bfbe334fbd1385
MD5 9ba884467eb854ab98a815bd69c557b6
BLAKE2b-256 189115c5c04620002d84243d3d90cf165a5a989295200bdff37727655599c58e

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