Ask Your Question

Revision history [back]

Use the base_ring method.

Here is an example.

Define a field.

sage: K = GF(7)
sage: K
Finite Field of size 7

A matrix over this field.

sage: M = random_matrix(K, 2, 2)

The matrix's base ring:

sage: KK = M.base_ring()
sage: KK
Finite Field of size 7

Check that it is the same as your original field.

sage: K is KK