Opened 7 years ago

Closed 7 years ago

# Order in symbolic ring: error calling operator

Reported by: Owned by: dkrenn major sage-6.10 symbolics Benjamin Hackl Ralf Stephan N/A 7a2e948 7a2e948bdb80c0292cf70fa2286e0c532e66cf13

### GitHub link to the corresponding issue

```sage: R.<r> = ZZ[[]]
sage: o = SR(r.O(2)).operands()[1]; o
Order(r^2)
sage: o.operator()
...
RuntimeError: cannot find SFunction in table
```

or

```x.Order().operator()
...
RuntimeError: cannot find SFunction in table
```

### comment:1 follow-up:  3 Changed 7 years ago by cheuberg

```sage: (x+x^2).series(x, 2).operator() is None
True
```

### comment:2 Changed 7 years ago by dkrenn

Description: modified (diff)

### comment:3 in reply to:  1 ; follow-up:  4 Changed 7 years ago by rws

```sage: (x+x^2).series(x, 2).operator() is None
True
```

The topmost operator in symbolic series `pseries` is not a registered function, but it can be seen in the expression tree:

```sage: (x+x^2).series(x, 2)._dbgprinttree()
pseries @0x4e2c3b0, hash=0x0, flags=0x3
1 (numeric) @0x35d70d0, hash=0x0, flags=0x7
1 (numeric) @0x35d70d0, hash=0x0, flags=0x7
-----
function Order @0x4c197f0, serial=12, hash=0x0, flags=0x3, nops=1
1 (numeric) @0x35d70d0, hash=0x0, flags=0x7
=====
2 (numeric) @0x35d7130, hash=0x0, flags=0x7
-----
x (symbol) @0x3e5d6d0, serial=5, hash=0xf4f4bfee, flags=0xf, domain=0, iflags=0000000000000000
0 (numeric) @0x3647180, hash=0x0, flags=0x7
```

You can see that the function `Order` is there too. `GiNaC::Order` is registered in Pynac and imported to Sage (`symbolic/ginac.pxd`). But it somehow doesn't get into Sage's registry `sfunction_serial_dict` which is created and used in `symbolic/function.pyx`.

### comment:4 in reply to:  3 Changed 7 years ago by behackl

Authors: → Benjamin Hackl → u/behackl/function/Order-registration → 7a2e948bdb80c0292cf70fa2286e0c532e66cf13 new → needs_review

But it somehow doesn't get into Sage's registry `sfunction_serial_dict` which is created and used in `symbolic/function.pyx`.

This was because `Order` was not registered. Should be fixed now.

New commits:

 ​84aa1e2 `register Order-function` ​318dd7b `add examples and tests` ​7a2e948 `add seealso-block`

### comment:5 Changed 7 years ago by rws

Reviewers: → Ralf Stephan

Passes tests in selected directories. As soon as a patchbot run passes this can be set positive.

### comment:6 Changed 7 years ago by rws

Status: needs_review → positive_review

### comment:7 Changed 7 years ago by vbraun

Branch: u/behackl/function/Order-registration → 7a2e948bdb80c0292cf70fa2286e0c532e66cf13 → fixed positive_review → closed
Note: See TracTickets for help on using tickets.