This is covered in the documentation on relative number fields.

Bottom up construction:

```
sage: K.<i> = QuadraticField(-1)
sage: R.<x> = PolynomialRing(K)
sage: L_over_K.<a> = K.extension(x^2 - 2)
sage: V,from_V,to_V = L_over_K.relative_vector_space()
sage: V.base_field() == K
True
sage: V.dimension()
2
sage: W,from_W,to_W = L_over_K.absolute_vector_space()
sage: W.base_field() == QQ
True
sage: W.dimension()
4
```

Top down construction:

```
sage: L.<i,a> = NumberField([x^2 + 1, x^2 - 2])
sage: L_over_K.<ii,aa> = L.relativize(i)
sage: K = L_over_K.base_field()
sage: V,from_V,to_V = L_over_K.relative_vector_space()
sage: V.base_field() == K
True
sage: V.dimension()
2
sage: W,from_W,to_W = L_over_K.absolute_vector_space()
sage: W.base_field() == QQ
True
sage: W.dimension()
4
```