numpoly.symbols#

numpoly.symbols(names: Sequence[str] | None = None, asarray: bool = False, dtype: DTypeLike = 'i8', allocation: int | None = None) ndpoly[source]#

Construct symbol variables.

Most directly be providing a list of string names. But a set of shorthands also exists:

  • , and `` `` (space) can be used as a variable delimiter.

  • {number}:{number} can be used to define a numerical range.

  • {letter}:{letter} can be used to define a alphabet range.

Args:
names:

Indeterminants are determined by splitting the string on space. If iterable of strings, indeterminants defined directly.

asarray:

Enforce output as array even in the case where there is only one variable.

dtype:

The data type of the polynomial coefficients.

allocation:

The maximum number of polynomial exponents. If omitted, use length of exponents for allocation.

Return:

Polynomial array with unit components in each dimension.

Example:
>>> numpoly.symbols()
polynomial(q0)
>>> numpoly.symbols("q4")
polynomial(q4)
>>> numpoly.symbols("q:7")
polynomial([q0, q1, q2, q3, q4, q5, q6])
>>> numpoly.symbols("q3:6")
polynomial([q3, q4, q5])
>>> numpoly.symbols(["q0", "q3", "q99"])
polynomial([q0, q3, q99])