Skip to content

Commit 6f932cc

Browse files
authored
Add vector_space_dim documentation (#2102)
1 parent 2b92e83 commit 6f932cc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/FreeModule.jl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,33 @@ function vector_space(R::Field, dim::Int; cached::Bool = true)
3434
Generic.FreeModule(R, dim; cached=cached)
3535
end
3636

37+
@doc raw"""
38+
vector_space_dim(M::FPModule)
39+
40+
Return the dimension of the given vector space.
41+
42+
# Examples
43+
```jldoctest
44+
julia> M = free_module(QQ, 2)
45+
Vector space of dimension 2 over rationals
46+
47+
julia> vector_space_dim(M)
48+
2
49+
50+
julia> m = M([1, 2])
51+
(1//1, 2//1)
52+
53+
julia> N, = sub(M, [m])
54+
(Subspace over rationals with 1 generator and no relations, Hom: N -> M)
55+
56+
julia> vector_space_dim(N)
57+
1
58+
59+
julia> Q, = quo(M, N)
60+
(Quotient space over rationals with 1 generator and no relations, Hom: M -> Q)
61+
62+
julia> vector_space_dim(Q)
63+
1
64+
```
65+
"""
3766
function vector_space_dim end

0 commit comments

Comments
 (0)