If V is the vector space, then you can simply ask for the coordinate vector of v by using V.coordinate_vector(v). If you wish to use a different basis, then you can construct the subspace U spanned by the new basis (see this other question) and then use U.coordinate_vector(v).