I am trying to wrap the vector class to add some extra cases, but I am having trouble doing so. This is the code I have:
def lower_triangular_entries(dim,x,y):
return upper_triangular_entries(dim,y,x)
def upper_triangular_entries(dim,x,y):
if y<=x:
return 1
else:
return 0
class OneParamSubgroup(vector):
#TO DO: define scalar multiplication
def __init__(self, data, type_A=False):
if type_A:
BasisChange=matrix(ZZ, len(data)-1, len(data)-1,
lambda x,y: lower_triangular(len(data)-1,x,y))
v=vector(data[0:len(data)-1])
v=tuple(BasisChange*v)
#data given in terms of basis T
else:
v=data
vector.__init__(self, v)
def __repr__(self):
return self