All pastes #2097171 Raw Edit

Mine

public text v1 · immutable
#2097171 ·published 2011-12-29 08:38 UTC
rendered paste body

def mult(a,b):
    table=[[[0, 1],[1, 1],[2, 1],[3, 1]],
        [[1, 1],[0,-1],[3, 1],[2,-1]],
        [[2, 1],[3,-1],[0,-1],[1, 1]],
        [[3, 1],[2, 1],[1,-1],[1,-1]]]
    
    c=[0.,0.,0.,0.]
    
    for i in range(4):
        for j in range(4):
            c[table[i][j][0]]=c[table[i][j][0]]+a[i]*b[j]*c[table[i][j][1]]

    return c

print mult([0,1,0,0],[0,0,1,0])