Settings

Theme

Getting Started with Torch-Harmonics

github.com

35 points by ArtWomb 2 years ago · 16 comments

Reader

buildbot 2 years ago

What can one use spherical harmonics for? The repo does not really say. Neat pictures of globes?

  • mjhay 2 years ago

    Basically to model anything on a sphere (usually the Earth). Spherical harmonics are orthogonal functions on the sphere, just like Fourier modes are orthogonal functions in normal space. They solve Laplace's equation on the sphere.

    Gravity, geomagnetism, and many other things are often given in terms of spherical harmonics.

    • _a_a_a_ 2 years ago

      "Spherical harmonics are orthogonal functions on the sphere, just like Fourier modes are orthogonal functions in normal space"

      I am stupid. What does this mean?

      • mjhay 2 years ago

        It doesn't mean you're stupid! You're probably familiar with the concept of two lines (or vectors) being orthogonal (perpendicular) to each other. e.g., two 2-d vectors (0, 1) and (1, 0) are perpendicular. This is equivalent to saying that their dot product is 0:

        0*1 + 1*0 = 0

        Those are finite, 2d vectors. They also happen to be orthogonal unit length (orthonormal) basis vectors, because you can write any 2-d vector with linear combinations of those:

        (2, 1) = 2*(1, 0) + 1*(0, 1)

        We could do the same with any pair of non-parallel 2d vectors, but it's much easier to have an orthonormal basis.

        The same intuition almost completely carries over to infinite-dimensional vector spaces. Here, vectors are well-behaved functions on the sphere.

        The inner product (or dot product) of two such functions (e.g. f and g) is the integral of their product over the sphere, which pretty much multiplies the value of both f and g at every point, and adds up the pointwise values by area weighting (some other orthogonal function series are orthogonal under other weightings or spaces).

        Spherical harmonic functions form an orthonormal basis over the sphere (viewed as an infinite-dimensional vector space), just like those two vectors do over a 2d space. So, two different spherical harmonic functions have an inner product of zero. This makes a lot of things much easier!

        Fourier modes are very similar. Any nice periodic function on the real line can be written as a sum of the trigonmetric basis functions, called its Fourier series.*

      • xeonmc 2 years ago

        A vibrating string form sine waves.

        A vibrating bubble form spherical harmonics.

    • xeonmc 2 years ago

      What is the lowest order set of spherical harmonics that can approximate a cow?

  • xeonmc 2 years ago

    Any 3D shape/distribution can be expressed as some infinite mixture of Cartesian x-y-z (plane) waves, but if your object is closer to being radially symmetric then it might be more appropriate to express it as a mixture of azimuth-declination & radius waves instead. Technically you can choose any esoteric shape to split of your three degrees-of-freedom and your description will be mathematically identical as long as your DoF basis don’t have redundant parts, but usually we tend to use either Cartesian or spherical descriptions, and the frequency-domain (reciprocal space) description of those choice of symmetry corresponds to [xyz plane waves] or [spherical harmonics (angular part) + Spherical Hankel functions (radius part)]

  • zengid 2 years ago

    I'm guessing it's for global temperature modeling

    • randomgermanguy 2 years ago

      Spherical harmonics are used all over the place in climate science. But two big examples are Global oscillations like NAO&ENSO (so ocean currents and atmospheric pressure mostly), and analyzing wind-patterns on the globe/sphere.

atoav 2 years ago

Yeah cool, but why would you use it? What does it do? Can't be a propper introduction without that.

  • trostaft 2 years ago

    Disclaimer, this is out of my field.

    Essentially: Spherical harmonics are one of the classic methods to solve PDEs on spheres, modeling complex processes like climate change, or black hole physics, etc. The spherical harmonic transform is part of this process. torch-harmonics implements the transform in way that it's differentiable with the standard automatic processes, allowing you to play the traditional tricks (optimizing over it, sensitivity analysis, etc.) The first paper linked on the repo uses it to learn the dynamics of a set of shallow water equations first and then over a larger timescale from the ERA5 climate dataset. These types approaches are beginning to gain traction for solving actual climate-scale problems (speaking from inside a national lab context). Which is not to say the problem is solved, this is a nice proof of concept that may accelerate others wanting to solve this type of problem.

    TLDR: To enable data-driven deep learning methods based off of physics on a sphere (read: Earth), torch-harmonics is an important middle step.

voz_ 2 years ago

Very cool

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection