I want to create Hemming Matrix. I have just built Galois field like multiplicative group. That's what I got:
MultiplicativeGroup = DeleteDuplicates[
NestList[
PolynomialMod[
PolynomialMod[(generating*#), irreducablePolynomial], 2] &, 1,
n]];
{1, a, a^2, 1 + a^2, 1 + a + a^2, 1 + a, a + a^2}
After that I converted it into binary form which look like this one:
CoefficientList[MultiplicativeGroup, a]
{{1}, {0, 1}, {0, 0, 1}, {1, 0, 1}, {1, 1, 1}, {1, 1}, {0, 1, 1}} But I stuck with converting it into binary matrix form. It's have to look like this one:
(0 0 1 1 1 0 1
0 1 0 0 1 1 1
1 0 0 1 1 1 0)
But I actually don't know how to do it. I can't transpose it or do anything else. Could you help me?
You can use this: [None] * 10 . But this won't be "fixed size" you can still append, remove ... This is how lists are made. You could make it a tuple ( tuple([None] * 10) ) to fix its width, but again, you won't be able to change it (not in all cases, only if the items stored are mutable).
Although Python lists are not fixed-size and constrained like arrays in C++ or Java, they are still array type data structures where the items contained are stored in memory sequentially and accessed by an index number representing the memory block for a specific element. A list object can contain duplicate elements.
array = {{1}, {0, 1}, {0, 0, 1}, {1, 0, 1}, {1, 1, 1}, {1, 1}, {0, 1, 1}}
PadLeft[#, 3] & /@ Reverse[array, 2] // Transpose
I did it in this way:
generating = a^Mod[(2^m - 1)/n, m];
MultiplicativeGroup = DeleteDuplicates@
NestList[
PolynomialMod[
PolynomialMod[(generating*#), irreducablePolynomial], 2] &, 1,
n];
Print[MatrixForm[Reverse[Transpose[CoefficientList[MG, a, m]]]]];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With