You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>include("Monoids.jl")
julia>using.Monoids
julia>functionexample_monoid(n::Integer)
A =Alphabet([[Symbol('a', i) for i in1:n]; [Symbol('b', i) for i in1:n]])
F =FreeMonoid(A)
rels =let S =gens(F)
squares = [g^2=>one(g) for g in S]
@views a, b = S[1:n], S[n+1:end]
aibj = [a[i]*b[j] => b[j]*a[i] for i in1:n for j in1:n]
[squares; aibj]
endreturn F/rels
end
example_monoid (generic function with 1 method)
julia> M =example_monoid(2)
monoid with 8 relations over Alphabet{Symbol}[:a1, :a2, :b1, :b2]
julia> a, b =M(rand(1:4, 20)), M(rand(1:4, 20))
(a1*a2*a1*a2*b1*b2*b1*b2*b1*b2, a2*a1*a2*a1*a2*b2*b1*b2)
julia> a*b
a2*b1*b2*b1
julia> b*a
a2*a1*a2*a1*a2*a1*a2*a1*a2*b2*b1*b2*b1*b2*b1*b2*b1*b2
julia> x =M(rand(1:4, 20)); isreduced(x)
false
julia> y =deepcopy(x); normalform!(y); isreduced(y)
true
julia> x === y
false
julia> x == y
true
The text was updated successfully, but these errors were encountered:
See:
https://gist.github.com/kalmarek/9475f36e768046cd7ef7fc08891bf553
The text was updated successfully, but these errors were encountered: