(ctx, n, i)
return [ctx.zero]*(i-1) + [ctx.one] + [ctx.zero]*(n-i)
Return the i-th n-dimensional unit vector.
Return the i-th n-dimensional unit vector.
Return the i - th n - dimensional unit vector .
def unitvector(ctx, n, i):
        """
        Return the i-th n-dimensional unit vector.
        """
        assert 0 < i <= n, 'this unit vector does not exist'
        return [ctx.zero]*(i-1) + [ctx.one] + [ctx.zero]*(n-i)
def unitvector ( ctx , n , i ) : assert 0 < i <= n , 'this unit vector does not exist' return [ ctx . zero ] * ( i - 1 ) + [ ctx . one ] + [ ctx . zero ] * ( n - i )