Ticket #13556 (new defect)

Opened 8 months ago

Last modified 6 months ago

vector(RR, QQ) stalls

Reported by: eviatarbach Owned by: jason, was
Priority: major Milestone: sage-5.10
Component: linear algebra Keywords:
Cc: Work issues:
Report Upstream: N/A Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

The command vector(RR, QQ) never finishes executing.

Change History

comment:1 Changed 8 months ago by fwclarke

The reason this takes for ever is that Sage is trying to create the infinite vector

(0.000000000000000, 1.00000000000000, -1.00000000000000, 0.500000000000000, -0.500000000000000, 2.00000000000000, -2.00000000000000, 0.333333333333333, -0.333333333333333, 3.00000000000000, -3.00000000000000, 0.666666666666667, -0.666666666666667, 1.50000000000000, ... ) 

whose entries are an enumeration of the rationals. It's line 504 of sage/structure/sequence.py (sage-5.3):

            x = [universe(t) for t in x]

in which universe is RR and x is QQ, that's hanging.

An initial segment of this vector can created as

sage: vector(RR, QQ.range_by_height(3))
(0.000000000000000, 1.00000000000000, -1.00000000000000, 0.500000000000000, -0.500000000000000, 2.00000000000000, -2.00000000000000)

comment:2 Changed 6 months ago by tscrim

To the best of my knowledge, sage currently does not handle infinite sequences. So the following also run indefinitely

sage: list(QQ)
sage: tuple(QQ)
sage: Sequence((1..))
sage: Sequence(ZZ)
sage: Sequence(Partitons())

I've started a thread on sage-devel about how to proceed.

 https://groups.google.com/forum/?fromgroups=#!topic/sage-devel/Pl14P2mr8N8

Note: See TracTickets for help on using tickets.