Feature #7
Automatic mapping between (some) rings
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
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
- Related to Design #1414: Make class RingElemVector? added
#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 inP
are made available as ringelems inP
(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)
#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)
DenseMat:
myRowMul
,myColMul
,myAddRowMul
,myAddColMul
FieldIdeal
-- needs vector of RingElem in same ringideal.C
many, some need vector of RingElem in same ringMatrix.C
forSetEntry
, alsoIamEqual
MatrixSpecial.C
forJacobianMat
which needs vector of RingElem in same ringMatrixView
many cases, some need vector of RingElem in same ringPolyFamilies
for DicksonPolyring.C
foroperator+=
and so onRingElemOps-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.