oscar-system / Oscar.jl

A comprehensive open source computer algebra system for computations in algebra, geometry, and number theory.
https://www.oscar-system.org
Other
358 stars 128 forks source link

Add `tensor_product` for polynomial rings and graded polynomial rings #2949

Open fingolfin opened 1 year ago

fingolfin commented 1 year ago

For geometric constructions (e.g. taking the direct product of two varieties) it would be quite handy to have a function which computes the tensor product of two (or possibly more) polynomial rings. I'd keep it simple:

We already have code in this vein. E.g. I just stumbled over this code from experimental/IntersectionTheory/src/Main.jl:

function *(X::AbstractVariety, Y::AbstractVariety)
  ...
  @assert X.base == Y.base
  base = X.base
  A, B = X.ring, Y.ring
  symsA, symsB = string.(gens(A)), string.(gens(B))
  a = length(symsA)
  R, x = graded_polynomial_ring(base, vcat(symsA, symsB), vcat(gradings(A), gradings(B)))
  # TODO: fails with check = true
  AtoR = hom(A, R, x[1:a], check = false)
  BtoR = hom(B, R, x[a+1:end], check = false)
  IA = ideal(A isa MPolyQuoRing ? AtoR.(A.(gens(A.I))) : [R()])
  IB = ideal(B isa MPolyQuoRing ? BtoR.(B.(gens(B.I))) : [R()])
  AXY, _ = quo(R, IA + IB)
  ...

There are proper other / better examples, I just stumbled over this. Note that it uses an internal helper function gradings which only really does the right thing for Z-graded groups; presumably this was done to simplify the code and avoid having to deal with products of grading groups (which I totally understand, but I think we can't avoid that in general)

afkafkafk13 commented 1 year ago

This is even a good example: The tensor product of k-algebras should be implemented on the algebra side and simply be called from the geometry side. The way it is now, I suppose that it is implemented at several places (whereever needed).

fingolfin commented 2 months ago

I still think this would be useful, but we need to assign someone to do it if we really want it... Do we want it?

fieker commented 1 week ago

@HechtiDerLachs and @jankoboehm and @wdecker and @hannes14 and @afkafkafk13 and ... will design a suggestion...