Ask Your Question

# Revision history [back]

My generating statistics differs, so i hope i understood the question well. Here is the quick code:

T1 = matrix( ZZ, 4, [ -1,0,0,0,  2, 1,0,0,  4,0, 1,0,  4, 0,0, 1 ] )
T2 = matrix( ZZ, 4, [  1,2,0,0,  0,-1,0,0,  0,4, 1,0,  0, 4,0, 1 ] )
T3 = matrix( ZZ, 4, [  1,0,1,0,  0, 1,1,0,  0,0,-1,0,  0, 0,0, 1 ] )
T4 = matrix( ZZ, 4, [  1,6,0,6,  0, 3,0,2,  0,4, 1,4,  0,-4,0,-3 ] )
T5 = matrix( ZZ, 4, [  3,0,0,2,  6, 1,0,6,  4,0, 1,4, -4, 0,0,-3 ] )

T_List = ( T1, T2, T3, T4, T5 )
v = vector( ZZ, 4, [ 1,0,0,0 ] )
v = v.column()

def ht( w ):
return max( [ abs(entry) for entry in w ] )

def fillList( T_List, vector_List, height ):
v_List = vector_List[:]    # and we will append
v_New  = vector_List[:]    # use them to generate new vectors, this is the "last wave"

count = 0    # give me some small control...
while v_New and count < 100 :
count += 1    # this will protect me against the usual programming errors
w_New = []    # and we will append, this is the "new wave"
for v in v_New:
for T in T_List:
w = T*v
if w not in v_List and ht(w) < height:
w_New.append( w )
v_List += w_New
L = len( w_New )
print "%s new entr%s added..." % ( L, 'y was' if L == 1 else 'ies were' )
v_New = w_New[:]

print "A list with %s vectors was generated in %s steps" % ( len( v_List ), count )
return v_List

for height in ( 20, 50, 500 ):
print 60*'-'
print "Generation for height %s" % height
v_List = fillList( T_List, [ v, ], height )


Results:

------------------------------------------------------------
Generation for height 20
2 new entries were added...
5 new entries were added...
2 new entries were added...
0 new entries were added...
A list with 10 vectors was generated in 4 steps
------------------------------------------------------------
Generation for height 50
2 new entries were added...
8 new entries were added...
16 new entries were added...
7 new entries were added...
2 new entries were added...
1 new entry was added...
0 new entries were added...
A list with 37 vectors was generated in 7 steps
------------------------------------------------------------
Generation for height 500
2 new entries were added...
8 new entries were added...
32 new entries were added...
116 new entries were added...
232 new entries were added...
183 new entries were added...
85 new entries were added...
42 new entries were added...
21 new entries were added...
15 new entries were added...
10 new entries were added...
6 new entries were added...
5 new entries were added...
5 new entries were added...
5 new entries were added...
2 new entries were added...
1 new entry was added...
1 new entry was added...
1 new entry was added...
1 new entry was added...
1 new entry was added...
0 new entries were added...
A list with 775 vectors was generated in 22 steps
sage:


As i said, possibly i am missing something... (Have to post and catch that train.)