Repository navigation
A register of function names, by what a mathematician calls each #2182
Description
The names and conventions of functions the library does not have yet, fixed before any of them is implemented, so that they land in any order without being argued again. This replaces a first version that copied an older table and its rule that SymPy's spelling wins. That rule gave lambertw beside zeta, and SymPy's cryptic ff and rf.
The rule
- A function is named by what a mathematician calls it. That is its Wikipedia article and MathWorld entry, in lower case, without spaces or the word "function":
lambertw(Lambert W function),harmonicnumber,doublefactorial,fallingfactorial. - Where mathematicians call a function by its standard symbol alone, the symbol's name is used:
zeta(ζ),beta(B). This is howgamma(Γ) anderfare already named. Where mathematics writes an operator rather than a function, the operator is the spelling: the double factorial is the postfixn!!, as the factorial isn!, and congruence isa = b (mod n). - A name that already means something else in mathematics is not used.
divis the divergence, so the integer quotient isquotient.deltais Kronecker's and Dirac's, so the forward difference isforwarddifference.catalanalone is also Catalan's constant, andharmonicalso the harmonic mean, socatalannumberandharmonicnumber.pochhammer, and the notation(x)_n, mean the rising factorial in special functions and the falling one in combinatorics, so neither is used.
- Mathematica's name is accepted on input where it is another spelling of the same function, and SymPy's where it is unambiguous. Only the chosen name is printed.
- Nothing is added that the library already writes another way.
isprime(n)isn in PP,clamp(x, a, b)ismin(max(x, a), b), the fractional part isx mod 1(floored, so in[0, 1)) and the integer quotient isfloor(a/b). The Heaviside step function is the same case. Its sources disagree on its value at 0, soheavisidewould have to pick one: Wikipedia lists0,1/2,1,[0, 1]and none, MathWorld gives1/2, DLMF 1.16.130, Mathematica'sUnitStep1and itsHeavisideThetanone. Each is already written exactly:iverson(x > 0),iverson(x >= 0)and(1 + sgn(x))/2, so neitherheavisidenorunitstepis added; both are refused with those three spellings (see A register of function names, by what a mathematician calls each #2182).
The sources are listed for each row as evidence, not as the reason.
LaTeX reads back as what it came from. A Greek letter or a capital that could be a variable is wrapped in \operatorname, as phi(n) already draws as \operatorname{\varphi}\left(n\right), since mu * (n + 1) draws as \mu \left(n+1\right). Braces are left for sets. A constant is upright, as pi is \mathrm{\pi}.
Shipped
floor, ceil, round, mod, min, max, gcd, lcm, phi, binomial, sum, product, erf, erfc, digamma, polygamma, gamma, and congruence as a = b (mod n). Also prime(n), valuation, iverson, det, transpose, dot, cross and resultant (#2180), conjugate/conj and arg (#2181), Re and Im (#2185), the double factorial n!! (#2187), and mobius, divisorsigma, primenu, primeomega and primepi (#2188). laplacian, jacobian and hessian (#2190), and fallingfactorial, factorialpower and risingfactorial (#2194). multinomial, the gamma ratio agreed below (#2197), catalannumber (#2198), harmonicnumber (#2200), forwarddifference (#2201) and lambertw (#2202), with K (a x + b) c^(g x + d) = k solved through it (#2203). The constant eulergamma, \mathrm{\gamma}, also read as EulerGamma, with digamma exact at a whole or half-whole argument and harmonicnumber at a half-whole one (#2204).
Proposed
| Name | Also accepted | Wikipedia | MathWorld | Mathematica | SymPy | LaTeX | Convention |
|---|---|---|---|---|---|---|---|
beta(a, b) |
Beta function | Beta Function | Beta |
beta |
\operatorname{B}\left(a, b\right) |
||
zeta(s), zeta(s, a) |
Riemann zeta function, Hurwitz zeta function | Riemann Zeta Function, Hurwitz Zeta Function | Zeta, HurwitzZeta |
zeta |
\operatorname{\zeta}\left(s\right), \operatorname{\zeta}\left(s, a\right) |
To decide: rule 2 gives zeta, rule 1 gives riemannzeta and hurwitzzeta |
|
norm(v), (v, p) |
Norm (mathematics) | Vector Norm | Norm |
Matrix.norm |
\left| v \right|_{p} |
p = 2 by default; p = +oo is the largest modulus |
|
grad(f, x) |
gradient |
Gradient | Gradient | Grad |
gradient |
\nabla f |
a column |
div(F, x) |
divergence |
Divergence | Divergence | Div |
divergence |
\nabla \cdot F |
|
curl(F, x) |
Curl (mathematics) | Curl | Curl |
curl |
\nabla \times F |
three dimensions only |
Reserved until implemented
An unknown name followed by a bracket is read as a product, so zeta(s) is zeta * s today, silently. #2184 refuses the long names by name until each is implemented. Short names that could be somebody's variable before a bracket are not reserved: beta, norm, grad, div, curl, frac.
Related: #809 (the research), #2145, #2147.
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
Happypig375 commentedon Oct 28, 2026
Do we really need a
isprimefunction whenin PPsuffices?Do we not have a better notation for rising and falling factorials when they literally look like superscripts and subscripts as written here? Something with overbars and underbars perhaps?
doublefactorial is reserved as a function but not
!!?We have lambertw but zeta not riemannzeta (we can't have the greek zeta as a variable anymore????)? Blindly following Sympy is producing inconsistencies, and you didn't even list Mathematica's name! How about Wikipedia and MathWorld's naming? What happened to your agentic instructions - this table is so arbitrary despite you are to be a mathematician first?
[-]A register of function names to add, and the long ones reserved until then[/-][+]A register of function names, by what a mathematician calls each[/+]Rafael-SOWNet commentedon Oct 28, 2026
You're right on all three, and the fault is mine. I copied the August table, whose rule was "SymPy wins", instead of naming each function. That is what you asked me to stop doing on #1239.
The body is replaced. The new register states its rule, and each row gives its Wikipedia, MathWorld, Mathematica and SymPy names as evidence:
isprimeis dropped, sincen in PPis the statement. So isclamp, which ismin(max(x, a), b).fallingfactorialandrisingfactorial, drawn with Knuth's underbar and overbar from Concrete Mathematics:x^{\underline{n}}andx^{\overline{n}}.pochhammeris not accepted, since(x)_nis the rising factorial in special functions and the falling one in combinatorics.ffandrfare gone. Mathematica'sFactorialPoweris accepted for the falling one.quotient, notdiv, which is the divergence.forwarddifference, notdelta.catalannumberandharmonicnumber, notcatalan, which is also Catalan's constant, orharmonic.Two calls I'd like yours on:
zeta, orriemannzetaandhurwitzzeta. I lean tozeta. Mathematicians say "the zeta function" and write ζ, as they do Γ and erf, both named by their symbol here. Nobody says "the W function" alone, which is why that one islambertw.heavisideat 0. It is1/2in MathWorld and SymPy, and1in Mathematica'sUnitStep.#2184 is back to draft until the names settle. Some of what it reserves changes:
harmonicbecomesharmonicnumber, andisprimegoes.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Happypig375 commentedon Oct 28, 2026
This is an incomplete description of Mathematica. Mathematica has
HeavisideTheta[0]unevaluated andUnitStep[0]as 1. So the Heaviside function is considered as a different function than the "unit step" function. This may need more thought... How do other online sources discuss this?Happypig375 commentedon Oct 28, 2026
Also,
doublefactorialis dubious as a function when the factorial is the postfix!operator and we likely want the postfix!!here.Rafael-SOWNet commentedon Oct 28, 2026
Agreed, and it settles more than the value. The sources disagree on
H(0), and some on whether there is one:H(0)1where H must be right-continuous (distribution functions, Lebesgue–Stieltjes),0left-continuous,1/2by the half-maximum convention,[0, 1]set-valued in optimization, and none as a distribution1/2, "the conventional definition", noting thatUnitSteptakes10:H(x) = 1forx > 0and0forx <= 0HeavisideTheta[0]stays unevaluated, "as a distribution";UnitStep[0]is1; the two "are not mathematically equivalent"1with_EnvUseHeavisideAsUnitStep1/2by default, set byHeavisideAtOriginHeaviside(x, H0=1/2)since 1.9, undefined beforeSo
heaviside(x)would have to pick one, and whichever it picks is a different function to half its readers. Each convention is already written exactly here, without ambiguity:0at0(DLMF)iverson(x > 0)1at0(the unit step, right-continuous)iverson(x >= 0)1/2at0(MathWorld, SymPy, MATLAB)(1 + sgn(x))/2I propose rule 5 for both
heavisideandunitstep: no function. They would be refused by name, with a message giving those three spellings, asarcsinhis refused with the spellings the library accepts. The distributional reading, whereH(0)has no value andH' = δ, needs a Dirac delta, which is a question of its own and not this one. I'll move the row in the register.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Rafael-SOWNet commentedon Oct 28, 2026
Yes.
n!!is how Wikipedia and MathWorld write it, and how Mathematica reads it. Today5!!is a parse error ("extraneous input '!'"), so it can be the double factorial with nothing changing meaning, and(n!)!keeps its parentheses. The register now has a rule for it: where mathematics writes an operator rather than a function, the operator is the spelling, as withn!anda = b (mod n). The double factorial's row isn!!, with no function name.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Happypig375 commentedon Oct 28, 2026
I agree that unclear notations should be rejected with clear alternatives: this is what we did with
NNforcingZZ+orZZ*, rejecting the notion of "heaviside" or "unit step" and forcing a clear alternative is what we go for. The user will be able to redefine their conventions usingletstatements (#352 coming v3).Happypig375 commentedon Oct 28, 2026
actually, maybe this might also be a potential thought for v3:
Rafael-SOWNet commentedon Oct 28, 2026
Recorded on #352, where the v3
letstatement is tracked, so the disambiguator is designed with it.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Happypig375 commentedon Oct 28, 2026
The table now looks mostly fine, but LaTeX also needs to consider roundtripping, for example
{x}really looks like a one-element set.6 remaining items
The Möbius, divisor and prime-counting functions
The Möbius, divisor and prime-counting functions (#2188)
The Laplacian, the Jacobian and the Hessian
The Laplacian, the Jacobian and the Hessian (#2190)
The falling and the rising factorial (#2194)
Rafael-SOWNet commentedon Oct 29, 2026
multinomialneeds a decision before it can be added. On the non-negative integers,(k₁ + … + kₘ)! / (k₁! ⋯ kₘ!)is unambiguous. Off them, the definitions disagree:binomial's convention that a negative whole lower index gives 0. That breaks symmetry.multinomial(-3, 1)comes out asbinomial(-2, 1) = -2, whilemultinomial(1, -3)comes out asbinomial(-2, -3) = 0.Γ(k₁ + … + kₘ + 1) / ∏ Γ(kᵢ + 1), it is symmetric. It has no value where an argument is a negative integer: there the limit depends on how it is approached, andbinomial(n, k)itself does not follow the gamma ratio.My proposal: the gamma ratio, with no value where an argument or the sum is a negative integer. Then
multinomial(a, b)agrees withbinomial(a + b, b)everywhere both are defined by the ratio, and the two differ only at negative integers.Happypig375 commentedon Oct 29, 2026
Seems fine, we already implicitly use the gamma function for non-integer factorials instead of not defining a value for non-integer factorials.
The multinomial coefficient (#2197)
The Catalan numbers (#2198)
The harmonic numbers (#2200)
Rafael-SOWNet commentedon Oct 29, 2026
Merged since the register was posted: #2187 (
n!!), #2188 (mobius,divisorsigma,primenu,primeomega,primepi), #2190 (laplacian,jacobian,hessian), #2194 (factorial powers), #2197 (multinomial), #2198 (catalannumber) and #2200 (harmonicnumber). #2201 (forwarddifference) is open, and I'm writinglambertwnext.Two decisions are left, both yours:
zeta. Rule 2, a function named by its symbol asgammais, giveszeta(s)andzeta(s, a), as Mathematica'sZetaand SymPy'szeta. Rule 1 givesriemannzetaandhurwitzzeta. My suggestion iszeta, with the two long names read as the same function.beta,norm,grad,div,curl. These are read as products today,beta(x)beingbeta * x, so making them functions changes what existing input means.divis also integer division in several languages. My suggestion:beta(a, b),norm(v)andnorm(v, p), andgradient,divergenceandcurlspelled out;divitself stays a variable.The forward difference (#2201)
The Lambert W function (#2202)
Solve a linear function times an exponential by the Lambert W function (
Euler's constant, eulergamma (#2204)