Reference#

fermi_contours#

Fermi Contours.

class fermi_contours.MarchingSquares(grid_values=None, func=None, bounds=None, res=None, open_contours=True, periodic=False)#

Marching square class.

Parameters:
  • grid_values (ndarray of floats with shape (n, m), optional) – Values of the function on a 2-dimensional coordinates grid.

  • func (callable) – Function that returns floats for each point in a 2-dimensional coordinates space. If grid_values is provided, func is used to resolve saddle points. If grid_values is not provided, then func, bounds and res must be provided. The grid_values is obtained using a 2-dimensional coordinates grid.

  • bounds (ndarray-like of shape (2, 2)) – Bounds in the x- and y-axis ((x_min, x_max), (y_min, y_max)), optional. If not provided, the bounds are assumed to be ((0, n), (0, m)).

  • res (int, optional) – Number of linear points to subdivide each of the axis intervals. If bounds is not provided, res is not used, and the shape of the grid_values is used instead.

  • open_contours (bool) – Wheather to allow open contours or raise an error when contours do not close on themselves.

  • periodic (bool, default to 'False') – If ‘True’, the 2-dimensional coordinates grid has periodic boundaries. Thus, the point (n, j) is equivalent to (0, j), and (i, m) equivalent to (i, 0). If bounds are provided, then x_max should be mapped to x_min, and y_max to y_min.

property grid_points: tuple[numpy.ndarray[Any, numpy.dtype[numpy.float64]], numpy.ndarray[Any, numpy.dtype[numpy.float64]]]#

Start grid to find the contours.