diff --git a/experimental/LieAlgebras/src/AbstractLieAlgebra.jl b/experimental/LieAlgebras/src/AbstractLieAlgebra.jl index 59b4aab244d1..4ba40124658b 100644 --- a/experimental/LieAlgebras/src/AbstractLieAlgebra.jl +++ b/experimental/LieAlgebras/src/AbstractLieAlgebra.jl @@ -246,7 +246,7 @@ function lie_algebra( basis::Vector{AbstractLieAlgebraElem{C}}; check::Bool=true ) where {C<:RingElement} parent_L = parent(basis[1]) - @req all(parent(x) == parent_L for x in basis) "Elements not compatible." + @req all(parent(x) === parent_L for x in basis) "Elements not compatible." R = coefficient_ring(parent_L) basis_matrix = if length(basis) == 0 matrix(R, 0, dim(L), C[]) diff --git a/experimental/LieAlgebras/src/LieAlgebra.jl b/experimental/LieAlgebras/src/LieAlgebra.jl index 3a4db2086fa3..25f80678db9a 100644 --- a/experimental/LieAlgebras/src/LieAlgebra.jl +++ b/experimental/LieAlgebras/src/LieAlgebra.jl @@ -200,7 +200,7 @@ end Return `x`. Fails if `x` is not an element of `L`. """ function (L::LieAlgebra{C})(x::LieAlgebraElem{C}) where {C<:RingElement} - @req L == parent(x) "Incompatible modules." + @req L === parent(x) "Incompatible modules." return x end @@ -313,7 +313,7 @@ end Return the centralizer of `xs` in `L`, i.e. $\{y \in L \mid [x, y] = 0 \forall x \in xs\}$. """ function centralizer(L::LieAlgebra, xs::AbstractVector{<:LieAlgebraElem}) - @req all(x -> parent(x) == L, xs) "Incompatible Lie algebras." + @req all(x -> parent(x) === L, xs) "Incompatible Lie algebras." mat = zero_matrix(coefficient_ring(L), dim(L), dim(L) * length(xs)) for (i, bi) in enumerate(basis(L)) diff --git a/experimental/LieAlgebras/src/LieAlgebraIdeal.jl b/experimental/LieAlgebras/src/LieAlgebraIdeal.jl index da531f502482..8f0ab52dbfa2 100644 --- a/experimental/LieAlgebras/src/LieAlgebraIdeal.jl +++ b/experimental/LieAlgebras/src/LieAlgebraIdeal.jl @@ -203,7 +203,7 @@ Return the normalizer of `I` in `L`, i.e. $\{x \in L \mid [x, I] \subseteq I\} = As `I` is an ideal in `L`, this is just `L`. """ function normalizer(L::LieAlgebra, I::LieAlgebraIdeal) - @req base_lie_algebra(I) == L "Incompatible Lie algebras." + @req base_lie_algebra(I) === L "Incompatible Lie algebras." return sub(L) end diff --git a/experimental/LieAlgebras/src/LieAlgebraModule.jl b/experimental/LieAlgebras/src/LieAlgebraModule.jl index 27fd6639810b..3e5e2dd9201e 100644 --- a/experimental/LieAlgebras/src/LieAlgebraModule.jl +++ b/experimental/LieAlgebras/src/LieAlgebraModule.jl @@ -329,10 +329,10 @@ Return `v`. Fails, in general, if `v` is not an element of `V`. If `V` is the dual module of the parent of `v`, return the dual of `v`. """ function (V::LieAlgebraModule{C})(v::LieAlgebraModuleElem{C}) where {C<:RingElement} - if is_dual(V) && base_module(V) == parent(v) + if is_dual(V) && base_module(V) === parent(v) return V(coefficients(v)) end - @req V == parent(v) "Incompatible modules." + @req V === parent(v) "Incompatible modules." return v end @@ -352,7 +352,7 @@ function (V::LieAlgebraModule{C})( ) where {T<:LieAlgebraModuleElem{C}} where {C<:RingElement} if is_direct_sum(V) || is_tensor_product(V) @req length(a) == length(base_modules(V)) "Length of vector does not match." - @req all(i -> parent(a[i]) == base_modules(V)[i], 1:length(a)) "Incompatible modules." + @req all(i -> parent(a[i]) === base_modules(V)[i], 1:length(a)) "Incompatible modules." if is_direct_sum(V) return V(vcat([coefficients(x) for x in a]...)) elseif is_tensor_product(V) @@ -364,7 +364,7 @@ function (V::LieAlgebraModule{C})( end elseif is_exterior_power(V) || is_symmetric_power(V) || is_tensor_power(V) @req length(a) == get_attribute(V, :power) "Length of vector does not match power." - @req all(x -> parent(x) == base_module(V), a) "Incompatible modules." + @req all(x -> parent(x) === base_module(V), a) "Incompatible modules." mat = zero_matrix(coefficient_ring(V), 1, dim(V)) if is_exterior_power(V) for (i, _inds) in enumerate(get_attribute(V, :ind_map)), @@ -492,7 +492,7 @@ function Base.:*(x::LieAlgebraElem{C}, v::LieAlgebraModuleElem{C}) where {C<:Rin end function action(x::LieAlgebraElem{C}, v::LieAlgebraModuleElem{C}) where {C<:RingElement} - @req parent(x) == base_lie_algebra(parent(v)) "Incompatible Lie algebras." + @req parent(x) === base_lie_algebra(parent(v)) "Incompatible Lie algebras." cx = coefficients(x) V = parent(v) @@ -733,7 +733,7 @@ function direct_sum( V::LieAlgebraModule{C}, Vs::LieAlgebraModule{C}... ) where {C<:RingElement} L = base_lie_algebra(V) - @req all(x -> base_lie_algebra(x) == L, Vs) "All modules must have the same base Lie algebra." + @req all(x -> base_lie_algebra(x) === L, Vs) "All modules must have the same base Lie algebra." dim_direct_sum_V = dim(V) + sum(dim, Vs; init=0) transformation_matrices = map(1:dim(L)) do i @@ -769,7 +769,7 @@ function tensor_product( V::LieAlgebraModule{C}, Vs::LieAlgebraModule{C}... ) where {C<:RingElement} L = base_lie_algebra(V) - @req all(x -> base_lie_algebra(x) == L, Vs) "All modules must have the same base Lie algebra." + @req all(x -> base_lie_algebra(x) === L, Vs) "All modules must have the same base Lie algebra." dim_tensor_product_V = dim(V) * prod(dim, Vs; init=1) ind_map = collect(reverse.(ProductIterator([1:dim(Vi) for Vi in reverse([V, Vs...])]))) diff --git a/experimental/LieAlgebras/src/LieSubalgebra.jl b/experimental/LieAlgebras/src/LieSubalgebra.jl index 3310ac565cd1..cc31839492ab 100644 --- a/experimental/LieAlgebras/src/LieSubalgebra.jl +++ b/experimental/LieAlgebras/src/LieSubalgebra.jl @@ -194,7 +194,7 @@ end Return the normalizer of `S` in `L`, i.e. $\{x \in L \mid [x, S] \subseteq S\}$. """ function normalizer(L::LieAlgebra, S::LieSubalgebra) - @req base_lie_algebra(S) == L "Incompatible Lie algebras." + @req base_lie_algebra(S) === L "Incompatible Lie algebras." mat = zero_matrix(coefficient_ring(L), dim(L) + dim(S)^2, dim(L) * dim(S)) for (i, bi) in enumerate(basis(L)) diff --git a/experimental/LieAlgebras/src/LinearLieAlgebra.jl b/experimental/LieAlgebras/src/LinearLieAlgebra.jl index 3cc290430f0c..91820b0814ab 100644 --- a/experimental/LieAlgebras/src/LinearLieAlgebra.jl +++ b/experimental/LieAlgebras/src/LinearLieAlgebra.jl @@ -213,7 +213,7 @@ function lie_algebra( basis::Vector{LinearLieAlgebraElem{C}}; check::Bool=true ) where {C<:RingElement} parent_L = parent(basis[1]) - @req all(parent(x) == parent_L for x in basis) "Elements not compatible." + @req all(parent(x) === parent_L for x in basis) "Elements not compatible." R = coefficient_ring(parent_L) n = parent_L.n s = map(AbstractAlgebra.obj_to_string, basis) diff --git a/experimental/LieAlgebras/test/iso_gap_oscar-test.jl b/experimental/LieAlgebras/test/iso_gap_oscar-test.jl index 309ba3d86645..2c0ccd46e6f6 100644 --- a/experimental/LieAlgebras/test/iso_gap_oscar-test.jl +++ b/experimental/LieAlgebras/test/iso_gap_oscar-test.jl @@ -2,7 +2,7 @@ import Oscar: GAPWrap function test_iso_gap_oscar(LG, oscarT; num_random_tests::Int=10) iso = Oscar.iso_gap_oscar(LG) - @test domain(iso) == LG + @test domain(iso) === LG LO = codomain(iso) @test LO isa oscarT diff --git a/experimental/LieAlgebras/test/iso_oscar_gap-test.jl b/experimental/LieAlgebras/test/iso_oscar_gap-test.jl index 644cca1d411c..31f9789b3648 100644 --- a/experimental/LieAlgebras/test/iso_oscar_gap-test.jl +++ b/experimental/LieAlgebras/test/iso_oscar_gap-test.jl @@ -2,7 +2,7 @@ import Oscar: GAPWrap function test_iso_oscar_gap(LO::LieAlgebra; num_random_tests::Int=10) iso = Oscar.iso_oscar_gap(LO) - @test domain(iso) == LO + @test domain(iso) === LO LG = codomain(iso) @test GAPWrap.IsLieAlgebra(LG) # @test codomain(Oscar.iso_gap_oscar(LG)) === LO