Beispiel #1
0
def dobldobl_littlewood_richardson_homotopies(
    ndim, kdim, brackets, verbose=True, vrfcnd=False, minrep=True, tosqr=False, outputfilename=""
):
    r"""
    In n-dimensional space we consider k-dimensional planes,
    subject to intersection conditions represented by brackets.
    The parameters *ndim* and *kdim* give values for n and k respectively.
    The parameter *brackets* is a list of brackets.  A bracket is a list
    of as many natural numbers (in the range 1..*ndim*) as *kdim*.
    The Littlewood-Richardson homotopies compute k-planes that
    meet the flags at spaces of dimensions prescribed by the brackets,
    in double double precision.  Four options are passed as Booleans:

    *verbose*: for adding extra output during computations,

    *vrfcnd*: for extra diagnostic verification of Schubert conditions,

    *minrep*: for a minimial representation of the problem formulation,

    *tosqr*: to square the overdetermined systems.

    On return is a 4-tuple.  The first item of the tuple is the
    formal root count, sharp for general flags, then as second
    item the coordinates of the flags.  The coordinates of the
    flags are stored row wise in a list of real and imaginary parts.
    The third and fourth item of the tuple on return are respectively
    the polynomial system that has been solved and its solutions.
    The length of the list of solution should match the root count.
    """
    from phcpy.phcpy2c2 import py2c_solcon_clear_dobldobl_solutions
    from phcpy.phcpy2c2 import py2c_schubert_dobldobl_littlewood_richardson_homotopies as ddlrhom
    from phcpy.interface import load_dobldobl_solutions, load_dobldobl_system

    py2c_solcon_clear_dobldobl_solutions()
    nbc = len(brackets)
    cds = ""
    for bracket in brackets:
        for num in bracket:
            cds = cds + " " + str(num)
    # print 'the condition string :', cds
    (roco, sflags) = ddlrhom(
        ndim,
        kdim,
        nbc,
        len(cds),
        cds,
        int(verbose),
        int(vrfcnd),
        int(minrep),
        int(tosqr),
        len(outputfilename),
        outputfilename,
    )
    rflags = eval(sflags)
    flgs = []
    for k in range(len(rflags) / 4):
        flgs.append(complex(rflags[2 * k], rflags[2 * k + 2]))
    fsys = load_dobldobl_system()
    sols = load_dobldobl_solutions()
    return (roco, flgs, fsys, sols)
Beispiel #2
0
def dobldobl_littlewood_richardson_homotopies(ndim, kdim, brackets, \
    verbose=True, vrfcnd=False, minrep=True, tosqr=False, outputfilename=''):
    r"""
    In n-dimensional space we consider k-dimensional planes,
    subject to intersection conditions represented by brackets.
    The parameters *ndim* and *kdim* give values for n and k respectively.
    The parameter *brackets* is a list of brackets.  A bracket is a list
    of as many natural numbers (in the range 1..*ndim*) as *kdim*.
    The Littlewood-Richardson homotopies compute k-planes that
    meet the flags at spaces of dimensions prescribed by the brackets,
    in double double precision.  Four options are passed as Booleans:

    *verbose*: for adding extra output during computations,

    *vrfcnd*: for extra diagnostic verification of Schubert conditions,

    *minrep*: for a minimial representation of the problem formulation,

    *tosqr*: to square the overdetermined systems.

    On return is a 4-tuple.  The first item of the tuple is the
    formal root count, sharp for general flags, then as second
    item the coordinates of the flags.  The coordinates of the
    flags are stored row wise in a list of real and imaginary parts.
    The third and fourth item of the tuple on return are respectively
    the polynomial system that has been solved and its solutions.
    The length of the list of solution should match the root count.
    """
    from phcpy.phcpy2c2 import py2c_solcon_clear_dobldobl_solutions
    from phcpy.phcpy2c2 \
        import py2c_schubert_dobldobl_littlewood_richardson_homotopies \
        as ddlrhom
    from phcpy.interface import load_dobldobl_solutions, load_dobldobl_system
    py2c_solcon_clear_dobldobl_solutions()
    nbc = len(brackets)
    cds = ''
    for bracket in brackets:
        for num in bracket:
            cds = cds + ' ' + str(num)
    # print 'the condition string :', cds
    (roco, sflags) = ddlrhom(ndim, kdim, nbc, len(cds), cds, \
        int(verbose), int(vrfcnd), int(minrep), int(tosqr), \
        len(outputfilename), outputfilename)
    rflags = eval(sflags)
    flgs = []
    for k in range(len(rflags) / 4):
        flgs.append(complex(rflags[2 * k], rflags[2 * k + 2]))
    fsys = load_dobldobl_system()
    sols = load_dobldobl_solutions()
    return (roco, flgs, fsys, sols)
Beispiel #3
0
def dobldobl_littlewood_richardson_homotopies(ndim, kdim, brackets, \
    verbose=True, vrfcnd=False, outputfilename='/tmp/output'):
    """
    In n-dimensional space we consider k-dimensional planes,
    subject to intersection conditions represented by brackets.
    The parameters ndim and kdim give values for n and k respectively.
    The parameter brackets is a list of brackets.  A bracket is a list
    of as many natural numbers (in the range 1..ndim) as kdim.
    The Littlewood-Richardson homotopies compute k-planes that
    meet the flags at spaces of dimensions prescribed by the brackets,
    in double double precision.
    On return is a 4-tuple.  The first item of the tuple is the
    formal root count, sharp for general flags, then as second
    item the coordinates of the flags.  The coordinates of the
    flags are stored row wise in a list of real and imaginary parts.
    The third and fourth item of the tuple on return are respectively
    the polynomial system that has been solved and its solutions.
    The length of the list of solution should match the root count.
    """
    from phcpy.phcpy2c2 import py2c_solcon_clear_dobldobl_solutions
    from phcpy.phcpy2c2 \
        import py2c_schubert_dobldobl_littlewood_richardson_homotopies \
        as ddlrhom
    from phcpy.interface import load_dobldobl_solutions, load_dobldobl_system
    py2c_solcon_clear_dobldobl_solutions()
    nbc = len(brackets)
    cds = ''
    for bracket in brackets:
        for num in bracket:
            cds = cds + ' ' + str(num)
    # print 'the condition string :', cds
    (roco, sflags) = ddlrhom(ndim, kdim, nbc, len(cds), cds, int(verbose), \
        int(vrfcnd), len(outputfilename), outputfilename)
    rflags = eval(sflags)
    flgs = []
    for k in range(len(rflags)/4):
        flgs.append(complex(rflags[2*k], rflags[2*k+2]))
    fsys = load_dobldobl_system()
    sols = load_dobldobl_solutions()
    return (roco, flgs, fsys, sols)