update to PermutationGroups-0.4

This commit is contained in:
Marek Kaluba 2023-10-06 14:15:16 +02:00
parent 7791fbdc42
commit 759d4c9ed7
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
6 changed files with 24 additions and 10 deletions

View File

@ -9,6 +9,7 @@ IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
IntervalMatrices = "5c1f47dc-42dd-5697-8aaa-4d102d140ba9" IntervalMatrices = "5c1f47dc-42dd-5697-8aaa-4d102d140ba9"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572" JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
PermutationGroups = "8bc5a954-2dfc-11e9-10e6-cd969bffa420"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca" ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
@ -20,8 +21,9 @@ Groups = "0.7"
IntervalArithmetic = "0.20" IntervalArithmetic = "0.20"
IntervalMatrices = "0.8" IntervalMatrices = "0.8"
JuMP = "1.3" JuMP = "1.3"
PermutationGroups = "0.4"
ProgressMeter = "1.7" ProgressMeter = "1.7"
SCS = "1.1" SCS = "1.3"
StaticArrays = "1" StaticArrays = "1"
SymbolicWedderburn = "0.3.4" SymbolicWedderburn = "0.3.4"
julia = "1.6" julia = "1.6"

View File

@ -23,7 +23,7 @@ end
function Base.:^( function Base.:^(
w::W, w::W,
p::PermutationGroups.AbstractPerm, p::PermutationGroups.AbstractPermutation,
) where {W<:Groups.AbstractWord} ) where {W<:Groups.AbstractWord}
return W([l^p for l in w]) return W([l^p for l in w])
end end

View File

@ -2,7 +2,7 @@
function _conj( function _conj(
t::Groups.Transvection, t::Groups.Transvection,
σ::PermutationGroups.AbstractPerm, σ::PermutationGroups.AbstractPermutation,
) )
return Groups.Transvection(t.id, t.i^inv(σ), t.j^inv(σ), t.inv) return Groups.Transvection(t.id, t.i^inv(σ), t.j^inv(σ), t.inv)
end end

View File

@ -2,7 +2,7 @@
function _conj( function _conj(
t::MatrixGroups.ElementaryMatrix{N}, t::MatrixGroups.ElementaryMatrix{N},
σ::PermutationGroups.AbstractPerm, σ::PermutationGroups.AbstractPermutation,
) where {N} ) where {N}
return MatrixGroups.ElementaryMatrix{N}(t.i^inv(σ), t.j^inv(σ), t.val) return MatrixGroups.ElementaryMatrix{N}(t.i^inv(σ), t.j^inv(σ), t.val)
end end

View File

@ -2,7 +2,7 @@
function _conj( function _conj(
s::MatrixGroups.ElementarySymplectic{N,T}, s::MatrixGroups.ElementarySymplectic{N,T},
σ::PermutationGroups.AbstractPerm, σ::PermutationGroups.AbstractPermutation,
) where {N,T} ) where {N,T}
@assert iseven(N) @assert iseven(N)
@assert PermutationGroups.degree(σ) == N ÷ 2 "Got degree = $(PermutationGroups.degree(σ)); N = $N" @assert PermutationGroups.degree(σ) == N ÷ 2 "Got degree = $(PermutationGroups.degree(σ)); N = $N"

View File

@ -1,18 +1,30 @@
import SymbolicWedderburn.PermutationGroups.AbstractPerm import PermutationGroups.AbstractPermutation
# move to Groups # move to Groups
Base.keys(a::Alphabet) = keys(1:length(a)) Base.keys(a::Alphabet) = keys(1:length(a))
## the old 1812.03456 definitions ## the old 1812.03456 definitions
isopposite(σ::AbstractPerm, τ::AbstractPerm, i=1, j=2) = function isopposite(
i^σ i^τ && i^σ j^τ && j^σ i^τ && j^σ j^τ σ::AbstractPermutation,
τ::AbstractPermutation,
i = 1,
j = 2,
)
return i^σ i^τ && i^σ j^τ && j^σ i^τ && j^σ j^τ
end
isadjacent(σ::AbstractPerm, τ::AbstractPerm, i=1, j=2) = function isadjacent(
(i^σ == i^τ && j^σ j^τ) || # first equal, second differ σ::AbstractPermutation,
τ::AbstractPermutation,
i = 1,
j = 2,
)
return (i^σ == i^τ && j^σ j^τ) || # first equal, second differ
(j^σ == j^τ && i^σ i^τ) || # second equal, first differ (j^σ == j^τ && i^σ i^τ) || # second equal, first differ
(i^σ == j^τ && j^σ i^τ) || # first σ equal to second τ (i^σ == j^τ && j^σ i^τ) || # first σ equal to second τ
(j^σ == i^τ && i^σ j^τ) # second σ equal to first τ (j^σ == i^τ && i^σ j^τ) # second σ equal to first τ
end
function _ncycle(start, length, n=start + length - 1) function _ncycle(start, length, n=start + length - 1)
p = PermutationGroups.Perm(Int8(n)) p = PermutationGroups.Perm(Int8(n))