From 759d4c9ed70d6a7c9410d759e8d2735f53e64e9d Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Fri, 6 Oct 2023 14:15:16 +0200 Subject: [PATCH] update to PermutationGroups-0.4 --- Project.toml | 4 +++- src/actions/actions.jl | 2 +- src/actions/autfn_conjugation.jl | 2 +- src/actions/sln_conjugation.jl | 2 +- src/actions/spn_conjugation.jl | 2 +- src/sqadjop.jl | 22 +++++++++++++++++----- 6 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Project.toml b/Project.toml index a10b399..6de2aa9 100644 --- a/Project.toml +++ b/Project.toml @@ -9,6 +9,7 @@ IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253" IntervalMatrices = "5c1f47dc-42dd-5697-8aaa-4d102d140ba9" JuMP = "4076af6c-e467-56ae-b986-b466b2749572" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +PermutationGroups = "8bc5a954-2dfc-11e9-10e6-cd969bffa420" ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" @@ -20,8 +21,9 @@ Groups = "0.7" IntervalArithmetic = "0.20" IntervalMatrices = "0.8" JuMP = "1.3" +PermutationGroups = "0.4" ProgressMeter = "1.7" -SCS = "1.1" +SCS = "1.3" StaticArrays = "1" SymbolicWedderburn = "0.3.4" julia = "1.6" diff --git a/src/actions/actions.jl b/src/actions/actions.jl index 8205e8b..75b7653 100644 --- a/src/actions/actions.jl +++ b/src/actions/actions.jl @@ -23,7 +23,7 @@ end function Base.:^( w::W, - p::PermutationGroups.AbstractPerm, + p::PermutationGroups.AbstractPermutation, ) where {W<:Groups.AbstractWord} return W([l^p for l in w]) end diff --git a/src/actions/autfn_conjugation.jl b/src/actions/autfn_conjugation.jl index 99559d5..d75791e 100644 --- a/src/actions/autfn_conjugation.jl +++ b/src/actions/autfn_conjugation.jl @@ -2,7 +2,7 @@ function _conj( t::Groups.Transvection, - σ::PermutationGroups.AbstractPerm, + σ::PermutationGroups.AbstractPermutation, ) return Groups.Transvection(t.id, t.i^inv(σ), t.j^inv(σ), t.inv) end diff --git a/src/actions/sln_conjugation.jl b/src/actions/sln_conjugation.jl index bdb016f..7f69cbe 100644 --- a/src/actions/sln_conjugation.jl +++ b/src/actions/sln_conjugation.jl @@ -2,7 +2,7 @@ function _conj( t::MatrixGroups.ElementaryMatrix{N}, - σ::PermutationGroups.AbstractPerm, + σ::PermutationGroups.AbstractPermutation, ) where {N} return MatrixGroups.ElementaryMatrix{N}(t.i^inv(σ), t.j^inv(σ), t.val) end diff --git a/src/actions/spn_conjugation.jl b/src/actions/spn_conjugation.jl index ec760e9..da23ca9 100644 --- a/src/actions/spn_conjugation.jl +++ b/src/actions/spn_conjugation.jl @@ -2,7 +2,7 @@ function _conj( s::MatrixGroups.ElementarySymplectic{N,T}, - σ::PermutationGroups.AbstractPerm, + σ::PermutationGroups.AbstractPermutation, ) where {N,T} @assert iseven(N) @assert PermutationGroups.degree(σ) == N ÷ 2 "Got degree = $(PermutationGroups.degree(σ)); N = $N" diff --git a/src/sqadjop.jl b/src/sqadjop.jl index 9df0a06..9465395 100644 --- a/src/sqadjop.jl +++ b/src/sqadjop.jl @@ -1,18 +1,30 @@ -import SymbolicWedderburn.PermutationGroups.AbstractPerm +import PermutationGroups.AbstractPermutation # move to Groups Base.keys(a::Alphabet) = keys(1:length(a)) ## the old 1812.03456 definitions -isopposite(σ::AbstractPerm, τ::AbstractPerm, i=1, j=2) = - i^σ ≠ i^τ && i^σ ≠ j^τ && j^σ ≠ i^τ && j^σ ≠ j^τ +function isopposite( + σ::AbstractPermutation, + τ::AbstractPermutation, + i = 1, + j = 2, +) + return i^σ ≠ i^τ && i^σ ≠ j^τ && j^σ ≠ i^τ && j^σ ≠ j^τ +end -isadjacent(σ::AbstractPerm, τ::AbstractPerm, i=1, j=2) = - (i^σ == i^τ && j^σ ≠ j^τ) || # first equal, second differ +function isadjacent( + σ::AbstractPermutation, + τ::AbstractPermutation, + i = 1, + j = 2, +) + return (i^σ == i^τ && j^σ ≠ j^τ) || # first equal, second differ (j^σ == j^τ && i^σ ≠ i^τ) || # second equal, first differ (i^σ == j^τ && j^σ ≠ i^τ) || # first σ equal to second τ (j^σ == i^τ && i^σ ≠ j^τ) # second σ equal to first τ +end function _ncycle(start, length, n=start + length - 1) p = PermutationGroups.Perm(Int8(n))