-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix casing in show(::PBWAlgebra)
and friends
#4315
Merged
lgoettgens
merged 4 commits into
oscar-system:master
from
lgoettgens:lg/show-PBWAlgebra
Nov 15, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,16 +33,20 @@ export PBWAlgQuo, PBWAlgQuoElem | |
|
||
|
||
###### @attributes ### DID NOT WORK -- alternative solution found (via has_special_impl, see ExteriorAlgebra.jl) | ||
mutable struct PBWAlgQuo{T, S} <: NCRing | ||
@attributes mutable struct PBWAlgQuo{T, S} <: NCRing | ||
I::PBWAlgIdeal{0, T, S} | ||
sring::Singular.PluralRing{S} # For ExtAlg this is the Singular impl; o/w same as I.basering.sring | ||
|
||
function PBWAlgQuo(I::PBWAlgIdeal{0, T, S}, sring::Singular.PluralRing{S}) where {T, S} | ||
return new{T, S}(I, sring) | ||
end | ||
end | ||
|
||
|
||
# For backward compatibility: ctor with 1 arg: | ||
# uses "default" arith impl -- namely that from basering! | ||
function PBWAlgQuo(I::PBWAlgIdeal{0, T, S}) where {T, S} | ||
return PBWAlgQuo{T, S}(I, I.basering.sring) | ||
return PBWAlgQuo(I, I.basering.sring) | ||
end | ||
|
||
|
||
|
@@ -93,27 +97,12 @@ end | |
|
||
@enable_all_show_via_expressify PBWAlgQuoElem | ||
|
||
function expressify(Q::PBWAlgQuo; context = nothing) # what about new sring data-field ??? | ||
## special printing if Q is an exterior algebra | ||
###### if get_attribute(Q, :is_exterior_algebra) === :true | ||
if has_special_impl(Q) | ||
a = Q.I.basering | ||
x = symbols(a) | ||
n = length(x) | ||
return Expr(:sequence, Expr(:text, "Exterior algebra over "), | ||
expressify(coefficient_ring(a); context=context), | ||
Expr(:text, " in ("), | ||
Expr(:series, x...), | ||
Expr(:text, ")")) | ||
|
||
end | ||
# General case (not exterior algebra) | ||
return Expr(:call, :/, expressify(Q.I.basering; context = nothing), | ||
expressify(Q.I; context = nothing)) | ||
function Base.show(io::IO, Q::PBWAlgQuo) | ||
@show_name(io, Q) | ||
@show_special(io, Q) | ||
print(io, "(", base_ring(Q), ")/", modulus(Q)) | ||
end | ||
|
||
@enable_all_show_via_expressify PBWAlgQuo | ||
|
||
#### | ||
|
||
function number_of_generators(Q::PBWAlgQuo) | ||
|
@@ -216,20 +205,20 @@ julia> L = [-x*y, -x*z, -y*z]; | |
julia> REL = strictly_upper_triangular_matrix(L); | ||
|
||
julia> A, (x, y, z) = pbw_algebra(R, REL, deglex(gens(R))) | ||
(PBW-algebra over Rational field in x, y, z with relations y*x = -x*y, z*x = -x*z, z*y = -y*z, PBWAlgElem{QQFieldElem, Singular.n_Q}[x, y, z]) | ||
(PBW-algebra over rational field in x, y, z with relations y*x = -x*y, z*x = -x*z, z*y = -y*z, PBWAlgElem{QQFieldElem, Singular.n_Q}[x, y, z]) | ||
|
||
julia> I = two_sided_ideal(A, [x^2, y^2, z^2]) | ||
two_sided_ideal(x^2, y^2, z^2) | ||
|
||
julia> Q, q = quo(A, I); | ||
|
||
julia> Q | ||
(PBW-algebra over Rational field in x, y, z with relations y*x = -x*y, z*x = -x*z, z*y = -y*z)/two_sided_ideal(x^2, y^2, z^2) | ||
(PBW-algebra over rational field in x, y, z with relations y*x = -x*y, z*x = -x*z, z*y = -y*z)/two_sided_ideal(x^2, y^2, z^2) | ||
|
||
julia> q | ||
Map defined by a julia-function with inverse | ||
from pBW-algebra over Rational field in x, y, z with relations y*x = -x*y, z*x = -x*z, z*y = -y*z | ||
to (PBW-algebra over Rational field in x, y, z with relations y*x = -x*y, z*x = -x*z, z*y = -y*z)/two_sided_ideal(x^2, y^2, z^2) | ||
from PBW-algebra over rational field in x, y, z with relations y*x = -x*y, z*x = -x*z, z*y = -y*z | ||
to (PBW-algebra over rational field in x, y, z with relations y*x = -x*y, z*x = -x*z, z*y = -y*z)/two_sided_ideal(x^2, y^2, z^2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these two lines show all fixes to the casing in one place |
||
``` | ||
|
||
!!! note | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Orthogonal to this PR (and not a change request for it): it really also should be
Weyl algebra
andPBW algebra
(without the-
)