8000 Operands and Operator of symbolic expressions · Issue #10169 · sagemath/sage · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Operands and Operator of symbolic expressions #10169
Open
@simon-king-jena

Description

@simon-king-jena

I think that for all symbolic expression s should hold

sage: s == s.operator()(*s.operands())

That currently does not work, for two reasons.

  1. There may be no operator at all:
sage: print x.operator()
None
sage: x.operands()
[]

I believe there should instead be an identity operator.

  1. The list of operands may be longer than what the operator accepts:
sage: s = 0.001*x^2+0.01*x+0.1*sin(1.01*x)+1
sage: s.operands()
[0.00100000000000000*x^2, 0.0100000000000000*x,
0.100000000000000*sin(1.01000000000000*x), 1]
sage: s.operator()(*s.operands())
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)

/home/king/<ipython console> in <module>()

TypeError: op_add expected 2 arguments, got 4 

Compare this thread at sage-devel.

CC: @eviatarbach

Component: symbolics

Keywords: operator operands symbolics

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0