sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.43k stars 479 forks source link

Add tree_size method to symbolic expressions #32144

Open slel opened 3 years ago

slel commented 3 years ago

The complexity of a symbolic expression can be measured by the size of its expression tree.

We add a tree_size method to symbolic expressions to count the nodes of the expression tree.

Requested at

In Maple and Mathematica this is called "leaf count", although it counts tree nodes, rather than only leaves.

Other measures of complexity of a symbolic expression:

CC: @slel

Component: symbolics

Keywords: expression, size, tree

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

dkrenn commented 3 years ago
comment:2

+1 for adding this