Project

General

Profile

Feature #7

Automatic mapping between (some) rings

Added by Anna Maria Bigatti over 12 years ago. Updated about 1 year ago.

Status:
Resolved
Priority:
High
Category:
Parser/Interpreter
Target version:
Start date:
20 Oct 2011
Due date:
% Done:

80%

Estimated time:
Spent time:

Description

There are a few obvious cases, i.e. those for which there is a "single step" homomorphism, for example:
RingZ --> R
RingQ --> R
R --> R/I
R --> R[x,y,z]

AMB 2012 added matrix(R, M) to CoCoA-5 for automatic mapping
AMB 2013 added RingElem(R, a) to CoCoA-5 for automatic mapping
AMB 2014 added ReadExpr(R, "...") to CoCoA-5 for reading an explicit expression


Related issues

Related to CoCoALib - Feature #223: Automatic mapping of RingElemsClosed2012-08-08

Related to CoCoALib - Feature #151: Iterated CanonicalHomNew2012-05-03

Related to CoCoA-5 - Bug #100: BringIn should map only the indets in its argNew2012-03-07

Related to CoCoA-5 - Bug #132: BringIn should allow reduction modulo pClosed2012-04-17

Related to CoCoA-5 - Feature #309: (Multi)BlockMatrixClosed2013-02-13

Related to CoCoA-5 - Design #483: Unique copies of rings in CoCoA-5New2014-03-19

Related to CoCoALib - Feature #209: ReadExpr: input polynomials in CoCoALibClosed2012-07-24

Related to CoCoA-5 - Design #634: Symbol in the coeff ringRejected2014-10-22

Related to CoCoA-5 - Design #635: Automatic mapping of RingElem (in operation with a compound value)Closed2014-10-22

Related to CoCoA-5 - Design #636: Distinguish indets from symbols in coeffring in Use commandRejected2014-10-23

Related to CoCoA-5 - Design #637: Undesirable consequence of automatic mapping of RingElems?Closed2014-10-23

Related to CoCoALib - Feature #645: Automatic mapping of RingElem: user selectable at run-time (GlobalManager?)Rejected2014-11-04

Related to CoCoALib - Feature #1132: Canonical homomorphism for (some) polynomial rings?New2017-11-30

Related to CoCoALib - Feature #738: Extend homomorphism to polynomial ringIn Progress2015-06-25

Related to CoCoALib - Design #1085: Fns with "OUT" args: should they give ERR::MixedRings?Closed2017-06-30

Related to CoCoA-5 - Feature #1461: Automatic mapping for multiplication?Closed2020-06-10

Related to CoCoALib - Design #1414: Make class RingElemVector?In Progress2020-02-12

Related to CoCoA-5 - Design #1493: Automatic ring mapping in assignment?Closed2020-09-28

Related to CoCoALib - Design #1515: Indets in coeffring are ringelems in coeffring?Rejected2020-10-22

History

#1 Updated by John Abbott over 12 years ago

JAA thinks that a good design approach would be to produce a function which takes as args two rings, and returns a RingHom (and not a partial ring hom) which must be applied to map elements of the "simpler" ring into the other ring. The domain and codomain of the ringhom will indicate which value(s) is/are to be mapped.

JAA is not sure what the function should do if no automatic mapping is supported between the two rings. There are two obvious alternatives: throw an exception, or return a boolean (in addition to the RingHom).

JAA is not sure what the function should do if the two rings supplied are equal -- it could return the identity RingHom or it could give an error. At the moment giving an error seems the better option.

#2 Updated by Anna Maria Bigatti over 12 years ago

  • Category set to Parser/Interpreter

#3 Updated by John Abbott about 12 years ago

Probably the simplest definition is simply that R1 is "simpler" than R2 if the construction of R2 passed explicitly via that of R1.

For instance this means that R is always regarded as being simpler than the quotient R/I.

#4 Updated by Anna Maria Bigatti almost 12 years ago

Proposal for new "constructors": R ring, A matrix, x ringelem (or powerproduct or ...), ... and what else?

Mat(R, A), RingElem(R, x)
checks if object is mappable into R and returns its image in R: equivalent to

phi := CanonicalHom(RingOf(object), R);
apply(phi, object)

Automatic ring in operations is in general very difficult to detect.
Making these new constructors available might be a good and clean intermediate solution.

These "constructors" may be made available in CoCoALib too, but that implies including CanonicalHom.H in all .C files offering them.

#5 Updated by John Abbott almost 12 years ago

It would be handy to have a similar shortcut for homogeneous lists.
Also for ideals, but that raises the same question that came up for BringIn.

The doc for BringIn says that it works for ringelems and matrices, lists and vectors but not ideals.
The CoCoALib fn apply does not appear to be documented!

#6 Updated by John Abbott over 11 years ago

  • Status changed from New to In Progress
  • Assignee set to Anna Maria Bigatti
  • % Done changed from 0 to 10

#7 Updated by John Abbott over 11 years ago

Assignment of an integer (or rational) to a RingElem will automatically map into the ring.

However, we want to be cautious about extending this automatic mapping to other types of assignment, especially since assignment from a RingElem belonging to another ring does not perform automatic mapping.

