Ticket #12270: trac_12270_swap_processes.patch

File trac_12270_swap_processes.patch, 1.5 KB (added by JCooley, 8 years ago)

swaps the order of the two processes

  • sage/rings/number_field/number_field.py

    # HG changeset patch
    # User Jenny Cooley <j.a.cooley@warwick.ac.uk>
    # Date 1374662667 -3600
    # Node ID cc944241f5eb06d323f29eeb4c0643d9fadc5cff
    # Parent  0f8fd922eaed351e39f913f1317d319dcceb4c01
    Trac 12270 swaps the order of the two independent processes described on the trac.
    
    diff --git a/sage/rings/number_field/number_field.py b/sage/rings/number_field/number_field.py
    a b  
    56805680        # Convert from L to K
    56815681        K = self
    56825682        L = x.parent()
    5683         # List of candidates for K(x)
    5684         f = x.minpoly()
    5685         ys = f.roots(ring=K, multiplicities=False)
    5686         if not ys:
    5687             raise ValueError, "Cannot convert %s to %s (regardless of embeddings)"%(x,K)
    5688 
    56895683        # Find embeddings for K and L.  If no embedding is given, simply
    56905684        # take the identity map as "embedding".  This handles the case
    56915685        # where one field is created as subfield of the other.
     
    57205714        else:
    57215715            raise TypeError, "No compatible natural embeddings found for %s and %s"%(KF,LF)
    57225716
     5717        # List of candidates for K(x)
     5718        f = x.minpoly()
     5719        ys = f.roots(ring=K, multiplicities=False)
     5720        if not ys:
     5721            raise ValueError, "Cannot convert %s to %s (regardless of embeddings)"%(x,K)
     5722
    57235723        # Define a function are_roots_equal to determine whether two
    57245724        # roots of f are equal.  A simple a == b does not suffice for
    57255725        # inexact fields because of floating-point errors.