Giter Club home page Giter Club logo

pysofft's Introduction

PySOFFT

This package allows to compute Fourier transforms on the rotation group SO(3).
It is a partial python port of soft-2.0 released by Peter Kostelec and Daniel Rockmore.

For details see their paper:
FFTs on the Rotation Group
J Fourier Anal Appl (2008) 14: 145โ€“179
DOI 10.1007/s00041-008-9013-5

The present numba code is a more or less straight copy/adaptation of the original C implementation.
PySOFT is made available with conset of the original authors and under the same GPL3 license.

Installation

pip install pysofft

Dependencies are: numpy and numba

Usage

Creating a Transform class for a fixed bandwidth (maximal considered spherical harmonic order +1)

from pysofft.soft import Soft

bandwidth = 32
soft_obj = Soft(bandwidth)

SO(3) grid points (gives as (2 bandwidth,2 bandwidth,2 bandwidth,3) array of euler angles $\alpha,\beta,\gamma$):

soft_obj.grid

FFT Coefficient grid points labeled by $n,m,l$ corresponding to the Wigner-D matrix $D^l_{n,m}$

soft_obj.coeff_grid

Creating random coefficients and computing the FFT on SO(3)

import numpy as np
Flnm=np.random.rand(*soft_obj.coeff_grid.shape[:-1]).astype('complex')

f = soft_obj.inverse_cmplx(Flnm) # inverse Transform   (Dlnm Coefficients -> SO(3))
Flnm2 = soft_obj.forward_cmplx(f) # forward Transform  (SO(3) -> Dlnm Coefficients)

Known Issues

There are some bugs when spawning child processes after instanciation of the class Soft. So, as of now consider Soft to be not fork save. If you want to use Soft in a multiprocess environment initiallize Soft in each child process individually.

pysofft's People

Contributors

timberberich avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.