#8 Updated by Anna Maria Bigatti about 11 years ago

  • Target version set to CoCoA-5.0.9

#9 Updated by John Abbott over 10 years ago

Renzo reminds us that this task is important!

#10 Updated by Anna Maria Bigatti about 10 years ago

  • Target version changed from CoCoA-5.0.9 to CoCoA-5.1.0 Easter14

#11 Updated by John Abbott about 10 years ago

  • Target version changed from CoCoA-5.1.0 Easter14 to CoCoA-5.1.1 Seoul14

#12 Updated by Anna Maria Bigatti over 9 years ago

  • Target version changed from CoCoA-5.1.1 Seoul14 to CoCoA-5.1.2 summer 2015
  • % Done changed from 10 to 30

#13 Updated by John Abbott almost 9 years ago

  • Target version changed from CoCoA-5.1.2 summer 2015 to CoCoA-5.1.3/4 Jan 2016

#14 Updated by John Abbott about 8 years ago

  • Target version changed from CoCoA-5.1.3/4 Jan 2016 to CoCoA-5.2.0 spring 2017

I am "bumping" this issue by 1 version of CoCoA-5. It is marked as "high" priority, but has not been worked on for 3-4 years (no doubt because it is tricky).

Whether we'll really be able to deal with it for the next version remains to be seen.

#15 Updated by John Abbott over 7 years ago

No chance of finishing this is in the near future; postponing by 1 version.

#16 Updated by John Abbott over 7 years ago

  • Target version changed from CoCoA-5.2.0 spring 2017 to CoCoA-5.2.2

#17 Updated by John Abbott over 6 years ago

  • Target version changed from CoCoA-5.2.2 to CoCoA-5.2.4

#18 Updated by John Abbott over 6 years ago

  • Related to Feature #1132: Canonical homomorphism for (some) polynomial rings? added

#19 Updated by John Abbott over 6 years ago

  • Related to Feature #738: Extend homomorphism to polynomial ring added

#20 Updated by John Abbott over 5 years ago

  • Target version changed from CoCoA-5.2.4 to CoCoA-5.3.0

#21 Updated by John Abbott over 4 years ago

  • Target version changed from CoCoA-5.3.0 to CoCoA-5.4.0

#22 Updated by John Abbott almost 4 years ago

  • Related to Design #1085: Fns with "OUT" args: should they give ERR::MixedRings? added

#23 Updated by John Abbott almost 4 years ago

  • % Done changed from 30 to 50

I have partly implemented this (in CoCoALib) after discussions wirh Anna (who is uncertain about some aspects).

#24 Updated by John Abbott almost 4 years ago

  • Related to Feature #1461: Automatic mapping for multiplication? added

#25 Updated by John Abbott almost 4 years ago

#26 Updated by John Abbott over 3 years ago

  • Related to Design #1493: Automatic ring mapping in assignment? added

#27 Updated by John Abbott over 3 years ago

  • Related to Design #1515: Indets in coeffring are ringelems in coeffring? added

#28 Updated by John Abbott over 3 years ago

  • % Done changed from 50 to 60

I have decided to make this the "master issue" for questions related to automatic ring conversion (mainly because it is the oldest).

Here is a summary of the main points:
  • after use P all symbols in P are made available as ringelems in P (even if the symbol lies in a subring) -- see #1515 (and #636)
  • no automatic mapping of RingElems for equality tests (throws MixedRings exception instead) -- see #637
  • fns with OUT params (of ringelem type) do not require that the ring of the OUT param be "correct": the right ring will be set by the call (the same way that assignment sets the right ring) -- see #1085 (and #1500 comment 10)
Automatic mapping applies only to single values
  • not to matrices (even if 1x1)
  • see issue #635
  • issue #1493 lets a single value be "promoted" when being assigned to matrix element; but the assignment cannot "promote" the matrix.

#29 Updated by John Abbott over 3 years ago

Here are done list and todo list copied from issue #1461 comments 7 & 8. Moving them here.

DONE LIST
  • MatrixOps.C
  • MatrixOps-KroneckerProd.C
  • module.C (mostly)
TODO LIST
  • DenseMat: myRowMul, myColMul, myAddRowMul, myAddColMul
  • FieldIdeal -- needs vector of RingElem in same ring
  • ideal.C many, some need vector of RingElem in same ring
  • Matrix.C for SetEntry, also IamEqual
  • MatrixSpecial.C for JacobianMat which needs vector of RingElem in same ring
  • MatrixView many cases, some need vector of RingElem in same ring
  • PolyFamilies for DicksonPoly
  • ring.C for operator+= and so on
  • RingElemOps-CoprimeFactorBasis needs vector RingElem from same ring.
  • SparsePolyOps-XXX many

#30 Updated by John Abbott about 2 years ago

  • Target version changed from CoCoA-5.4.0 to CoCoA-5.4.2

#31 Updated by John Abbott about 1 year ago

  • Status changed from In Progress to Resolved
  • % Done changed from 60 to 80

What is the status of this issue?
I thought it was almost finished.

Also available in: Atom PDF