-
Notifications
You must be signed in to change notification settings - Fork 112
/
PBWAlgebraQuo.jl
48 lines (42 loc) · 1.44 KB
/
PBWAlgebraQuo.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@testset "PBWAlgebraQuo.constructor" begin
r, (x, y, z) = QQ["x", "y", "z"]
R, (x, y, z) = pbw_algebra(r, [0 x*y x*z; 0 0 y*z + 1; 0 0 0], deglex(r))
Q, M = quo(R, two_sided_ideal(R, [x]))
(X, Y, Z) = gens(Q)
@test elem_type(Q) == PBWAlgQuoElem{QQFieldElem, Singular.n_Q}
@test parent_type(X) == PBWAlgQuo{QQFieldElem, Singular.n_Q}
@test coefficient_ring(R) == QQ
@test coefficient_ring(X) == QQ
@test base_ring(Q) == R
@test base_ring(X) == R
@test gens(Q) == [X, Y, Z]
@test ngens(Q) == 3
@test gen(Q, 2) == M(y)
@test Q[2] == M(y)
end
@testset "PBWAlgebraQuo.printing" begin
r, (x, y, z) = QQ["x", "y", "z"]
R, (x, y, z) = pbw_algebra(r, [0 x*y x*z; 0 0 y*z + 1; 0 0 0], deglex(r))
Q, M = quo(R, two_sided_ideal(R, [x]))
@test length(string(Q)) > 2
@test length(string(M(x) + M(y))) > 2
@test string(one(R)) == "1"
end
function test_elem(Q::PBWAlgQuo{QQFieldElem})
R = base_ring(Q)
return Q(R(rand(base_ring(R), 1:4, 1:4, 1:4)))
end
@testset "PBWAlgebraQuo.conformance" begin
r, (a, h, f, e) = QQ["a", "h", "f", "e"]
rel = @pbw_relations(e*f == f*e-h, e*h == h*e+2*e, f*h == h*f-2*f)
R, (a, h, f, e) = pbw_algebra(r, rel, invlex(r))
Q, _ = quo(R, two_sided_ideal(R, [h]))
test_NCRing_interface(Q; reps = 1)
end
@testset "PBWAlgebraQuo.conversion" begin
# [2023-12-21] Used to have incorrect parent object
E,_ = exterior_algebra(QQ,3)
@test E() == E(0)
three = QQFieldElem(3)
@test E(three) == E(3)
end