Ask Your Question
0

Attempt:Orthogonal projection of C3 onto image of linear operator [closed]

asked 0 years ago

kerP gravatar image

updated 0 years ago

I want to compute the orthogonal projection of C3 onto the image of T(x,y,z)=(xiy+iz,ixz,2y). I know that im(T)=span(1,i,0),(i,0,2). Sor far i have:

#Base estandar de C^3, denotada B
e1 = vector([1, 0, 0])
e2 = vector([0, 1, 0])
e3 = vector([0, 0, 1])
#Base de im(T)
b1=vector([1,i,0])
b2=vector([-i,0,2])

#Aplicar Gram-Schmidt a b1=u1 y b2 para obtener base ortogonal
u2 = b2 - (b2.dot_product(b1.conjugate()) / b1.dot_product(b1.conjugate())) * b1

# Simplificar el vector u2
u2_clean = vector([SR(entry).simplify() for entry in u2])
# Mostrar base ortogonal de im(T)
print("Vectores u1 y u2 de la base ortogonal:")
show(b1,u2_clean)

#Calcular las normas de b1=u1 y de u2
n_u1= sqrt(b1.dot_product(b1.conjugate()))
n_u2=sqrt(u2_clean.dot_product(u2_clean.conjugate()))

#Construir y mostrar los vectores w1 y w2 de la base ortonormal
w1 = b1/n_u1
w2 = u2_clean/n_u2
print("Vectores w1 y w2 de la base ortonormal:")
show(w1,w2)

#Definir vector simbólico arbitrario
a,b,c=var("a,b,c")
v = vector([a,b,c])

#Calcular la proyección ortogonal de C^3 sobre im(T)
P_imT = (v.dot_product(w1.conjugate()))*w1 + (v.dot_product(w2.conjugate()))*w2
print("P(a,b,c)=")
show(P_imT)

# Evaluar la proyección en la base estándar
P_e1 = P_imT.subs({a: 1, b: 0, c: 0})
P_e2 = P_imT.subs({a: 0, b: 1, c: 0})
P_e3 = P_imT.subs({a: 0, b: 0, c: 1})
# Mostrar los resultados de P(ei)
print("Proyección de e1: ", P_e1)
print("Proyección de e2: ", P_e2)
print("Proyección de e3: ", P_e3)

#Evaluar P(T(ei))
P_Te1 = P_imT.subs({a: 1, b: i, c: 0})
P_Te2 = P_imT.subs({a: -i, b: 0, c: 2})
P_Te3 = P_imT.subs({a: i,b: -1, c: 0})
print("Evaluando P(T(e1)), P(T(e2)), P(T(e3)):")
show(P_Te1,P_Te2,P_Te3)

#Construir matriz [P]_B a partir de P(ei)
P_B = Matrix([[5/9,
-4/9*I, -2/9*I],[4/9*I, 5/9, 2/9],[2/9*I, -2/9, 8/9]])
print("[P]_B=")
show(P_B)

#verificar que la base ortogonal y ortonormal de verdad sean ortogonales.
show(b1.dot_product(u2_clean.conjugate()))
show(w1.dot_product(w2.conjugate()))

My concerns here are the I don't know if the formula for P(a,b,c) I found is correct, and subsequently, why the "projection" matrix [P]_B is not idempotent to begin with. I deleted the line in which i computed ([P]_B)^2 but it was not idempotent, so clearly it cannot be an orthogonal projection if it's not a projection to begin with. What did I do wrong here?

Note: I know there might be built-in functions to compute the norm or to apply Gram-Schmidt, but I would really like to do this without recurring to those options. Also, the vectors w1 and w2 of the orthonormal basis are indeed orthogonal to each other, so I have know idea where it went wrong.

Preview: (hide)

Closed for the following reason the question is answered, right answer was accepted by Max Alekseyev
close date 2024-12-16 15:43:27.043757

1 Answer

Sort by » oldest newest most voted
1

answered 0 years ago

kerP gravatar image

updated 0 years ago

I asked this very same question on Math Stack Exchange and someone else pointed out my very silly mistake: When constructing the matrix P_B I omitted a minus sign for the last entry of the second row. The correct matrix is P_B = Matrix([[5/9, -4/9*I, -2/9*I],[4/9*I, 5/9, -2/9],[2/9*I, -2/9, 8/9]]), which is both idempotent and self-adjoint, i.e. represents an orthogonal projection with respect to the standard basis of C3.

Preview: (hide)
link

Comments

A link to the other question, in case it's useful to anyone: https://math.stackexchange.com/q/5011...

John Palmieri gravatar imageJohn Palmieri ( 0 years ago )

Question Tools

1 follower

Stats

Asked: 0 years ago

Seen: 113 times

Last updated: Dec 16 '24