Opened 5 years ago

Closed 4 years ago

Endless symbolic computation

Reported by: Owned by: Irene Pasquinelli major sage-8.4 symbolics days93, days94 Ralf Stephan, Vincent Delecroix Irene Pasquinelli Ralf Stephan, Travis Scrimshaw N/A 4d0c51e 4d0c51eab2f477499b6f7c64b5e7d179f8063cf2 #24838

I tried calculating

```a=e^(I*pi/4)+1
b=1-e^(I*pi/4)
a*b

```

and both expressions a*b and a/b don't stop computing.

I tried both on sage-8.1 for Windows and on sage-8.2.beta6 on Ubuntu (native Ubuntu desktop on Windows10).

comment:1 Changed 5 years ago by Vincent Delecroix

Could you add your architecture/sage version in the ticket description? I can confirm the behavior on archlinux with compiled sage-8.2.beta6.

comment:2 Changed 5 years ago by Vincent Delecroix

Alternative computation that terminates:

```UCF = UniversalCyclotomicField()
a = UCF.zeta(8) + 1
b = 1 - UCF.zeta(8)
a * b
```

comment:3 Changed 5 years ago by Irene Pasquinelli

Description: modified (diff)

comment:4 Changed 5 years ago by Simon Drewitz

I can confirm it on archlinux with compiled sage-8.2.beta6, sage-8.2.beta5 and sage-8.1. However, with the sagemath 8.1-11 from the archlinux community repository it does work.

```sage: a = 1 + e^(I*pi/4)
sage: b = 1 - e^(I*pi/4)
sage: a*b
1/4*((I + 1)*sqrt(2) - 2)*(-(I + 1)*sqrt(2) - 2)
sage: a/b
-1/2*(-(I + 1)*sqrt(2) - 2)/(-(1/2*I + 1/2)*sqrt(2) + 1)

```

comment:5 Changed 5 years ago by Ralf Stephan

Confirmed in beta6. The loop is in Pynac. Thanks for the report.

comment:6 follow-up:  7 Changed 5 years ago by Ralf Stephan

Actually there were changes in pynac-0.7.17 that appear to have fixed it. With #24838:

```sage:  sage: a = 1 + e^(I*pi/4)
....:  sage: b = 1 - e^(I*pi/4)
....:  sage: a*b
....:
1/4*((I + 1)*sqrt(2) - 2)*(-(I + 1)*sqrt(2) - 2)
```

We might doctest this in this ticket, though.

comment:7 in reply to:  6 Changed 5 years ago by Vincent Delecroix

Actually there were changes in pynac-0.7.17 that appear to have fixed it. With #24838:

Cool

We might doctest this in this ticket, though.

+1

comment:8 Changed 5 years ago by Vincent Delecroix

Authors: → Irene Pasquinelli

Ralf, Irene is working on this ticket (she is learning how to develop). We will have a branch in a minute. Thanks for pointing #24838.

comment:9 Changed 5 years ago by Irene Pasquinelli

Branch: → u/ipasquinelli/24883 → efe5f145b805b60d72a12eaf9c57a5109e0c786a new → needs_review

New commits:

 ​e470685 `version / chkum / rm patch` ​d3511ce `24838: doctest fixes` ​efe5f14 `24883: adding doctest for symbolic`

comment:10 Changed 5 years ago by Irene Pasquinelli

Dependencies: → #24838

comment:11 Changed 5 years ago by Ralf Stephan

Reviewers: → Ralf Stephan

I think this is fine, but we may have to wait for setting positive until #24838 gets positive.

comment:12 Changed 4 years ago by Ralf Stephan

Branch: u/ipasquinelli/24883 → public/24883

comment:13 Changed 4 years ago by Ralf Stephan

Commit: efe5f145b805b60d72a12eaf9c57a5109e0c786a → 699c0a2215c0b2472a70170b89947d28021deb05

Okay, the dependency #24838 is now in the develop branch. Your branch no longer merges because there were further changes in the dependency. Instead of merging them I created a fresh branch with only your commit (using `git cherry-pick`).

New commits:

 ​699c0a2 `24883: adding doctest for symbolic`

comment:14 Changed 4 years ago by Travis Scrimshaw

Keywords: days94 added sage-8.2 → sage-8.3 Ralf Stephan → Ralf Stephan, Travis Scrimshaw needs_review → positive_review

LGTM.

comment:15 Changed 4 years ago by Volker Braun

Status: positive_review → needs_work

see patchbot

comment:16 Changed 4 years ago by Travis Scrimshaw

Problem actually comes from an earlier doctest:

```sage: e = x+1 <= x-2
```

(I tested this by copy/pasting the doctest). So we probably need to use `exp`.

comment:17 Changed 4 years ago by git

Commit: 699c0a2215c0b2472a70170b89947d28021deb05 → cb24f9a42dbddb869f40479b513e21c52d1200ae

Branch pushed to git repo; I updated commit sha1. New commits:

 ​cb24f9a `24883: improve usage of ambigous symbol in doctest`

comment:18 Changed 4 years ago by Ralf Stephan

Status: needs_work → needs_review

comment:19 Changed 4 years ago by Vincent Delecroix

Milestone: sage-8.3 → sage-8.4

update milestone 8.3 -> 8.4

comment:20 Changed 4 years ago by Travis Scrimshaw

Status: needs_review → positive_review

comment:21 follow-up:  22 Changed 4 years ago by git

Commit: cb24f9a42dbddb869f40479b513e21c52d1200ae → 4d0c51eab2f477499b6f7c64b5e7d179f8063cf2 positive_review → needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

 ​4d0c51e `Merge with sage-8.3`

comment:22 in reply to:  21 Changed 4 years ago by Bryan Gin-ge Chen

Status: needs_review → positive_review

 ​4d0c51e `Merge with sage-8.3`