Some measures of symbolic expression complexity. Each complexity measure is expected to take a symbolic expression as an argument, and return a number.
Returns the length of
exprafter converting it to a string.
expr– the expression whose complexity we want to measure.
A real number representing the complexity of
If the expression is longer on-screen, then a human would probably consider it more complex.
This expression has three characters,
sage: from sage.symbolic.complexity_measures import string_length sage: f = x^2 sage: string_length(f) 3