Opened 11 years ago

Closed 9 years ago

# Sparse and dense polynomials hash differently, but are equal.

Reported by: Owned by: robertwb jason major sage-duplicate/invalid/wontfix misc Christian Nassau N/A

### Description

```sage: R = PolynomialRing(ZZ, 'x', sparse=False)
sage: S = PolynomialRing(ZZ, 'x', sparse=True)
sage: R
Univariate Polynomial Ring in x over Integer Ring
sage: S
Sparse Univariate Polynomial Ring in x over Integer Ring
sage: R == S
True
sage: hash(R) == hash(S)
False
```

It's unclear what equality really means here...

### comment:1 Changed 9 years ago by tscrim

• Milestone set to sage-duplicate/invalid/wontfix
• Status changed from new to needs_review

In `5.5.rc0`, I get the following:

```sage: R = PolynomialRing(ZZ, 'x', sparse=False)
sage: S = PolynomialRing(ZZ, 'x', sparse=True)
sage: R
Univariate Polynomial Ring in x over Integer Ring
sage: S
Sparse Univariate Polynomial Ring in x over Integer Ring
sage: R == S
False
sage: hash(R) == hash(S) # on a 32-bit VM
True
```

However this isn't a problem.

### comment:2 Changed 9 years ago by cnassau

• Reviewers set to cnassau
• Status changed from needs_review to positive_review

I've checked that, indeed, already Sage 5.4.1 gives this answer (different objects, same hash). And I would love to give a ticket a positive review (my first), so here we go...

### comment:3 Changed 9 years ago by jdemeyer

• Resolution set to worksforme
• Reviewers changed from cnassau to Christian Nassau
• Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.