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

Cartesian Product method for Sets #13435

Open
sagetrac-chrisjamesberg mannequin opened this issue Sep 6, 2012 · 3 comments
Open

Cartesian Product method for Sets #13435

sagetrac-chrisjamesberg mannequin opened this issue Sep 6, 2012 · 3 comments

Comments

@sagetrac-chrisjamesberg
Copy link
Mannequin

sagetrac-chrisjamesberg mannequin commented Sep 6, 2012

Right now, Sets has a method CartesianProduct (not to be confused with cartesian_product). The documentation says that this is the class for implementing cartesian_product. Does this belong as a method in the global namespace for sets? I can't think why the user would want this method to come up, when all it says is to use cartesian_product instead.

For instance:

S = Set([1,2])
S.CartesianProduct(S)
Traceback (click to the left of this block for traceback)
...
TypeError: __init__() takes at least 3 arguments (2 given)

Component: algebra

Keywords: Cartesian Product for sets

Author: Chris Berg

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

@sagetrac-chrisjamesberg sagetrac-chrisjamesberg mannequin added this to the sage-5.11 milestone Sep 6, 2012
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mjungmath
Copy link

comment:6

This does not reflect the current behavior as of Sage 9.2. The method CartesianProduct seems to be the "categorical version" now.

@fchapoton
Copy link
Contributor

comment:7

I get the same traceback in 9.3.b6.

The question is: why does the class CartesianProduct appear as a method of any Set object ?

@mjungmath
Copy link

comment:8

I get a slightly different traceback (Sage 9.2 stable):

sage: S = Set([1,2])
sage: S.CartesianProduct(S)
 Traceback (most recent call last)
...
TypeError: __init__() missing 1 required positional argument: 'category'

Thus,

sage: S = Set([1,2])
sage: S.CartesianProduct(S, category=Sets())
The Cartesian product of (1, 2)

works perfectly.

Alternatively, one could try to meet the category of both objects by default?

@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
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

5 participants