k=var('k')
a=matrix([[k,1],[4,k]])
a.det()
solve(a.det(),k)
a.pivots()
a=matrix([[1,1],[4,2]])
a.swap_rows(1,0)
a.pivots()