### tutorial by: Tess E. Smidt (blondegeek)¶

We are going to use class methods of the SphericalTensor class to plot angular and radial Fourier transforms of geometry. This allows us to use this type of data as input or output to our models.

In [1]:
from functools import partial
import numpy as np
import torch
import e3nn
from spherical import plot_data_on_grid, SphericalTensor, projection
import e3nn.o3 as o3
import e3nn.rs as rs

import plotly
import plotly.graph_objects as go

import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline

import math


## Examples of RadialModels for plotting¶

Note, these differ from the models in e3nn.radial since they do not inherit from torch.nn.Modules and have NO LEARNED PARAMETERS.

In [2]:
def ConstantRadialModel():
shape = r.shape

shape = r.shape
radial_shape = [1] * len(shape) + [number_of_basis]

gamma = 1. / spacing

shape = r.shape
radial_shape = [1] * len(shape) + [number_of_basis]



## Set up coordinates for tetrahedra and set lmax¶

In [3]:
tetra_coords = torch.tensor( # The easiest way to construct a tetrahedron is using opposite corners of a box
[[0., 0., 0.], [1., 1., 0.], [1., 0., 1.], [0., 1., 1.]]
)
tetra_coords -= tetra_coords.mean(-2)

lmax = 3


## Create and plot spherical harmonic projection with radial functions¶

(Also called an angular and radial Fourier Transform)

In [4]:
n_radial = 3

plot_max = float(f.abs().max()) * 0.5