# Define the slit map, algebraically again
 slitmap = build_slitmap(omega)
 
 # Test the slit map if we want -- IS THIS ALLOWED FOR ALGEBRAICALLY DEFINED
 # OMEGA?
 if slitmap_tests: test_slitmap(slitmap) 
 
 # Build the slitmap piece by piece for diagnostic purposes. -- IS THIS
 # ALLOWED FOR ALGEBRAICALLY DEFINED OMEGA?
 if slitmap_full: build_slitmap_detailed(omega, delta, q)
 
 # Map the pre_branch_pts to the branch points under the slit map. The result
 # is an algebraic expression which we compare to the true branch_pts. There
 # are 2g alg_branch_pts
 alg_branch_pts = map(lambda x: slitmap(z=x),pre_branch_pts)
 
 # Now we want to solve this system. There are 2g unknown alg_branch_pts and
 # 2g known branch_pts. Therefore we have 2g equations in 2g unknowns. Solve
 # it up!!!
 # I don't know if this will just work like this. I imagine it will be
 # slow...
 # We also want to be careful to organize these well. We want the first
 # equation to be delta_1 - q_1 = e_1, delta_1 + q_1 = e_2 etc. The numbering
 # doesn't matter but we do want the two adjacent branch points to be labeled
 # by delta - q and delta + q respectively. 
 eqns = [ alg_branch_pts[k] == branch_pts[k] for k in xrange(len(branch_pts)) ]
 sol = solve(eqns, delta+q, solution_dict=True) # Solve and get a dictionary
 # The above thing might give multiple answers, i.e. len(sol)>1. If so, we
 # need to look through all possible answers for now since I do not now know
 # how to determine which is which.
    # Build the slitmap piece by piece for diagnostic purposes.
    if slitmap_full:
        build_slitmap_detailed(omega, delta, q, circle_colors=circle_colors)
    # this thing can output some stuff for use, but for now it just plots.

    # Define the points of intersection of the Cj with the real axis. The image
    # of these points under the slitmap (5.19) are the branch points of the
    # curve.
    # For the hyperelliptic case this is easy, we know what the circles look
    # like so this is where they intersect. For the nonhyperelliptic case we
    # need to do something else maybe. For example, evaluate Cj(t=0)?
    pre_branch_pts = [delta[j] - q[j] for j in xrange(genus)]
    pre_branch_pts += [delta[j] + q[j] for j in xrange(genus)]

    # Branch points are the image of pre_branch_pts
    branch_pts = [slitmap(z=bp) for bp in pre_branch_pts]

    # Simple plot of branch points if interested. Shows location.
    if plot_branch_pts:
        branch_plot = branch_point_plot(branch_pts)
        branch_plot.show(axes=True, title='Branch Points')

    return branch_pts


def forward_problem_on_Points_and_Lines(delta,
                                        q,
                                        Points,
                                        Lines,
                                        plot_circles=True,
                                        plot_F=False,
Esempio n. 3
0
    # Define the slit map, algebraically again
    slitmap = build_slitmap(omega)

    # Test the slit map if we want -- IS THIS ALLOWED FOR ALGEBRAICALLY DEFINED
    # OMEGA?
    if slitmap_tests: test_slitmap(slitmap)

    # Build the slitmap piece by piece for diagnostic purposes. -- IS THIS
    # ALLOWED FOR ALGEBRAICALLY DEFINED OMEGA?
    if slitmap_full: build_slitmap_detailed(omega, delta, q)

    # Map the pre_branch_pts to the branch points under the slit map. The result
    # is an algebraic expression which we compare to the true branch_pts. There
    # are 2g alg_branch_pts
    alg_branch_pts = map(lambda x: slitmap(z=x), pre_branch_pts)

    # Now we want to solve this system. There are 2g unknown alg_branch_pts and
    # 2g known branch_pts. Therefore we have 2g equations in 2g unknowns. Solve
    # it up!!!
    # I don't know if this will just work like this. I imagine it will be
    # slow...
    # We also want to be careful to organize these well. We want the first
    # equation to be delta_1 - q_1 = e_1, delta_1 + q_1 = e_2 etc. The numbering
    # doesn't matter but we do want the two adjacent branch points to be labeled
    # by delta - q and delta + q respectively.
    eqns = [
        alg_branch_pts[k] == branch_pts[k] for k in xrange(len(branch_pts))
    ]
    sol = solve(eqns, delta + q,
                solution_dict=True)  # Solve and get a dictionary
    if slitmap_full: build_slitmap_detailed(omega, delta, q,
                circle_colors=circle_colors)
    # this thing can output some stuff for use, but for now it just plots. 
    
    
    # Define the points of intersection of the Cj with the real axis. The image
    # of these points under the slitmap (5.19) are the branch points of the
    # curve.
    # For the hyperelliptic case this is easy, we know what the circles look
    # like so this is where they intersect. For the nonhyperelliptic case we
    # need to do something else maybe. For example, evaluate Cj(t=0)?
    pre_branch_pts = [ delta[j]-q[j] for j in xrange(genus) ]
    pre_branch_pts += [ delta[j]+q[j] for j in xrange(genus) ]
    
    # Branch points are the image of pre_branch_pts
    branch_pts = [slitmap(z = bp) for bp in pre_branch_pts]
    
    # Simple plot of branch points if interested. Shows location.
    if plot_branch_pts:
        branch_plot=branch_point_plot(branch_pts)
        branch_plot.show(axes = True, title='Branch Points')
    
    return branch_pts

def forward_problem_on_Points_and_Lines(
        delta, q, Points, Lines, plot_circles=True, plot_F=False,
        slitmap_full=True, slitmap_direct=False, prec='double', 
        product_threshold=5, max_time=200, prime_function_tests=False, 
        slitmap_tests=False, point_size=80, save_plots=False
        ):
    #