Skip to content
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

Start revising printing of modules #3199

Closed

Conversation

fingolfin
Copy link
Member

First steps towards resolving #2891 which is important for the book.
The code changes are all in the first commit, the second commit just contains the changed produced by:

julia> using Revise, Oscar, Documenter ; Oscar.build_doc(; doctest=:fix, open_browser=false)

I started this back in October, and just rebased it (as promised on Wednesday, sorry for the delay), and regenerated the docs.

This is definitely not the final version, it has clear issues, but at least it is start. So, what to do with this, some options:

  1. discard it and you do your own (but soon)
  2. someone adopts it and pushes changes to this PR
  3. someone adopts it and opens their own PR (we close this)
  4. just merge this (perhaps with some tweaks) and build upon it in a new PR

Any is fine by me, it's not as if there is much in it.

@fingolfin fingolfin added this to the 1.0-book milestone Jan 19, 2024
by Submodule with 1 generator
1 -> x^4*e[1]
to subquotient of Submodule with 1 generator
1 -> e[1]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should use Indent() ?

Suggested change
1 -> e[1]
1 -> e[1]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't do that right now because it runs into a bug in pretty printing, see Nemocas/AbstractAlgebra.jl#1561

Graded free module R^3([0]) of rank 3 over R
Graded free module Graded multivariate polynomial ring^3([0]) of rank 3 over graded multivariate polynomial ring
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will be objected to by @jankoboehm and @wdecker and should be fixed. Probably it has to do with switches from compact to supercompact somewhere? Probably only the old method's signature (of the one which was looking up the rings to fish out their names) has to be adjusted.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I explained this elsewhere. The origin of the issues is that @show_name macro from AA only checks for compact; this is its code:

macro show_name(io, O)
  return :( begin
    local i = $(esc(io))
    local o = $(esc(O))
    s = get_attribute(o, :name)
    if s === nothing
      sy = find_name(o)
      if sy === nothing
        sy = extra_name(o)
      end
      if sy !== nothing
        s = string(sy)
        set_name!(o, s)
      end
    end
    if get(i, :compact, false) && s !== nothing
      if AbstractAlgebra.PrettyPrinting._supports_io_custom(i)
        print(i, LowercaseOff())
      end
      print(i, s)
      return
    end
  end )
end

One option would be to set both compact and supercompact.

@thofma @fieker should @show_name be changed to also check supercompact? (or perhaps even instead of compact?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now I made it set both compact and supercompact, but this will be the last change I'll make to this PR, from here on the algebraic geometry group should take over, as outlined in the description of this PR.

src/Modules/ModulesGraded.jl Outdated Show resolved Hide resolved
@@ -49,23 +49,23 @@ julia> U = complement_of_prime_ideal(P);
julia> RL, _ = localization(R, U);

julia> FRL = free_module(RL, 2, "f")
Free module of rank 2 over Localization of multivariate polynomial ring in 3 variables over QQ at complement of prime ideal(x, y, z)
Free module of rank 2 over localized ring
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe localized polynomial ring would be better, given that we also spell out multivariate polynomial ring? But I have no strong opinion on that .

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but that's beyond the scope of this PR, the show method for AbsLocalizedRing would have to be adjusted.

Comment on lines -116 to +118
Map with following data
Domain:
=======
Free module of rank 3 over Multivariate polynomial ring in 3 variables over QQ
Codomain:
=========
Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ
Module homomorphism
from free module of rank 3 over multivariate polynomial ring
to free module of rank 2 over multivariate polynomial ring
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks much better now in my opinion.

src/Modules/UngradedModules/FreeModuleHom.jl Show resolved Hide resolved
src/Modules/UngradedModules/FreeModuleHom.jl Outdated Show resolved Hide resolved
@jankoboehm
Copy link
Contributor

Thanks a lot for making it available, will make a suggestion based on it, and then we can discuss whether it does the job.

@fingolfin fingolfin force-pushed the mh/show-UngradedModules branch 3 times, most recently from c125e9b to b01cdde Compare January 23, 2024 00:47
Copy link

codecov bot commented Jan 23, 2024

Codecov Report

Merging #3199 (5ddece9) into master (910cd54) will decrease coverage by 0.02%.
The diff coverage is 83.33%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3199      +/-   ##
==========================================
- Coverage   81.65%   81.64%   -0.02%     
==========================================
  Files         546      546              
  Lines       73102    73099       -3     
==========================================
- Hits        59692    59682      -10     
- Misses      13410    13417       +7     
Files Coverage Δ
experimental/Schemes/CoherentSheaves.jl 77.84% <ø> (ø)
src/Modules/ModuleTypes.jl 78.34% <ø> (ø)
src/Modules/ModulesGraded.jl 81.66% <100.00%> (+0.01%) ⬆️
src/Modules/UngradedModules/FreeModElem.jl 96.84% <ø> (ø)
src/Modules/UngradedModules/FreeResolutions.jl 88.57% <100.00%> (ø)
src/Modules/UngradedModules/Hom_and_ext.jl 98.33% <ø> (ø)
src/Modules/UngradedModules/HomologicalAlgebra.jl 90.85% <ø> (ø)
src/Modules/UngradedModules/Methods.jl 85.30% <ø> (ø)
src/Modules/UngradedModules/Presentation.jl 96.29% <ø> (ø)
...c/Modules/UngradedModules/SubModuleOfFreeModule.jl 71.35% <100.00%> (ø)
... and 8 more

@lgoettgens lgoettgens closed this Jan 27, 2024
@lgoettgens lgoettgens reopened this Jan 27, 2024
@fingolfin fingolfin force-pushed the mh/show-UngradedModules branch from b01cdde to 5ddece9 Compare January 28, 2024 00:56
@fingolfin
Copy link
Member Author

This has a ton of conflicts now, and has been basically ignored for months, so it seems it is best if someone else starts from scratch with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants