Implement a function to perform an efficient vector similarity search.
Use cosine similarity between a query vector and each candidate vector. Return the indices of the k most similar candidates in descending similarity order, breaking ties by ascending index. The function signature is def vector_similarity_search(query, vectors, k):; query is a nonzero numeric vector, vectors is a list of same-dimensional nonzero vectors, and the result is a list of indices.
def vector_similarity_search(query, vectors, k):