Пример #1
0
def cocode(i, gc_ref):
    syn0 = 0
    if gc_ref:
        gc_list = gc(gc_ref)
        if len(gc_list): syn0 = gc_list[0]
    c = Cocode(i)
    return c.syndrome_list(syn0)
Пример #2
0
def display_leech_vector(x):
    """Display a vector in the Leech lattice mod 2

    Here parameter ``x`` is a vector in the Leech lattice mod 2
    in Leech lattice encoding.
    """
    gcode = PLoop(x >> 12)
    bl = gcode.bit_list
    print("GCode:\n", bl)
    if len(bl) == 16:
        l = [x for x in range(24) if not x in bl]
        pos = bl[0]
    elif len(gcode):
        pos = bl[0]
    else:
        pos = 0
    cocode = Cocode(x) + gcode.theta()
    print("Cocode:", cocode.syndrome_list(pos))