torch_harmonics.quadrature.trapezoidal_weights#

torch_harmonics.quadrature.trapezoidal_weights(n, a=-1.0, b=1.0, periodic=False)[source]#

Helper routine which returns equiangular-trapezoidal nodes with trapezoidal weights on the interval [a, b]

Parameters:
  • n (int) – Number of quadrature nodes

  • a (Optional[float]) – Lower bound of the interval

  • b (Optional[float]) – Upper bound of the interval

  • periodic (Optional[bool]) – Whether the grid is periodic

Returns:

  • xlg (torch.Tensor) – Tensor of quadrature nodes

  • wlg (torch.Tensor) – Tensor of quadrature weights

Return type:

Tuple[Tensor, Tensor]