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

vectors over CDF allow a coercion from scalars #5646

Closed
ncalexan mannequin opened this issue Mar 30, 2009 · 8 comments
Closed

vectors over CDF allow a coercion from scalars #5646

ncalexan mannequin opened this issue Mar 30, 2009 · 8 comments

Comments

@ncalexan
Copy link
Mannequin

ncalexan mannequin commented Mar 30, 2009

These are incompatible and I claim the first one is wrong!

sage: (CDF^2)(1)
(1.0, 1.0)
sage: (CC^2)(1)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/ncalexan/sage-3.4.1.alpha0-sage.math-only-x86_64-Linux/devel/sage/sage/functions/riemann_theta.py in <module>()

/home/ncalexan/sage-3.4.1.alpha0-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/modules/free_module.pyc in __ca\
ll__(self, e, coerce, copy, check)
   4394         except AttributeError:
   4395             pass
-> 4396         return FreeModule_generic_field.__call__(self,e)
   4397
   4398 ###############################################################################

/home/ncalexan/sage-3.4.1.alpha0-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/modules/free_module.pyc in __ca\
ll__(self, x, coerce, copy, check)
    813             except ArithmeticError:
    814                 raise ValueError, "element (= %s) is not in free module"%(x,)
--> 815         return self._element_class(self, x, coerce, copy)
    816
    817     def is_submodule(self, other):

/home/ncalexan/sage-3.4.1.alpha0-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/sage/modules/free_module_element.so \
in sage.modules.free_module_element.FreeModuleElement_generic_dense.__init__ (sage/modules/free_module_element.c:15739)()

TypeError: entries (=1) must be a list

CC: @robertwb @orlitzky

Component: linear algebra

Keywords: complex vector coercion

Author: William Stein

Reviewer: Johan Bosman

Merged: sage-5.0.beta11

Issue created by migration from https://trac.sagemath.org/ticket/5646

@ncalexan ncalexan mannequin added this to the sage-5.0 milestone Mar 30, 2009
@ncalexan ncalexan mannequin assigned williamstein Mar 30, 2009
@robertwb
Copy link
Contributor

comment:1

I second that the first one is wrong, but this is not a coercion issue.

sage: (CDF^2).has_coerce_map_from(CDF)
False

@williamstein
Copy link
Contributor

Attachment: trac_5646.patch.gz

@orlitzky
Copy link
Contributor

orlitzky commented Jan 9, 2012

comment:2

(I think this was left 'new' by mistake)

Why is an exception made for zero? Is it just convenience? We have (CDF^2).zero() which does the same thing as far as I can tell.

@orlitzky
Copy link
Contributor

orlitzky commented Jan 9, 2012

Author: William Stein

@sagetrac-johanbosman
Copy link
Mannequin

sagetrac-johanbosman mannequin commented Mar 18, 2012

comment:3

Every vector space has a zero element, which is denoted by 0. There are generally no elements in a vector space denoted by 1.

@sagetrac-johanbosman
Copy link
Mannequin

sagetrac-johanbosman mannequin commented Mar 18, 2012

Reviewer: Johan Bosman

@jdemeyer
Copy link

Attachment: trac_5646_rebased.patch.gz

@jdemeyer
Copy link

Merged: sage-5.0.beta11

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

No branches or pull requests

4 participants