xnn.trfnn.models.equiformer_v2.SO2Convolution#

class xnn.trfnn.models.equiformer_v2.SO2Convolution(in_channels, out_channels, lmax, mmax, radial=None, extra_m0=0, m_order_in=False, m_order_out=False)[source]#

Bases: Module

eSCN convolution in the edge frame: one linear map per order m, mixing +m and -m.

m = 0 is a plain linear map (with bias); for m > 0 the real and imaginary parts x_+m, x_-m map as (W_r x_+m - W_i x_-m, W_r x_-m + W_i x_+m), which commutes with rotations about the edge. With a radial function the inputs are first multiplied by per-edge weights.

Parameters:
  • in_channels (int) – Channels per coefficient.

  • out_channels (int) – Channels per coefficient.

  • lmax (int) – Degrees and orders of the edge-frame features.

  • mmax (int) – Degrees and orders of the edge-frame features.

  • radial (list of int, optional) – Widths of the radial function [n_in, hidden...]; None for no radial weights.

  • extra_m0 (int, optional) – Extra outputs of the m = 0 map returned on their own (attention scalars, gates).

  • m_order_in (bool, optional) – The input (output) is already in the order of m_primary_order() (the rotations into and out of the edge frames produce and take it), instead of the degree-major order; by default False.

  • m_order_out (bool, optional) – The input (output) is already in the order of m_primary_order() (the rotations into and out of the edge frames produce and take it), instead of the degree-major order; by default False.

forward(x, x_edge, radial_applied=False)[source]#

Map edge-frame features (E, n, C_in) to (E, n, C_out) and the extra m = 0 outputs.

radial_applied: the input already carries the radial weights (see rad_expand).

Parameters:
Return type:

Tuple[Tensor, Tensor]