This is in context with the inbuilt berlekamp_massey function in SAGEMATH.
While computing the minimal polynomial of the sequences using the Berlekamp Massey function, I have felt that the Berlekamp Massey function in Sagemath is so designed that it requires the periodic sequence to be repeated twice for correct results.
Considering the problem of computing the linear complexity of the periodic string $$s = 110010100001110$$
The Berlekamp Massey function with concatenated input $$input = s+s$$ yields the correct result.
Code: berlekamp_massey([GF(2)(1), 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0])
Why does doubling the sequence is required for computing the correct minimal polynomial in SAGEMATH. The original algorithm doesn't say anything like this though. Is this something related to why this function accepts input with even length, is this the way the module in sagemath is defined?
Note: Sometimes for a sequence s = $(s_0, s_1,......, s_{N-1})$, the minimal polynomial for the cases considering the sequence $s$ and the sequence $s+s$ are different and in some cases it is same. So, in the case when it is different should we take the minimal polynomial for the doubly repeated sequence because it agrees with Hankel matrix considerations?
Note: I have done many more examples over the past few days and then I am presenting this argument. Thanks for the help.