def double_decoding(decoder_1, decoder_2):
    ' Concatenates two decodings\n\n    Args:\n        decoder_1 (iterable): list of BinaryPolynomial\n            decoding of the outer code layer\n        decoder_2 (iterable): list of BinaryPolynomial\n            decoding of the inner code layer\n\n    Returns (list): list of BinaryPolynomial the decoding defined by\n        w -> decoder_1( decoder_2(w) )\n    '
    doubled_decoder = []
    for entry in decoder_1:
        tmp_sum = 0
        for summand in entry.terms:
            tmp_term = BinaryPolynomial('1')
            for factor in summand:
                if isinstance(factor, (numpy.int32, numpy.int64, int)):
                    tmp_term *= decoder_2[factor]
            tmp_sum = (tmp_term + tmp_sum)
        doubled_decoder += [tmp_sum]
    return doubled_decoder
Concatenates two decodings

Args:
    decoder_1 (iterable): list of BinaryPolynomial
        decoding of the outer code layer
    decoder_2 (iterable): list of BinaryPolynomial
        decoding of the inner code layer

Returns (list): list of BinaryPolynomial the decoding defined by
    w -> decoder_1( decoder_2(w) )
def double_decoding(decoder_1, decoder_2):
    ' Concatenates two decodings\n\n    Args:\n        decoder_1 (iterable): list of BinaryPolynomial\n            decoding of the outer code layer\n        decoder_2 (iterable): list of BinaryPolynomial\n            decoding of the inner code layer\n\n    Returns (list): list of BinaryPolynomial the decoding defined by\n        w -> decoder_1( decoder_2(w) )\n    '
    doubled_decoder = []
    for entry in decoder_1:
        tmp_sum = 0
        for summand in entry.terms:
            tmp_term = BinaryPolynomial('1')
            for factor in summand:
                if isinstance(factor, (numpy.int32, numpy.int64, int)):
                    tmp_term *= decoder_2[factor]
            tmp_sum = (tmp_term + tmp_sum)
        doubled_decoder += [tmp_sum]
    return doubled_decoder