here are some alternatives:
sage: %timeit vector([1. for i in range(1000)])
100 loops, best of 3: 3.14 ms per loop
sage: %timeit ones_matrix(RDF, 1000, 1)
125 loops, best of 3: 4.36 ms per loop
sage: %%time
....: v = zero_vector(RDF, 1000)
....: for i in range(1000):
....: v[i] = 1
....:
CPU times: user 2.39 ms, sys: 759 us, total: 3.15 ms
Wall time: 4.5 ms
just a list:
sage: %timeit [1. for i in range(1000)]
100 loops, best of 3: 2 ms per loop
with NumPy:
sage: import numpy as np
sage: %timeit np.ones(1000)
The slowest run took 9.23 times longer than the fastest. This could mean that an intermediate result is being cached.
100000 loops, best of 3: 3.9 us per loop