def RiemannSurfacePath_from_complex_path(self, complex_path, x0=None, y0=None): r"""Constructs a :class:`RiemannSurfacePath` object from x-path data. Parameters ---------- complex_path : ComplexPath A complex path. x0 : complex (default `self.base_point`) The starting x-point of the path. y0 : complex list (default `self.base_sheets`) The starting ordering of the y-sheets. Returns ------- RiemannSurfacePath A path on the Riemann surface with the prescribed x-path. """ if x0 is None: x0 = self.base_point if y0 is None: y0 = self.base_sheets # coerce and assert that x0,y0 lies on the path and curve x0 = complex(x0) y0 = array(y0, dtype=complex) if abs(x0 - complex_path(0)) > 1e-7: raise ValueError('The point %s is not at the start of the ' 'ComplexPath %s' % (x0, complex_path)) f = self.riemann_surface.f curve_error = [abs(complex(f(x0, y0k))) for y0k in y0] if max(curve_error) > 1e-7: raise ValueError('The fibre %s above %s does not lie on the ' 'curve %s' % (y0.tolist(), x0, f)) # build a list of path segments from each tuple of xdata. build a line # segment or arc depending on xdata input x0_segment = x0 y0_segment = y0 segments = [] for segment_x in complex_path.segments: # for each segment determine if we're far enough away to use Smale # alpha theory paths or if we have to use Puiseux. we add a # relazation factor to the radius to account for monodromy paths xend = segment_x(1.0) b = self.complex_path_factory.closest_discriminant_point(xend) R = self.complex_path_factory.radius(b) if abs(xend - b) > 0.9 * R: segment = RiemannSurfacePathSmale(self.riemann_surface, segment_x, y0_segment) else: segment = RiemannSurfacePathPuiseux(self.riemann_surface, segment_x, y0_segment) # determine the starting place of the next segment x0_segment = segment.get_x(1.0) y0_segment = segment.get_y(1.0) segments.append(segment) # build the entire path from the path segments gamma = RiemannSurfacePath(self.riemann_surface, complex_path, y0, segments) return gamma
def RiemannSurfacePath_from_complex_path(self, complex_path, x0=None, y0=None): r"""Constructs a :class:`RiemannSurfacePath` object from x-path data. Parameters ---------- complex_path : ComplexPath A complex path. x0 : complex (default `self.base_point`) The starting x-point of the path. y0 : complex list (default `self.base_sheets`) The starting ordering of the y-sheets. Returns ------- RiemannSurfacePath A path on the Riemann surface with the prescribed x-path. """ if x0 is None: x0 = self.base_point if y0 is None: y0 = self.base_sheets # coerce and assert that x0,y0 lies on the path and curve x0 = complex(x0) y0 = array(y0, dtype=complex) if abs(x0 - complex_path(0)) > 1e-7: raise ValueError('The point %s is not at the start of the ' 'ComplexPath %s'%(x0, complex_path)) f = self.riemann_surface.f curve_error = [abs(complex(f(x0,y0k))) for y0k in y0] if max(curve_error) > 1e-7: raise ValueError('The fibre %s above %s does not lie on the ' 'curve %s'%(y0.tolist(), x0, f)) # build a list of path segments from each tuple of xdata. build a line # segment or arc depending on xdata input x0_segment = x0 y0_segment = y0 segments = [] for segment_x in complex_path.segments: # for each segment determine if we're far enough away to use Smale # alpha theory paths or if we have to use Puiseux. we add a # relazation factor to the radius to account for monodromy paths xend = segment_x(1.0) b = self.complex_path_factory.closest_discriminant_point(xend) R = self.complex_path_factory.radius(b) if abs(xend - b) > 0.9*R: segment = RiemannSurfacePathSmale( self.riemann_surface, segment_x, y0_segment) else: segment = RiemannSurfacePathPuiseux( self.riemann_surface, segment_x, y0_segment) # determine the starting place of the next segment x0_segment = segment.get_x(1.0) y0_segment = segment.get_y(1.0) segments.append(segment) # build the entire path from the path segments gamma = RiemannSurfacePath(self.riemann_surface, complex_path, y0, segments) return gamma