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*l2)/2,(-2*l1*l2+2)/2,(-l1*l2*d2-d2)/2,(l1*d2-l2*d2)/2,(-l1*l2*a2-l1*l2*a1+a2+a1)/2,(-l1*a2-l1*a1-l2*a2-l2*a1)/2],[0,0,0,0,0,0,0,0,(-2*l1*l2-2)/2,(2*l1-2*l2)/2,0,0,(-l1*a2+l1*a1+l2*a2-l2*a1)/2,(-l1*l2*a2+l1*l2*a1-a2+a1)/2,(-l1*d2-l2*d2)/2,(l1*l2*d2-d2)/2],[0,0,0,0,(-l1*l2+1)/2,(-l1-l2)/2,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,(l1-l2)/2,(l1*l2+1)/2,0,0,0,0,(-l1*l2+1)/2,(-l1-l2)/2,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,(l1-l2)/2,(l1*l2+1)/2]]")
print "Bug in subst (there should be no l1 or l2 in the matrix):"
print Tv2.subst("[ll,l2]","[1,1]")
Edit: using Tv2.subst("[l1=1,l2=1]") does work but that is rather awkward.
Edit2: I think I'm going mad. I can reproduce this sometimes and sometimes not. This is bizzare. I'll let you know if I can always reproduce this.
Jose