Circuit.get_region

Circuit.get_region(points)[source]

Calculate the minimal region from a sequence of points.

Parameters:

points (Iterable[CircuitPointLike]) – The positions of operations to group together.

Returns:

The region given by points.

Return type:

(CircuitRegion)

Raises:
  • ValueError – If points do not form a valid convex region in the circuit. This happens when there exists an operation within the bounds of points, but not contained in it.

  • IndexError – If any of points are out-of-range.