Metadata-Version: 2.4
Name: numba-quaternion
Version: 0.3.0
Summary: Quaternion operations that can be used within Numba-jit functions.
Keywords: quaternion,numba,rotation
Author: Kolen Cheung
Author-email: Kolen Cheung <christian.kolen@gmail.com>
License-Expression: BSD-3-Clause
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Dist: numba>=0.59
Requires-Dist: numpy>=1.23
Requires-Dist: scipy>=1.10
Requires-Python: >=3.10
Project-URL: Homepage, https://github.com/ickc/python-numba_quaternion
Project-URL: Documentation, https://ickc.github.io/python-numba_quaternion
Project-URL: Repository, https://github.com/ickc/python-numba_quaternion
Project-URL: Changelog, https://github.com/ickc/python-numba_quaternion/blob/main/CHANGELOG.md
Description-Content-Type: text/markdown

# numba_quaternion

[![CI](https://github.com/ickc/python-numba_quaternion/actions/workflows/ci.yml/badge.svg)](https://github.com/ickc/python-numba_quaternion/actions/workflows/ci.yml)
[![Documentation](https://github.com/ickc/python-numba_quaternion/actions/workflows/docs.yml/badge.svg)](https://ickc.github.io/python-numba_quaternion)
[![PyPI](https://img.shields.io/pypi/v/numba-quaternion.svg)](https://pypi.org/project/numba-quaternion)
[![Python versions](https://img.shields.io/pypi/pyversions/numba-quaternion.svg)](https://pypi.org/project/numba-quaternion)
[![conda-forge](https://img.shields.io/conda/vn/conda-forge/numba_quaternion.svg)](https://anaconda.org/conda-forge/numba_quaternion)
[![License](https://img.shields.io/pypi/l/numba-quaternion.svg)](https://github.com/ickc/python-numba_quaternion/blob/main/LICENSE)

Quaternion operations that can be used within Numba-jit functions.

## Introduction

This package contains some numba-jit-compiled functions that perform Quaternion operations and a convenient class `Quaternion` that provide convenient methods wrapping around those functions.

`Quaternion` behaves like a Numpy array containing quaternion, e.g. respect Numpy broadcast operations, but without really imitating a `numpy.ndarray` and implemented a `dtype`.

This design allows you to write any jit-compiled functions involving those provided jit-compiled functions, and then write your own class methods that calls those functions as a convenient interface (by class inheritance.)

If you do not care to use Quaternion in other jit-compiled functions you write, check out packages below instead.

## Installation

```sh
pip install numba-quaternion
# or
conda install -c conda-forge numba_quaternion
```

## Other Python quaternion projects

Other Python projects that implements quaternions and I knew and used are:

- [zonca/quaternionarray](https://github.com/zonca/quaternionarray): written in pure Python using Numpy. Note that unusually they put the real part in the last column. `lastcol_quat_to_canonical` and `canonical_quat_to_lastcol` convert between those and the canonical ordering (where real part comes first.)
- [hpc4cmb/toast](https://github.com/hpc4cmb/toast): toast.qarray is a reimplementation of the above quaternionarray package in C++ with the same interface, and following the same convention.
- [moble/quaternion](https://github.com/moble/quaternion): implement Quaternion as a Numpy dtype in C.
- [moble/quaternionic](https://github.com/moble/quaternionic): implement Quaternion as a Numpy dtype using Numba. This package is inspired by my expectation of quaternionic—I expected I could use them in a Numba-jit-compiled function but it doesn't.
