Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
1

basis of subspace of complex field

asked 6 years ago

BrentBaccala gravatar image

Hi -

Given a set of elements of CC, or perhaps QQbar, I want to compute a basis for a subspace over QQ that contains those elements.

For example, given 3, 1+5, i, and i1, I'd expect my output to be {1,5,i}, since my original four elements can be written as (3,0,0), (1,1,0), (0,0,1), and (1,0,1) with respect to that basis.

Obviously, the basis won't be unique.

Can anybody suggest what tools in Sage might be useful for this calculation?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 6 years ago

rburing gravatar image

updated 6 years ago

Here is one way:

sage: K, elts, hom = number_field_elements_from_algebraics([3, 1+sqrt(5), I, I-1], minimal=True)
sage: K.defining_polynomial()
y^4 + 3*y^2 + 1
sage: K.power_basis()
[1, a, a^2, a^3]
sage: map(vector, elts)
[(3, 0, 0, 0), (4, 0, 2, 0), (0, -2, 0, -1), (-1, -2, 0, -1)]
sage: A = matrix(QQ, map(vector, elts))
sage: A.image().basis()
[
(1, 0, 0, 0),
(0, 1, 0, 1/2),
(0, 0, 1, 0)
]
sage: mybasis = map(K, A.image().basis()); mybasis
[1, 1/2*a^3 + a, a^2]
sage: map(lambda z: hom(z).radical_expression(), mybasis)
[1, -1/2*I, 1/2*sqrt(5) - 3/2]
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 6 years ago

Seen: 704 times

Last updated: Feb 04 '19