## Example of blow and prune

from PyECC import *

n = 7; r = 2
K = Zn(2)

# F = F8 = K[a]
[F,a] = extension(K,[1,0,1,1],'a','F')

R0 = [1,1,1,1,1,1,1]
R1 = [1,a,a**2,a**3,a**4,a**5,a**6]

H = matrix(F,[R0,R1])

show(H)
show(blow(H,K))
show(prune(blow(H,K)))
    
'''
This shows that the dimension of the code is 7-4 = 3.
Observe that the components of 1>>K with respect to the basis
{1,a,a^2}$ of F over K are [1,0,0], so that the matrix 
blow(H,K), whose type is 6x7, has two null rows
and consequently the effect of prune(blow(H,K)) is reduced
to eliminate these two rows.
'''