ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 15 Oct 2021 13:01:54 +0200How to find orthogonal subspace of a subspacehttps://ask.sagemath.org/question/59357/how-to-find-orthogonal-subspace-of-a-subspace/I have written a code:
> n=4
V = VectorSpace(GF(2),n)
C=[[0,0,1,0], [1,1,1,0]]
U = V.subspace(C)
How to find orthogonal subspace of U? Thu, 14 Oct 2021 20:52:10 +0200https://ask.sagemath.org/question/59357/how-to-find-orthogonal-subspace-of-a-subspace/Answer by philipp7 for <p>I have written a code:</p>
<blockquote>
<p>n=4 <br>
V = VectorSpace(GF(2),n)
C=[[0,0,1,0], [1,1,1,0]] <br>
U = V.subspace(C)</p>
</blockquote>
<p>How to find orthogonal subspace of U? </p>
https://ask.sagemath.org/question/59357/how-to-find-orthogonal-subspace-of-a-subspace/?answer=59364#post-id-59364You can use the method `complement`. In your case:
sage: U_perp = U.complement()
sage: U_perp
Vector space of degree 4 and dimension 2 over Finite Field of size 2
Basis matrix:
[1 1 0 0]
[0 0 0 1]
We can easily check that this is indeed the orthogonal complement:
sage: [ b*c for b in U_perp.basis() for c in U.basis() ]
[0, 0, 0, 0]
Fri, 15 Oct 2021 13:01:54 +0200https://ask.sagemath.org/question/59357/how-to-find-orthogonal-subspace-of-a-subspace/?answer=59364#post-id-59364