Skip to content

Commit

Permalink
More tests for op2
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeR227 committed Jun 28, 2024
1 parent c13c537 commit d8ef661
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/deca/deca_acset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,23 @@ CANON_NAMES = Dict{Symbol, Symbol}(
# Lie Derivative

:ℒ₀ => LIE_0,
:L₀ => LIE_0,

:ℒ₁ => LIE_1,
:L₁ => LIE_1,

:ℒ₂ => LIE_2,
:L₂ => LIE_2,

:ℒ => NOFORM_LIE,

# Inner Product

:ι₁ => INNERPROD_1,
:i₁ => INNERPROD_1,

:ι₂ => INNERPROD_2,
:i₂ => INNERPROD_2,

=> NOFORM_INNERPROD
)
Expand Down
114 changes: 113 additions & 1 deletion test/language.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@ end
let
d = setup_basecase(gen_d)
@test d[:type] == [:Form0, :Form0, :Form1, :Form1, :Form2, :Form0, :Form2, :Form1, :Form2, :Form1, :Form2]
@test d[:op2] == [:₀₀, :₀₁, :₁₀, :₁₁, :₀₂, :₂₀]
@test get_canon_name(d[:op2]) == [:wdg_00, :wdg_01, :wdg_10, :wdg_11, :wdg_02, :wdg_20]
end

let #Unicode, tagged
Expand Down Expand Up @@ -1366,6 +1366,118 @@ end
check_canonoverload_op2(gen_d, d)
end

# Wedge products
gen_d = @decapode begin
A::DualForm0
B::DualForm1
C::DualForm2
D::Form1

R0 == L(D, A)
R1 == L(D, B)
R2 == L(D, C)

R3 == i(D, B)
R4 == i(D, C)
end

let
d = setup_basecase(gen_d)
@test d[:type] == [:DualForm0, :DualForm1, :DualForm2, :Form1, :DualForm0, :DualForm1, :DualForm1, :DualForm0, :DualForm2]
@test d[:op2] == [:L₀, :L₁, :L₂, :i₁, :i₂]
end

let # Unicode special, tagged
d = @decapode begin
A::DualForm0
B::DualForm1
C::DualForm2
D::Form1

R0 == ℒ₀(D, A)
R1 == ℒ₁(D, B)
R2 == ℒ₂(D, C)

R3 == ι₁(D, B)
R4 == ι₂(D, C)
end
check_canontyping(gen_d, d)
check_canonoverload_op2(gen_d, d)
end

let # Unicode, not tagged
d = @decapode begin
A::DualForm0
B::DualForm1
C::DualForm2
D::Form1

R0 == (D, A)
R1 == (D, B)
R2 == (D, C)

R3 == ι(D, B)
R4 == ι(D, C)
end
check_canontyping(gen_d, d)
check_canonoverload_op2(gen_d, d)
end

let # Unicode, tagged
d = @decapode begin
A::DualForm0
B::DualForm1
C::DualForm2
D::Form1

R0 == L₀(D, A)
R1 == L₁(D, B)
R2 == L₂(D, C)

R3 == i₁(D, B)
R4 == i₂(D, C)
end
check_canontyping(gen_d, d)
check_canonoverload_op2(gen_d, d)
end

let # Ascii, tagged
d = @decapode begin
A::DualForm0
B::DualForm1
C::DualForm2
D::Form1

R0 == L_0(D, A)
R1 == L_1(D, B)
R2 == L_2(D, C)

R3 == i_1(D, B)
R4 == i_2(D, C)
end
check_canontyping(gen_d, d)
check_canonoverload_op2(gen_d, d)
end

let # Mixed
d = @decapode begin
A::DualForm0
B::DualForm1
C::DualForm2
D::Form1

R0 == (D, A)
R1 == L_1(D, B)
R2 == L₂(D, C)

R3 == i_1(D, B)
R4 == i₂(D, C)
end
check_canontyping(gen_d, d)
check_canonoverload_op2(gen_d, d)
end


end

@testset "Compilation Transformation" begin
Expand Down

0 comments on commit d8ef661

Please sign in to comment.