moble / quaternion

Add built-in support for quaternions to numpy
MIT License
599 stars 85 forks source link

quaternion dtype in cupy to benefit from GPU #231

Open sdancette opened 3 weeks ago

sdancette commented 3 weeks ago

Is your feature request related to a problem? Please describe. Feature: I would need to deal with quaternion algebra from cupy rather than from numpy.

Describe the solution you'd like quat.as_quat_array( ) and the resulting algebra from a cupy array on GPU rather than from numpy on CPU.

Describe alternatives you've considered My own quaternion algebra functions on cupy arrays, with a less compact syntax and presumably slower than with a proper quaternion dtype implemented for cupy.

Additional context Same context of materials science and 3D imaging community (large datasets) as in the previous issue on float32 precision. Now the memory issue with a 1024^3 quaternion array is even more severe here, since GPU devices typycally offer (much) less memory than CPU.

moble commented 3 weeks ago

Never used cupy, but again it looks like it would be much easier with quaternionic.