PolyArray¶
- class PolyArray¶
A NumPy-like multidimensional array of polynomials. Supports indexing, slicing, broadcast-compatible arithmetic, and utility methods for building optimization expressions.
Methods
__init__
Return a copy of the array.
Deprecated alias of
evaluate().Return a diagonal extracted from the array.
Evaluate each element by substituting variable values.
Fill all elements with a single polynomial or scalar value.
Return a flattened 1D copy of the array.
Return the indices of non-zero elements.
Return a flattened 1D view when possible.
Repeat elements of the array.
Return a reshaped view of the array.
Roll array elements along an axis.
Substitute variables in all elements of the array.
Sum array elements over the specified axis or axes.
Return a view with two axes swapped.
Take elements from the array along an axis.
Convert the polynomial array to nested Python lists.
Convert the polynomial array to a NumPy
float64ndarray.Alias of
to_list().Alias of
to_numpy().Permute axes and return a transposed view.
Return a view of the same underlying data.
Attributes
A transposed view of the array.
A 1D view of the array.
The number of dimensions of the array.
The shape of the array.
The total number of elements in the array.
- class Iterator¶
- __class_getitem__()¶
- __init__(*args, **kwargs)¶
- __next__(self: Iterator[Dim1]) Poly¶
- __next__(self: Iterator[Dim2]) PolyArray[Dim1]
- __next__(self: Iterator[Dim3]) PolyArray[Dim2]
- __next__(self: Iterator[Dim4]) PolyArray[Dim3]
- __next__(self) Poly | PolyArray[Dim]
__next__
Overload 1.
- Args:
self (amplify.PolyArray.Iterator[Dim1])
- Returns:
amplify.Poly:
Overload 2.
- Args:
self (amplify.PolyArray.Iterator[Dim2])
- Returns:
amplify.PolyArray[Dim1]:
Overload 3.
- Args:
self (amplify.PolyArray.Iterator[Dim3])
- Returns:
amplify.PolyArray[Dim2]:
Overload 4.
- Args:
self (amplify.PolyArray.Iterator[Dim4])
- Returns:
amplify.PolyArray[Dim3]:
Overload 5.
- Returns:
Poly | PolyArray[Dim]:
- __nb_signature__ = 'class Iterator(typing.Generic[__Dim])'¶
- __add__(self, arg: Poly | float | int, /) PolyArray[_Dim]¶
- __add__(self, arg: list | ndarray[], /) PolyArray[Dim]
- __add__(self, arg: PolyArray[Dim]) PolyArray[Dim]
- __add__(self: PolyArray[Dim0], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __add__(self, arg: PolyArray[Dim0]) PolyArray[_Dim]
- __add__(self: PolyArray[Dim1], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __add__(self, arg: PolyArray[Dim1]) PolyArray[_Dim]
- __add__(self: PolyArray[Dim2], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __add__(self, arg: PolyArray[Dim2]) PolyArray[_Dim]
- __add__(self: PolyArray[Dim3], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __add__(self, arg: PolyArray[Dim3]) PolyArray[_Dim]
- __add__(self: PolyArray[Dim4], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __add__(self, arg: PolyArray[Dim4]) PolyArray[_Dim]
Perform element-wise arithmetic between two polynomial arrays, or between a polynomial array and a scalar, using broadcasting rules. __add__ __add__ __add__ __add__ __add__ __add__ __add__ __add__ __add__ __add__ __add__ __add__
Overload 1.
- Args:
arg (amplify.Poly | float | int)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
Overload 3.
- Args:
arg (amplify.PolyArray[Dim])
- Returns:
amplify.PolyArray[Dim]:
Overload 4.
- Args:
self (amplify.PolyArray[Dim0])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 5.
- Args:
arg (amplify.PolyArray[Dim0])
- Returns:
amplify.PolyArray[_Dim]:
Overload 6.
- Args:
self (amplify.PolyArray[Dim1])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 7.
- Args:
arg (amplify.PolyArray[Dim1])
- Returns:
amplify.PolyArray[_Dim]:
Overload 8.
- Args:
self (amplify.PolyArray[Dim2])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 9.
- Args:
arg (amplify.PolyArray[Dim2])
- Returns:
amplify.PolyArray[_Dim]:
Overload 10.
- Args:
self (amplify.PolyArray[Dim3])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 11.
- Args:
arg (amplify.PolyArray[Dim3])
- Returns:
amplify.PolyArray[_Dim]:
Overload 12.
- Args:
self (amplify.PolyArray[Dim4])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 13.
- Args:
arg (amplify.PolyArray[Dim4])
- Returns:
amplify.PolyArray[_Dim]:
- __and__(self, arg: Poly | bool, /) PolyArray[_Dim]¶
- __and__(self, arg: list | ndarray[dtype=bool], /) PolyArray[Dim]
- __and__(self, arg: PolyArray[Dim]) PolyArray[Dim]
- __and__(self: PolyArray[Dim0], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __and__(self, arg: PolyArray[Dim0]) PolyArray[_Dim]
- __and__(self: PolyArray[Dim1], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __and__(self, arg: PolyArray[Dim1]) PolyArray[_Dim]
- __and__(self: PolyArray[Dim2], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __and__(self, arg: PolyArray[Dim2]) PolyArray[_Dim]
- __and__(self: PolyArray[Dim3], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __and__(self, arg: PolyArray[Dim3]) PolyArray[_Dim]
- __and__(self: PolyArray[Dim4], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __and__(self, arg: PolyArray[Dim4]) PolyArray[_Dim]
__and__
Overload 1.
- Args:
arg (amplify.Poly | bool)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
Overload 3.
- Args:
arg (amplify.PolyArray[Dim])
- Returns:
amplify.PolyArray[Dim]:
Overload 4.
- Args:
self (amplify.PolyArray[Dim0])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 5.
- Args:
arg (amplify.PolyArray[Dim0])
- Returns:
amplify.PolyArray[_Dim]:
Overload 6.
- Args:
self (amplify.PolyArray[Dim1])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 7.
- Args:
arg (amplify.PolyArray[Dim1])
- Returns:
amplify.PolyArray[_Dim]:
Overload 8.
- Args:
self (amplify.PolyArray[Dim2])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 9.
- Args:
arg (amplify.PolyArray[Dim2])
- Returns:
amplify.PolyArray[_Dim]:
Overload 10.
- Args:
self (amplify.PolyArray[Dim3])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 11.
- Args:
arg (amplify.PolyArray[Dim3])
- Returns:
amplify.PolyArray[_Dim]:
Overload 12.
- Args:
self (amplify.PolyArray[Dim4])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 13.
- Args:
arg (amplify.PolyArray[Dim4])
- Returns:
amplify.PolyArray[_Dim]:
- __bool__(self) bool¶
Cast a polynomial array to a number. This is valid only when the array has exactly one element and that element is a constant polynomial.
- 戻り値の型:
- __class_getitem__()¶
- __copy__(self) PolyArray[_Dim]¶
Copy the array.
Each polynomial in the array is copied as well. Equivalent to
copy().- 戻り値の型:
PolyArray[_Dim]
- __deepcopy__(self, arg: dict, /) PolyArray[_Dim]¶
Copy the array.
Each polynomial in the array is copied as well. Equivalent to
copy().
- __eq__(self, arg: amplify.PolyArray | amplify.Poly | float | int | list | ndarray[], /) numpy.ndarray[dtype=bool]¶
- __eq__(self, arg: object, /) bool
Perform element-wise comparisons between two polynomial arrays, or between a polynomial array and a scalar, using broadcasting rules. __eq__
Overload 1.
- Args:
arg (amplify.PolyArray | amplify.Poly | float | int | list | ndarray)
- Returns:
numpy.ndarray:
Overload 2.
- Args:
arg (object)
- Returns:
bool:
- __float__(self) float¶
Cast a polynomial array to a number. This is valid only when the array has exactly one element and that element is a constant polynomial.
- 戻り値の型:
- __getitem__(self: PolyArray[Dim0], arg: tuple[()]) Poly¶
- __getitem__(self: PolyArray[Dim0], arg: types.EllipsisType) PolyArray[Dim0]
- __getitem__(self: PolyArray[Dim1], arg: tuple[int] | int) Poly
- __getitem__(self: PolyArray[Dim1], arg: types.EllipsisType | tuple[()] | slice | tuple[slice]) PolyArray[Dim1]
- __getitem__(self: PolyArray[Dim2], arg: tuple[int, int]) Poly
- __getitem__( ) PolyArray[Dim1]
- __getitem__(
- self: PolyArray[Dim2],
- arg: types.EllipsisType | tuple[()] | slice | tuple[slice] | tuple[slice, slice],
- __getitem__(self: PolyArray[Dim3], arg: tuple[int, int, int]) Poly
- __getitem__(
- self: PolyArray[Dim3],
- arg: tuple[int, int] | tuple[slice, int, int] | tuple[int, slice, int] | tuple[int, int, slice],
- __getitem__(
- self: PolyArray[Dim3],
- arg: int | tuple[int] | tuple[slice, int] | tuple[int, slice] | tuple[slice, slice, int] | tuple[slice, int, slice] | tuple[int, slice, slice],
- __getitem__(
- self: PolyArray[Dim3],
- arg: types.EllipsisType | tuple[()] | slice | tuple[slice] | tuple[slice, slice] | tuple[slice, slice, slice],
- __getitem__(self: PolyArray[Dim4], arg: tuple[int, int, int, int]) Poly
- __getitem__(
- self: PolyArray[Dim4],
- arg: tuple[int, int, int] | tuple[slice, int, int, int] | tuple[int, slice, int, int] | tuple[int, int, slice, int] | tuple[int, int, int, slice],
- __getitem__(
- self: PolyArray[Dim4],
- arg: tuple[int, int] | tuple[slice, int, int] | tuple[int, slice, int] | tuple[int, int, slice] | tuple[slice, slice, int, int] | tuple[slice, int, slice, int] | tuple[slice, int, int, slice] | tuple[int, slice, slice, int] | tuple[int, slice, int, slice] | tuple[int, int, slice, slice],
- __getitem__(
- self: PolyArray[Dim4],
- arg: int | tuple[int] | tuple[slice, int] | tuple[int, slice] | tuple[slice, slice, int] | tuple[int, slice, slice] | tuple[slice, int, slice] | tuple[slice, slice, slice, int] | tuple[slice, slice, int, slice] | tuple[slice, int, slice, slice] | tuple[int, slice, slice, slice],
- __getitem__(
- self: PolyArray[Dim4],
- arg: types.EllipsisType | tuple[()] | slice | tuple[slice] | tuple[slice, slice] | tuple[slice, slice, slice] | tuple[slice, slice, slice, slice],
- __getitem__(self: PolyArray[Dim], arg: tuple | slice | types.EllipsisType | int | None) PolyArray[Dim]
Return a polynomial or a polynomial subarray. __getitem__ __getitem__ __getitem__ __getitem__ __getitem__ __getitem__ __getitem__ __getitem__ __getitem__ __getitem__ __getitem__ __getitem__ __getitem__ __getitem__ __getitem__ __getitem__
Supports indexing with integers, slices, ellipsis, and newaxis. Advanced indexing with arrays of indices is not supported.
Overload 1.
- Args:
self (amplify.PolyArray[Dim0]): self
arg (tuple[()]): An index specified as an integer, slice, ellipsis, or newaxis.
- Returns:
amplify.Poly: Selected element or slice, depending on the index.
- Raises:
IndexError: If any index is out of bounds. TypeError: If index type is invalid.
Overload 2.
- Args:
self (amplify.PolyArray[Dim0])
arg (types.EllipsisType)
- Returns:
amplify.PolyArray[Dim0]:
Overload 3.
- Args:
self (amplify.PolyArray[Dim1])
arg (tuple[int] | int)
- Returns:
amplify.Poly:
Overload 4.
- Args:
self (amplify.PolyArray[Dim1])
arg (types.EllipsisType | tuple[()] | slice | tuple[slice])
- Returns:
amplify.PolyArray[Dim1]:
Overload 5.
- Args:
self (amplify.PolyArray[Dim2])
arg (tuple[int, int])
- Returns:
amplify.Poly:
Overload 6.
- Args:
self (amplify.PolyArray[Dim2])
arg (int | tuple[int] | tuple[slice, int] | tuple[int, slice])
- Returns:
amplify.PolyArray[Dim1]:
Overload 7.
- Args:
self (amplify.PolyArray[Dim2])
arg (types.EllipsisType | tuple[()] | slice | tuple[slice] | tuple[slice, slice])
- Returns:
amplify.PolyArray[Dim2]:
Overload 8.
- Args:
self (amplify.PolyArray[Dim3])
arg (tuple[int, int, int])
- Returns:
amplify.Poly:
Overload 9.
- Args:
self (amplify.PolyArray[Dim3])
arg (tuple[int, int] | tuple[slice, int, int] | tuple[int, slice, int] | tuple[int, int, slice])
- Returns:
amplify.PolyArray[Dim1]:
Overload 10.
- Args:
self (amplify.PolyArray[Dim3])
arg (int | tuple[int] | tuple[slice, int] | tuple[int, slice] | tuple[slice, slice, int] | tuple[slice, int, slice] | tuple[int, slice, slice])
- Returns:
amplify.PolyArray[Dim2]:
Overload 11.
- Args:
self (amplify.PolyArray[Dim3])
arg (types.EllipsisType | tuple[()] | slice | tuple[slice] | tuple[slice, slice] | tuple[slice, slice, slice])
- Returns:
amplify.PolyArray[Dim3]:
Overload 12.
- Args:
self (amplify.PolyArray[Dim4])
arg (tuple[int, int, int, int])
- Returns:
amplify.Poly:
Overload 13.
- Args:
self (amplify.PolyArray[Dim4])
arg (tuple[int, int, int] | tuple[slice, int, int, int] | tuple[int, slice, int, int] | tuple[int, int, slice, int] | tuple[int, int, int, slice])
- Returns:
amplify.PolyArray[Dim1]:
Overload 14.
- Args:
self (amplify.PolyArray[Dim4])
arg (tuple[int, int] | tuple[slice, int, int] | tuple[int, slice, int] | tuple[int, int, slice] | tuple[slice, slice, int, int] | tuple[slice, int, slice, int] | tuple[slice, int, int, slice] | tuple[int, slice, slice, int] | tuple[int, slice, int, slice] | tuple[int, int, slice, slice])
- Returns:
amplify.PolyArray[Dim2]:
Overload 15.
- Args:
self (amplify.PolyArray[Dim4])
arg (int | tuple[int] | tuple[slice, int] | tuple[int, slice] | tuple[slice, slice, int] | tuple[int, slice, slice] | tuple[slice, int, slice] | tuple[slice, slice, slice, int] | tuple[slice, slice, int, slice] | tuple[slice, int, slice, slice] | tuple[int, slice, slice, slice])
- Returns:
amplify.PolyArray[Dim3]:
Overload 16.
- Args:
self (amplify.PolyArray[Dim4])
arg (types.EllipsisType | tuple[()] | slice | tuple[slice] | tuple[slice, slice] | tuple[slice, slice, slice] | tuple[slice, slice, slice, slice])
- Returns:
amplify.PolyArray[Dim4]:
Overload 17.
- Args:
self (amplify.PolyArray[Dim])
arg (tuple | slice | types.EllipsisType | int | None)
- Returns:
amplify.PolyArray[Dim]:
サンプル
``` from amplify import VariableGenerator, newaxis
q = VariableGenerator().array("Binary", (3, 4)) print(q[1, 2]) # Output: Poly(q_{1,2}) print(q[0]) # Output: PolyArray([q_{0,0}, q_{0,1}, q_{0,2}, q_{0,3}]) print(q[:, 0]) # Output: PolyArray([q_{0,0}, q_{1,0}, q_{2,0}]) print(q[..., 0]) # Output: PolyArray([q_{0,0}, q_{1,0}, q_{2,0}]) print(q[1, newaxis]) # Output: PolyArray([[q_{1,0}, q_{1,1}, q_{1,2}, q_{1,3}]]) ```
- __iadd__(self, arg: Poly | float | int, /) PolyArray[_Dim]¶
- __iadd__(self, arg: list | ndarray[], /) PolyArray[_Dim]
- __iadd__(self: PolyArray[Dim], arg: PolyArray[__Dim]) PolyArray[Dim]
- __iadd__(self: PolyArray[Dim0], arg: PolyArray[Dim0]) PolyArray[Dim0]
- __iadd__(self: PolyArray[Dim1], arg: PolyArray[Dim0 | Dim1]) PolyArray[Dim1]
- __iadd__(self: PolyArray[Dim2], arg: PolyArray[Dim0 | Dim1 | Dim2]) PolyArray[Dim2]
- __iadd__(self: PolyArray[Dim3], arg: PolyArray[Dim0 | Dim1 | Dim2 | Dim3]) PolyArray[Dim3]
- __iadd__(self: PolyArray[Dim4], arg: PolyArray[Dim0 | Dim1 | Dim2 | Dim3 | Dim4]) PolyArray[Dim4]
__iadd__
Overload 1.
- Args:
arg (amplify.Poly | float | int)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[_Dim]:
Overload 3.
- Args:
self (amplify.PolyArray[Dim])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[Dim]:
Overload 4.
- Args:
self (amplify.PolyArray[Dim0])
arg (amplify.PolyArray[Dim0])
- Returns:
amplify.PolyArray[Dim0]:
Overload 5.
- Args:
self (amplify.PolyArray[Dim1])
arg (PolyArray[Dim0 | Dim1])
- Returns:
amplify.PolyArray[Dim1]:
Overload 6.
- Args:
self (amplify.PolyArray[Dim2])
arg (PolyArray[Dim0 | Dim1 | Dim2])
- Returns:
amplify.PolyArray[Dim2]:
Overload 7.
- Args:
self (amplify.PolyArray[Dim3])
arg (PolyArray[Dim0 | Dim1 | Dim2 | Dim3])
- Returns:
amplify.PolyArray[Dim3]:
Overload 8.
- Args:
self (amplify.PolyArray[Dim4])
arg (PolyArray[Dim0 | Dim1 | Dim2 | Dim3 | Dim4])
- Returns:
amplify.PolyArray[Dim4]:
- __iand__(self, arg: Poly | bool, /) PolyArray[_Dim]¶
- __iand__(self, arg: list | ndarray[dtype=bool], /) PolyArray[Dim]
- __iand__(self, arg: PolyArray[Dim]) PolyArray[Dim]
- __iand__(self: PolyArray[Dim0], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __iand__(self, arg: PolyArray[Dim0]) PolyArray[_Dim]
- __iand__(self: PolyArray[Dim1], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __iand__(self, arg: PolyArray[Dim1]) PolyArray[_Dim]
- __iand__(self: PolyArray[Dim2], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __iand__(self, arg: PolyArray[Dim2]) PolyArray[_Dim]
- __iand__(self: PolyArray[Dim3], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __iand__(self, arg: PolyArray[Dim3]) PolyArray[_Dim]
- __iand__(self: PolyArray[Dim4], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __iand__(self, arg: PolyArray[Dim4]) PolyArray[_Dim]
__iand__
Overload 1.
- Args:
arg (amplify.Poly | bool)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
Overload 3.
- Args:
arg (amplify.PolyArray[Dim])
- Returns:
amplify.PolyArray[Dim]:
Overload 4.
- Args:
self (amplify.PolyArray[Dim0])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 5.
- Args:
arg (amplify.PolyArray[Dim0])
- Returns:
amplify.PolyArray[_Dim]:
Overload 6.
- Args:
self (amplify.PolyArray[Dim1])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 7.
- Args:
arg (amplify.PolyArray[Dim1])
- Returns:
amplify.PolyArray[_Dim]:
Overload 8.
- Args:
self (amplify.PolyArray[Dim2])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 9.
- Args:
arg (amplify.PolyArray[Dim2])
- Returns:
amplify.PolyArray[_Dim]:
Overload 10.
- Args:
self (amplify.PolyArray[Dim3])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 11.
- Args:
arg (amplify.PolyArray[Dim3])
- Returns:
amplify.PolyArray[_Dim]:
Overload 12.
- Args:
self (amplify.PolyArray[Dim4])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 13.
- Args:
arg (amplify.PolyArray[Dim4])
- Returns:
amplify.PolyArray[_Dim]:
- __imul__(self, arg: Poly | float | int, /) PolyArray[_Dim]¶
- __imul__(self, arg: list | ndarray[], /) PolyArray[_Dim]
- __imul__(self: PolyArray[Dim], arg: PolyArray[__Dim]) PolyArray[Dim]
- __imul__(self: PolyArray[Dim0], arg: PolyArray[Dim0]) PolyArray[Dim0]
- __imul__(self: PolyArray[Dim1], arg: PolyArray[Dim0 | Dim1]) PolyArray[Dim1]
- __imul__(self: PolyArray[Dim2], arg: PolyArray[Dim0 | Dim1 | Dim2]) PolyArray[Dim2]
- __imul__(self: PolyArray[Dim3], arg: PolyArray[Dim0 | Dim1 | Dim2 | Dim3]) PolyArray[Dim3]
- __imul__(self: PolyArray[Dim4], arg: PolyArray[Dim0 | Dim1 | Dim2 | Dim3 | Dim4]) PolyArray[Dim4]
__imul__
Overload 1.
- Args:
arg (amplify.Poly | float | int)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[_Dim]:
Overload 3.
- Args:
self (amplify.PolyArray[Dim])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[Dim]:
Overload 4.
- Args:
self (amplify.PolyArray[Dim0])
arg (amplify.PolyArray[Dim0])
- Returns:
amplify.PolyArray[Dim0]:
Overload 5.
- Args:
self (amplify.PolyArray[Dim1])
arg (PolyArray[Dim0 | Dim1])
- Returns:
amplify.PolyArray[Dim1]:
Overload 6.
- Args:
self (amplify.PolyArray[Dim2])
arg (PolyArray[Dim0 | Dim1 | Dim2])
- Returns:
amplify.PolyArray[Dim2]:
Overload 7.
- Args:
self (amplify.PolyArray[Dim3])
arg (PolyArray[Dim0 | Dim1 | Dim2 | Dim3])
- Returns:
amplify.PolyArray[Dim3]:
Overload 8.
- Args:
self (amplify.PolyArray[Dim4])
arg (PolyArray[Dim0 | Dim1 | Dim2 | Dim3 | Dim4])
- Returns:
amplify.PolyArray[Dim4]:
- __index__(self) int¶
Cast a polynomial array to a number. This is valid only when the array has exactly one element and that element is a constant polynomial.
- 戻り値の型:
- __int__(self) int¶
Cast a polynomial array to a number. This is valid only when the array has exactly one element and that element is a constant polynomial.
- 戻り値の型:
- __invert__(self) PolyArray[_Dim]¶
Perform an element-wise arithmetic operation.
- 戻り値の型:
PolyArray[_Dim]
- __ior__(self, arg: Poly | bool, /) PolyArray[_Dim]¶
- __ior__(self, arg: list | ndarray[dtype=bool], /) PolyArray[Dim]
- __ior__(self, arg: PolyArray[Dim]) PolyArray[Dim]
- __ior__(self: PolyArray[Dim0], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __ior__(self, arg: PolyArray[Dim0]) PolyArray[_Dim]
- __ior__(self: PolyArray[Dim1], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __ior__(self, arg: PolyArray[Dim1]) PolyArray[_Dim]
- __ior__(self: PolyArray[Dim2], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __ior__(self, arg: PolyArray[Dim2]) PolyArray[_Dim]
- __ior__(self: PolyArray[Dim3], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __ior__(self, arg: PolyArray[Dim3]) PolyArray[_Dim]
- __ior__(self: PolyArray[Dim4], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __ior__(self, arg: PolyArray[Dim4]) PolyArray[_Dim]
__ior__
Overload 1.
- Args:
arg (amplify.Poly | bool)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
Overload 3.
- Args:
arg (amplify.PolyArray[Dim])
- Returns:
amplify.PolyArray[Dim]:
Overload 4.
- Args:
self (amplify.PolyArray[Dim0])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 5.
- Args:
arg (amplify.PolyArray[Dim0])
- Returns:
amplify.PolyArray[_Dim]:
Overload 6.
- Args:
self (amplify.PolyArray[Dim1])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 7.
- Args:
arg (amplify.PolyArray[Dim1])
- Returns:
amplify.PolyArray[_Dim]:
Overload 8.
- Args:
self (amplify.PolyArray[Dim2])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 9.
- Args:
arg (amplify.PolyArray[Dim2])
- Returns:
amplify.PolyArray[_Dim]:
Overload 10.
- Args:
self (amplify.PolyArray[Dim3])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 11.
- Args:
arg (amplify.PolyArray[Dim3])
- Returns:
amplify.PolyArray[_Dim]:
Overload 12.
- Args:
self (amplify.PolyArray[Dim4])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 13.
- Args:
arg (amplify.PolyArray[Dim4])
- Returns:
amplify.PolyArray[_Dim]:
- __isub__(self, arg: Poly | float | int, /) PolyArray[_Dim]¶
- __isub__(self, arg: list | ndarray[], /) PolyArray[_Dim]
- __isub__(self: PolyArray[Dim], arg: PolyArray[__Dim]) PolyArray[Dim]
- __isub__(self: PolyArray[Dim0], arg: PolyArray[Dim0]) PolyArray[Dim0]
- __isub__(self: PolyArray[Dim1], arg: PolyArray[Dim0 | Dim1]) PolyArray[Dim1]
- __isub__(self: PolyArray[Dim2], arg: PolyArray[Dim0 | Dim1 | Dim2]) PolyArray[Dim2]
- __isub__(self: PolyArray[Dim3], arg: PolyArray[Dim0 | Dim1 | Dim2 | Dim3]) PolyArray[Dim3]
- __isub__(self: PolyArray[Dim4], arg: PolyArray[Dim0 | Dim1 | Dim2 | Dim3 | Dim4]) PolyArray[Dim4]
__isub__
Overload 1.
- Args:
arg (amplify.Poly | float | int)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[_Dim]:
Overload 3.
- Args:
self (amplify.PolyArray[Dim])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[Dim]:
Overload 4.
- Args:
self (amplify.PolyArray[Dim0])
arg (amplify.PolyArray[Dim0])
- Returns:
amplify.PolyArray[Dim0]:
Overload 5.
- Args:
self (amplify.PolyArray[Dim1])
arg (PolyArray[Dim0 | Dim1])
- Returns:
amplify.PolyArray[Dim1]:
Overload 6.
- Args:
self (amplify.PolyArray[Dim2])
arg (PolyArray[Dim0 | Dim1 | Dim2])
- Returns:
amplify.PolyArray[Dim2]:
Overload 7.
- Args:
self (amplify.PolyArray[Dim3])
arg (PolyArray[Dim0 | Dim1 | Dim2 | Dim3])
- Returns:
amplify.PolyArray[Dim3]:
Overload 8.
- Args:
self (amplify.PolyArray[Dim4])
arg (PolyArray[Dim0 | Dim1 | Dim2 | Dim3 | Dim4])
- Returns:
amplify.PolyArray[Dim4]:
- __iter__(self) Iterator[_Dim]¶
Iterate over the first axis of the polynomial array.
If the array has one or fewer dimensions, each yielded item is a polynomial. If the array has two or more dimensions, each yielded item is a subarray with one fewer dimension.
- 戻り値の型:
Iterator[_Dim]
- __ixor__(self, arg: Poly | bool, /) PolyArray[_Dim]¶
- __ixor__(self, arg: list | ndarray[dtype=bool], /) PolyArray[Dim]
- __ixor__(self, arg: PolyArray[Dim]) PolyArray[Dim]
- __ixor__(self: PolyArray[Dim0], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __ixor__(self, arg: PolyArray[Dim0]) PolyArray[_Dim]
- __ixor__(self: PolyArray[Dim1], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __ixor__(self, arg: PolyArray[Dim1]) PolyArray[_Dim]
- __ixor__(self: PolyArray[Dim2], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __ixor__(self, arg: PolyArray[Dim2]) PolyArray[_Dim]
- __ixor__(self: PolyArray[Dim3], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __ixor__(self, arg: PolyArray[Dim3]) PolyArray[_Dim]
- __ixor__(self: PolyArray[Dim4], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __ixor__(self, arg: PolyArray[Dim4]) PolyArray[_Dim]
__ixor__
Overload 1.
- Args:
arg (amplify.Poly | bool)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
Overload 3.
- Args:
arg (amplify.PolyArray[Dim])
- Returns:
amplify.PolyArray[Dim]:
Overload 4.
- Args:
self (amplify.PolyArray[Dim0])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 5.
- Args:
arg (amplify.PolyArray[Dim0])
- Returns:
amplify.PolyArray[_Dim]:
Overload 6.
- Args:
self (amplify.PolyArray[Dim1])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 7.
- Args:
arg (amplify.PolyArray[Dim1])
- Returns:
amplify.PolyArray[_Dim]:
Overload 8.
- Args:
self (amplify.PolyArray[Dim2])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 9.
- Args:
arg (amplify.PolyArray[Dim2])
- Returns:
amplify.PolyArray[_Dim]:
Overload 10.
- Args:
self (amplify.PolyArray[Dim3])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 11.
- Args:
arg (amplify.PolyArray[Dim3])
- Returns:
amplify.PolyArray[_Dim]:
Overload 12.
- Args:
self (amplify.PolyArray[Dim4])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 13.
- Args:
arg (amplify.PolyArray[Dim4])
- Returns:
amplify.PolyArray[_Dim]:
- __matmul__(self, arg: amplify.PolyArray | ndarray[], /) Poly | PolyArray[_Dim]¶
Perform matrix multiplication on two polynomial arrays. For arrays with three or more dimensions, the last two dimensions are treated as matrices and the remaining dimensions as batch dimensions. Broadcasting is applied to the batch dimensions.
- __mul__(self, arg: Poly | float | int, /) PolyArray[_Dim]¶
- __mul__(self, arg: list | ndarray[], /) PolyArray[Dim]
- __mul__(self, arg: PolyArray[Dim]) PolyArray[Dim]
- __mul__(self: PolyArray[Dim0], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __mul__(self, arg: PolyArray[Dim0]) PolyArray[_Dim]
- __mul__(self: PolyArray[Dim1], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __mul__(self, arg: PolyArray[Dim1]) PolyArray[_Dim]
- __mul__(self: PolyArray[Dim2], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __mul__(self, arg: PolyArray[Dim2]) PolyArray[_Dim]
- __mul__(self: PolyArray[Dim3], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __mul__(self, arg: PolyArray[Dim3]) PolyArray[_Dim]
- __mul__(self: PolyArray[Dim4], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __mul__(self, arg: PolyArray[Dim4]) PolyArray[_Dim]
Perform element-wise arithmetic between two polynomial arrays, or between a polynomial array and a scalar, using broadcasting rules. __mul__ __mul__ __mul__ __mul__ __mul__ __mul__ __mul__ __mul__ __mul__ __mul__ __mul__ __mul__
Overload 1.
- Args:
arg (amplify.Poly | float | int)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
Overload 3.
- Args:
arg (amplify.PolyArray[Dim])
- Returns:
amplify.PolyArray[Dim]:
Overload 4.
- Args:
self (amplify.PolyArray[Dim0])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 5.
- Args:
arg (amplify.PolyArray[Dim0])
- Returns:
amplify.PolyArray[_Dim]:
Overload 6.
- Args:
self (amplify.PolyArray[Dim1])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 7.
- Args:
arg (amplify.PolyArray[Dim1])
- Returns:
amplify.PolyArray[_Dim]:
Overload 8.
- Args:
self (amplify.PolyArray[Dim2])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 9.
- Args:
arg (amplify.PolyArray[Dim2])
- Returns:
amplify.PolyArray[_Dim]:
Overload 10.
- Args:
self (amplify.PolyArray[Dim3])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 11.
- Args:
arg (amplify.PolyArray[Dim3])
- Returns:
amplify.PolyArray[_Dim]:
Overload 12.
- Args:
self (amplify.PolyArray[Dim4])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 13.
- Args:
arg (amplify.PolyArray[Dim4])
- Returns:
amplify.PolyArray[_Dim]:
- __ne__(self, arg: amplify.PolyArray | amplify.Poly | float | int | list | ndarray[], /) numpy.ndarray[dtype=bool]¶
- __ne__(self, arg: object, /) bool
Perform element-wise comparisons between two polynomial arrays, or between a polynomial array and a scalar, using broadcasting rules. __ne__
Overload 1.
- Args:
arg (amplify.PolyArray | amplify.Poly | float | int | list | ndarray)
- Returns:
numpy.ndarray:
Overload 2.
- Args:
arg (object)
- Returns:
bool:
- __or__(self, arg: Poly | bool, /) PolyArray[_Dim]¶
- __or__(self, arg: list | ndarray[dtype=bool], /) PolyArray[Dim]
- __or__(self, arg: PolyArray[Dim]) PolyArray[Dim]
- __or__(self: PolyArray[Dim0], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __or__(self, arg: PolyArray[Dim0]) PolyArray[_Dim]
- __or__(self: PolyArray[Dim1], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __or__(self, arg: PolyArray[Dim1]) PolyArray[_Dim]
- __or__(self: PolyArray[Dim2], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __or__(self, arg: PolyArray[Dim2]) PolyArray[_Dim]
- __or__(self: PolyArray[Dim3], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __or__(self, arg: PolyArray[Dim3]) PolyArray[_Dim]
- __or__(self: PolyArray[Dim4], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __or__(self, arg: PolyArray[Dim4]) PolyArray[_Dim]
__or__
Overload 1.
- Args:
arg (amplify.Poly | bool)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
Overload 3.
- Args:
arg (amplify.PolyArray[Dim])
- Returns:
amplify.PolyArray[Dim]:
Overload 4.
- Args:
self (amplify.PolyArray[Dim0])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 5.
- Args:
arg (amplify.PolyArray[Dim0])
- Returns:
amplify.PolyArray[_Dim]:
Overload 6.
- Args:
self (amplify.PolyArray[Dim1])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 7.
- Args:
arg (amplify.PolyArray[Dim1])
- Returns:
amplify.PolyArray[_Dim]:
Overload 8.
- Args:
self (amplify.PolyArray[Dim2])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 9.
- Args:
arg (amplify.PolyArray[Dim2])
- Returns:
amplify.PolyArray[_Dim]:
Overload 10.
- Args:
self (amplify.PolyArray[Dim3])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 11.
- Args:
arg (amplify.PolyArray[Dim3])
- Returns:
amplify.PolyArray[_Dim]:
Overload 12.
- Args:
self (amplify.PolyArray[Dim4])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 13.
- Args:
arg (amplify.PolyArray[Dim4])
- Returns:
amplify.PolyArray[_Dim]:
- __radd__(self, arg: Poly | float | int, /) PolyArray[_Dim]¶
- __radd__(self, arg: list | ndarray[], /) PolyArray[Dim]
__radd__
Overload 1.
- Args:
arg (amplify.Poly | float | int)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
- __rand__(self, arg: Poly | bool, /) PolyArray[_Dim]¶
- __rand__(self, arg: list | ndarray[dtype=bool], /) PolyArray[Dim]
__rand__
Overload 1.
- Args:
arg (amplify.Poly | bool)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
- __rmul__(self, arg: Poly | float | int, /) PolyArray[_Dim]¶
- __rmul__(self, arg: list | ndarray[], /) PolyArray[Dim]
__rmul__
Overload 1.
- Args:
arg (amplify.Poly | float | int)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
- __ror__(self, arg: Poly | bool, /) PolyArray[_Dim]¶
- __ror__(self, arg: list | ndarray[dtype=bool], /) PolyArray[Dim]
__ror__
Overload 1.
- Args:
arg (amplify.Poly | bool)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
- __rsub__(self, arg: Poly | float | int, /) PolyArray[_Dim]¶
- __rsub__(self, arg: list | ndarray[], /) PolyArray[Dim]
__rsub__
Overload 1.
- Args:
arg (amplify.Poly | float | int)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
- __rxor__(self, arg: Poly | bool, /) PolyArray[_Dim]¶
- __rxor__(self, arg: list | ndarray[dtype=bool], /) PolyArray[Dim]
__rxor__
Overload 1.
- Args:
arg (amplify.Poly | bool)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
- __setitem__(
- self,
- arg: tuple | slice | types.EllipsisType | int | None,
- value: amplify.Poly | float | int | list | ndarray[] | amplify.PolyArray,
Assign a polynomial or a polynomial subarray.
Supports indexing with integers, slices, ellipsis, and newaxis. Advanced indexing with arrays of indices is not supported.
- パラメータ:
- 例外:
IndexError -- If any index is out of bounds.
TypeError -- If index type is invalid or value shape is incompatible.
- __sub__(self, arg: Poly | float | int, /) PolyArray[_Dim]¶
- __sub__(self, arg: list | ndarray[], /) PolyArray[Dim]
- __sub__(self, arg: PolyArray[Dim]) PolyArray[Dim]
- __sub__(self: PolyArray[Dim0], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __sub__(self, arg: PolyArray[Dim0]) PolyArray[_Dim]
- __sub__(self: PolyArray[Dim1], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __sub__(self, arg: PolyArray[Dim1]) PolyArray[_Dim]
- __sub__(self: PolyArray[Dim2], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __sub__(self, arg: PolyArray[Dim2]) PolyArray[_Dim]
- __sub__(self: PolyArray[Dim3], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __sub__(self, arg: PolyArray[Dim3]) PolyArray[_Dim]
- __sub__(self: PolyArray[Dim4], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __sub__(self, arg: PolyArray[Dim4]) PolyArray[_Dim]
Perform element-wise arithmetic between two polynomial arrays, or between a polynomial array and a scalar, using broadcasting rules. __sub__ __sub__ __sub__ __sub__ __sub__ __sub__ __sub__ __sub__ __sub__ __sub__ __sub__ __sub__
Overload 1.
- Args:
arg (amplify.Poly | float | int)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
Overload 3.
- Args:
arg (amplify.PolyArray[Dim])
- Returns:
amplify.PolyArray[Dim]:
Overload 4.
- Args:
self (amplify.PolyArray[Dim0])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 5.
- Args:
arg (amplify.PolyArray[Dim0])
- Returns:
amplify.PolyArray[_Dim]:
Overload 6.
- Args:
self (amplify.PolyArray[Dim1])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 7.
- Args:
arg (amplify.PolyArray[Dim1])
- Returns:
amplify.PolyArray[_Dim]:
Overload 8.
- Args:
self (amplify.PolyArray[Dim2])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 9.
- Args:
arg (amplify.PolyArray[Dim2])
- Returns:
amplify.PolyArray[_Dim]:
Overload 10.
- Args:
self (amplify.PolyArray[Dim3])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 11.
- Args:
arg (amplify.PolyArray[Dim3])
- Returns:
amplify.PolyArray[_Dim]:
Overload 12.
- Args:
self (amplify.PolyArray[Dim4])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 13.
- Args:
arg (amplify.PolyArray[Dim4])
- Returns:
amplify.PolyArray[_Dim]:
- __truediv__(self, arg: float | int, /) PolyArray[_Dim]¶
- __truediv__(self, arg: list | ndarray[], /) PolyArray[Dim]
Perform element-wise arithmetic between two polynomial arrays, or between a polynomial array and a scalar, using broadcasting rules. __truediv__
Overload 1.
- Args:
arg (float | int)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
- __xor__(self, arg: Poly | bool, /) PolyArray[_Dim]¶
- __xor__(self, arg: list | ndarray[dtype=bool], /) PolyArray[Dim]
- __xor__(self, arg: PolyArray[Dim]) PolyArray[Dim]
- __xor__(self: PolyArray[Dim0], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __xor__(self, arg: PolyArray[Dim0]) PolyArray[_Dim]
- __xor__(self: PolyArray[Dim1], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __xor__(self, arg: PolyArray[Dim1]) PolyArray[_Dim]
- __xor__(self: PolyArray[Dim2], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __xor__(self, arg: PolyArray[Dim2]) PolyArray[_Dim]
- __xor__(self: PolyArray[Dim3], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __xor__(self, arg: PolyArray[Dim3]) PolyArray[_Dim]
- __xor__(self: PolyArray[Dim4], arg: PolyArray[__Dim]) PolyArray[__Dim]
- __xor__(self, arg: PolyArray[Dim4]) PolyArray[_Dim]
__xor__
Overload 1.
- Args:
arg (amplify.Poly | bool)
- Returns:
amplify.PolyArray[_Dim]:
Overload 2.
- Args:
arg (list | ndarray)
- Returns:
amplify.PolyArray[Dim]:
Overload 3.
- Args:
arg (amplify.PolyArray[Dim])
- Returns:
amplify.PolyArray[Dim]:
Overload 4.
- Args:
self (amplify.PolyArray[Dim0])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 5.
- Args:
arg (amplify.PolyArray[Dim0])
- Returns:
amplify.PolyArray[_Dim]:
Overload 6.
- Args:
self (amplify.PolyArray[Dim1])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 7.
- Args:
arg (amplify.PolyArray[Dim1])
- Returns:
amplify.PolyArray[_Dim]:
Overload 8.
- Args:
self (amplify.PolyArray[Dim2])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 9.
- Args:
arg (amplify.PolyArray[Dim2])
- Returns:
amplify.PolyArray[_Dim]:
Overload 10.
- Args:
self (amplify.PolyArray[Dim3])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 11.
- Args:
arg (amplify.PolyArray[Dim3])
- Returns:
amplify.PolyArray[_Dim]:
Overload 12.
- Args:
self (amplify.PolyArray[Dim4])
arg (amplify.PolyArray[__Dim])
- Returns:
amplify.PolyArray[__Dim]:
Overload 13.
- Args:
arg (amplify.PolyArray[Dim4])
- Returns:
amplify.PolyArray[_Dim]:
- copy(self) PolyArray[_Dim]¶
Return a copy of the array.
Each polynomial in the array is copied as well.
- 戻り値:
Copy of the array.
- 戻り値の型:
PolyArray[_Dim]
- decode(self, values: Values) numpy.ndarray[dtype=float64]¶
- decode(self, values: Values, default: float) numpy.ndarray[dtype=float64]
- decode(self, values: Values, default: None) PolyArray[_Dim]
Deprecated alias of
evaluate(). decode decodeThis method is deprecated since Amplify v1.0.0 and will be removed in a future version.
Overload 1.
- Args:
values (amplify.Values): Values from optimization results, such as
result.best.values.
- Returns:
numpy.ndarray: Evaluated numeric values with the same shape.
Overload 2.
- Args:
values (amplify.Values): Values from optimization results, such as
result.best.values.default (float): The default numeric value used for variables not present in
values.
- Returns:
numpy.ndarray: Evaluated numeric values with the same shape.
Overload 3.
- Args:
values (amplify.Values): Values from optimization results, such as
result.best.values.default (None): Set to
Noneto keep unassigned variables symbolic.
- Returns:
amplify.PolyArray[_Dim]: Array with substitutions applied.
- diagonal(self: PolyArray[Dim], offset: int = 0, axis1: int = 0, axis2: int = 1) PolyArray[Dim]¶
- diagonal(self: PolyArray[Dim2], offset: int = 0, axis1: int = 0, axis2: int = 1) PolyArray[Dim1]
- diagonal(self: PolyArray[Dim3], offset: int = 0, axis1: int = 0, axis2: int = 1) PolyArray[Dim2]
- diagonal(self: PolyArray[Dim4], offset: int = 0, axis1: int = 0, axis2: int = 1) PolyArray[Dim3]
Return a diagonal extracted from the array. diagonal diagonal diagonal
Take the diagonal along
axis1andaxis2with optionaloffset. Unlike NumPy, return a copy.Overload 1.
- Args:
self (amplify.PolyArray[Dim]): self
offset (int): Offset of the diagonal. Defaults to
0. Defaults to0.axis1 (int): First axis. Defaults to
0. Defaults to0.axis2 (int): Second axis. Defaults to
1. Defaults to1.
- Returns:
amplify.PolyArray[Dim]: Diagonal extracted along the specified axes.
- Raises:
ValueError: If axes are out of bounds or identical.
Overload 2.
- Args:
self (amplify.PolyArray[Dim2]): self
offset (int): Offset of the diagonal. Defaults to
0. Defaults to0.axis1 (int): First axis. Defaults to
0. Defaults to0.axis2 (int): Second axis. Defaults to
1. Defaults to1.
- Returns:
amplify.PolyArray[Dim1]: Diagonal extracted along the specified axes.
- Raises:
ValueError: If axes are out of bounds or identical.
Overload 3.
- Args:
self (amplify.PolyArray[Dim3]): self
offset (int): Offset of the diagonal. Defaults to
0. Defaults to0.axis1 (int): First axis. Defaults to
0. Defaults to0.axis2 (int): Second axis. Defaults to
1. Defaults to1.
- Returns:
amplify.PolyArray[Dim2]: Diagonal extracted along the specified axes.
- Raises:
ValueError: If axes are out of bounds or identical.
Overload 4.
- Args:
self (amplify.PolyArray[Dim4]): self
offset (int): Offset of the diagonal. Defaults to
0. Defaults to0.axis1 (int): First axis. Defaults to
0. Defaults to0.axis2 (int): Second axis. Defaults to
1. Defaults to1.
- Returns:
amplify.PolyArray[Dim3]: Diagonal extracted along the specified axes.
- Raises:
ValueError: If axes are out of bounds or identical.
- evaluate(self, values: Values) numpy.ndarray[dtype=float64]¶
- evaluate(self, values: Values, default: float) numpy.ndarray[dtype=float64]
- evaluate(self, values: Values, default: None) PolyArray[_Dim]
Evaluate each element by substituting variable values. evaluate evaluate
Pass optimization result values to get a NumPy array with the same shape. The behavior for unassigned variables can be controlled by
default.When
default=None, keep variables not present invaluessymbolic and return aPolyArray.Overload 1.
- Args:
values (amplify.Values): Values from optimization results, such as
result.best.values.
- Returns:
numpy.ndarray: Evaluated numeric values with the same shape.
Overload 2.
- Args:
values (amplify.Values): Values from optimization results, such as
result.best.values.default (float): The default numeric value used for variables not present in
values.
- Returns:
numpy.ndarray: Evaluated numeric values with the same shape.
Overload 3.
- Args:
values (amplify.Values): Values from optimization results, such as
result.best.values.default (None): Set to
Noneto keep unassigned variables symbolic.
- Returns:
amplify.PolyArray[_Dim]: Array with substitutions applied.
- fill(self, value: Poly | float | int) None¶
Fill all elements with a single polynomial or scalar value.
- nonzero(self) tuple[numpy.ndarray[dtype=uint64], ...]¶
Return the indices of non-zero elements.
- repeat(self, repeats: int | list[int], axis: Literal[None] = None) PolyArray[Dim1]¶
- repeat(self, repeats: int | list[int], axis: int) PolyArray[_Dim]
Repeat elements of the array. repeat
When
axisisNone, repetitions are applied to the flattened array, and a 1D array is returned.Overload 1.
- Args:
repeats (int | list[int]): The number of repetitions for each element, or a list of repetitions.
axis (typing.Literal[None]): Axis along which to repeat. If
None, the array is repeated as a flattened array. Defaults toNone.
- Returns:
amplify.PolyArray[Dim1]: Array with repeated elements.
- Raises:
ValueError: If repeats contains negative values, axis is out of bounds, or shapes are incompatible. TypeError: If repeats is not an integer or list of integers.
Overload 2.
- Args:
repeats (int | list[int]): The number of repetitions for each element, or a list of repetitions.
axis (int): Axis along which to repeat. If
None, the array is repeated as a flattened array.
- Returns:
amplify.PolyArray[_Dim]: Array with repeated elements.
- Raises:
ValueError: If repeats contains negative values, axis is out of bounds, or shapes are incompatible. TypeError: If repeats is not an integer or list of integers.
- reshape(self, shape: int | tuple[int]) PolyArray[Dim1]¶
- reshape(self, shape: tuple[int, int]) PolyArray[Dim2]
- reshape(self, shape: tuple[int, int, int]) PolyArray[Dim3]
- reshape(self, shape: tuple[int, int, int, int]) PolyArray[Dim4]
- reshape(self, arg0: int, arg1: int) PolyArray[Dim2]
- reshape(self, arg0: int, arg1: int, arg2: int) PolyArray[Dim3]
- reshape(self, arg0: int, arg1: int, arg2: int, arg3: int) PolyArray[Dim4]
- reshape(self, shape: tuple[int, int, int, int, int, *tuple[int, ...]]) PolyArray[Dim]
- reshape(self, *shape: int) PolyArray[Dim]
Return a reshaped view of the array. reshape reshape reshape reshape reshape reshape reshape reshape
The new shape must be compatible with the current size. At most one
-1is allowed to infer an unknown dimension.Overload 1.
- Args:
shape (int | tuple[int]): The new shape specified as a tuple.
- Returns:
amplify.PolyArray[Dim1]: Reshaped array.
- Raises:
ValueError: If shape is incompatible with current size. TypeError: If shape is not int/tuple of ints.
Overload 2.
- Args:
shape (tuple[int, int]): The new shape specified as a tuple.
- Returns:
amplify.PolyArray[Dim2]: Reshaped array.
- Raises:
ValueError: If shape is incompatible with current size. TypeError: If shape is not int/tuple of ints.
Overload 3.
- Args:
shape (tuple[int, int, int]): The new shape specified as a tuple.
- Returns:
amplify.PolyArray[Dim3]: Reshaped array.
- Raises:
ValueError: If shape is incompatible with current size. TypeError: If shape is not int/tuple of ints.
Overload 4.
- Args:
shape (tuple[int, int, int, int]): The new shape specified as a tuple.
- Returns:
amplify.PolyArray[Dim4]: Reshaped array.
- Raises:
ValueError: If shape is incompatible with current size. TypeError: If shape is not int/tuple of ints.
Overload 5.
- Args:
arg0 (int): First dimension of the new shape.
arg1 (int): Second dimension of the new shape.
- Returns:
amplify.PolyArray[Dim2]: Reshaped array.
- Raises:
ValueError: If shape is incompatible with current size. TypeError: If shape is not int/tuple of ints.
Overload 6.
- Args:
arg0 (int): First dimension of the new shape.
arg1 (int): Second dimension of the new shape.
arg2 (int): Third dimension of the new shape.
- Returns:
amplify.PolyArray[Dim3]: Reshaped array.
- Raises:
ValueError: If shape is incompatible with current size. TypeError: If shape is not int/tuple of ints.
Overload 7.
- Args:
arg0 (int): First dimension of the new shape.
arg1 (int): Second dimension of the new shape.
arg2 (int): Third dimension of the new shape.
arg3 (int): Fourth dimension of the new shape.
- Returns:
amplify.PolyArray[Dim4]: Reshaped array.
- Raises:
ValueError: If shape is incompatible with current size. TypeError: If shape is not int/tuple of ints.
Overload 8.
- Args:
shape (tuple[int, int, int, int, int, *tuple[int, ...]]): The new shape specified as a tuple.
- Returns:
amplify.PolyArray[Dim]: Reshaped array.
- Raises:
ValueError: If shape is incompatible with current size. TypeError: If shape is not int/tuple of ints.
Overload 9.
- Args:
*shape (int): The new shape specified as a tuple.
- Returns:
amplify.PolyArray[Dim]: Reshaped array.
- Raises:
ValueError: If shape is incompatible with current size. TypeError: If shape is not int/tuple of ints.
- roll(self, shift: int, axis: int | None = None) PolyArray[_Dim]¶
Roll array elements along an axis.
If
axisisNone, the array is rolled in flattened order. Unlike NumPy,rollis provided as a method, and cannot roll multiple axes simultaneously.- パラメータ:
- 戻り値:
Array with rolled elements.
- 戻り値の型:
PolyArray[_Dim]
- 例外:
ValueError -- If axis is out of bounds.
- sum(self, axis: Literal[None] = None) Poly¶
- sum(self: PolyArray[Dim1], axis: int | tuple[int]) Poly
- sum(self: PolyArray[Dim2], axis: tuple[int, int]) Poly
- sum(self: PolyArray[Dim2], axis: int | tuple[int]) PolyArray[Dim1]
- sum(self: PolyArray[Dim3], axis: tuple[int, int, int]) Poly
- sum(self: PolyArray[Dim3], axis: tuple[int, int]) PolyArray[Dim1]
- sum(self: PolyArray[Dim3], axis: int | tuple[int]) PolyArray[Dim2]
- sum(self: PolyArray[Dim4], axis: tuple[int, int, int, int]) Poly
- sum(self: PolyArray[Dim4], axis: tuple[int, int, int]) PolyArray[Dim1]
- sum(self: PolyArray[Dim4], axis: tuple[int, int]) PolyArray[Dim2]
- sum(self: PolyArray[Dim4], axis: int | tuple[int]) PolyArray[Dim3]
- sum(self: PolyArray[_Dim], axis: tuple[()]) PolyArray[_Dim]
- sum(self: PolyArray[Dim], axis: int | tuple[int, ...]) Poly | PolyArray[Dim]
Sum array elements over the specified axis or axes. sum sum sum sum sum sum sum sum sum sum sum sum
Without
axis, all elements are summed into a single polynomial. Withaxis, the output type depends on the reduced dimensions.Overload 1.
- Args:
axis (typing.Literal[None]): The axis or axes to reduce. Defaults to
None.
- Returns:
amplify.Poly: Summation result. Shape depends on
axis.
Overload 2.
- Args:
self (amplify.PolyArray[Dim1]): self
axis (int | tuple[int]): The axis or axes to reduce.
- Returns:
amplify.Poly: Summation result. Shape depends on
axis.
Overload 3.
- Args:
self (amplify.PolyArray[Dim2]): self
axis (tuple[int, int]): The axis or axes to reduce.
- Returns:
amplify.Poly: Summation result. Shape depends on
axis.
Overload 4.
- Args:
self (amplify.PolyArray[Dim2]): self
axis (int | tuple[int]): The axis or axes to reduce.
- Returns:
amplify.PolyArray[Dim1]: Summation result. Shape depends on
axis.
Overload 5.
- Args:
self (amplify.PolyArray[Dim3]): self
axis (tuple[int, int, int]): The axis or axes to reduce.
- Returns:
amplify.Poly: Summation result. Shape depends on
axis.
Overload 6.
- Args:
self (amplify.PolyArray[Dim3]): self
axis (tuple[int, int]): The axis or axes to reduce.
- Returns:
amplify.PolyArray[Dim1]: Summation result. Shape depends on
axis.
Overload 7.
- Args:
self (amplify.PolyArray[Dim3]): self
axis (int | tuple[int]): The axis or axes to reduce.
- Returns:
amplify.PolyArray[Dim2]: Summation result. Shape depends on
axis.
Overload 8.
- Args:
self (amplify.PolyArray[Dim4]): self
axis (tuple[int, int, int, int]): The axis or axes to reduce.
- Returns:
amplify.Poly: Summation result. Shape depends on
axis.
Overload 9.
- Args:
self (amplify.PolyArray[Dim4]): self
axis (tuple[int, int, int]): The axis or axes to reduce.
- Returns:
amplify.PolyArray[Dim1]: Summation result. Shape depends on
axis.
Overload 10.
- Args:
self (amplify.PolyArray[Dim4]): self
axis (tuple[int, int]): The axis or axes to reduce.
- Returns:
amplify.PolyArray[Dim2]: Summation result. Shape depends on
axis.
Overload 11.
- Args:
self (amplify.PolyArray[Dim4]): self
axis (int | tuple[int]): The axis or axes to reduce.
- Returns:
amplify.PolyArray[Dim3]: Summation result. Shape depends on
axis.
Overload 12.
- Args:
self (amplify.PolyArray[_Dim]): self
axis (tuple[()]): The axis or axes to reduce.
- Returns:
amplify.PolyArray[_Dim]: Summation result. Shape depends on
axis.
Overload 13.
- Args:
self (amplify.PolyArray[Dim]): self
axis (int | tuple[int, ...]): The axis or axes to reduce.
- Returns:
Poly | PolyArray[Dim]: Summation result. Shape depends on
axis.
- swapaxes(self, axis1: int, axis2: int) PolyArray[_Dim]¶
Return a view with two axes swapped.
- パラメータ:
- 戻り値:
Array with the two axes swapped.
- 戻り値の型:
PolyArray[_Dim]
- 例外:
ValueError -- If either axis is out of bounds.
- take(self, indices: int, axis: Literal[None] = None) Poly¶
- take(self, indices: list[int], axis: Literal[None] = None) PolyArray[Dim1]
- take(self: PolyArray[Dim], indices: int | list[int], axis: int | None = None) PolyArray[Dim]
- take(self: PolyArray[Dim2], indices: int, axis: int) PolyArray[Dim1]
- take(self: PolyArray[Dim2], indices: list[int], axis: int) PolyArray[Dim2]
- take(self: PolyArray[Dim3], indices: int, axis: int) PolyArray[Dim2]
- take(self: PolyArray[Dim3], indices: list[int], axis: int) PolyArray[Dim3]
- take(self: PolyArray[Dim4], indices: int, axis: int) PolyArray[Dim3]
- take(self: PolyArray[Dim4], indices: list[int], axis: int) PolyArray[Dim4]
Take elements from the array along an axis. take take take take take take take take
If
axisisNone, indices are interpreted on the flattened array. Elements are always copied, even when a view could be returned.Overload 1.
- Args:
indices (int): A single index or a list of indices.
axis (typing.Literal[None]): Axis to take from. If
None, flattened indexing is used. Defaults toNone.
- Returns:
amplify.Poly: Selected elements. Shape depends on
indicesandaxis.- Raises:
IndexError: If any index is out of bounds. ValueError: If axis is out of bounds. TypeError: If indices is not int or list of ints.
Overload 2.
- Args:
indices (list[int]): A single index or a list of indices.
axis (typing.Literal[None]): Axis to take from. If
None, flattened indexing is used. Defaults toNone.
- Returns:
amplify.PolyArray[Dim1]: Selected elements. Shape depends on
indicesandaxis.- Raises:
IndexError: If any index is out of bounds. ValueError: If axis is out of bounds. TypeError: If indices is not int or list of ints.
Overload 3.
- Args:
self (amplify.PolyArray[Dim]): self
indices (int | list[int]): A single index or a list of indices.
axis (int | None): Axis to take from. If
None, flattened indexing is used. Defaults toNone.
- Returns:
amplify.PolyArray[Dim]: Selected elements. Shape depends on
indicesandaxis.- Raises:
IndexError: If any index is out of bounds. ValueError: If axis is out of bounds. TypeError: If indices is not int or list of ints.
Overload 4.
- Args:
self (amplify.PolyArray[Dim2]): self
indices (int): A single index or a list of indices.
axis (int): Axis to take from. If
None, flattened indexing is used.
- Returns:
amplify.PolyArray[Dim1]: Selected elements. Shape depends on
indicesandaxis.- Raises:
IndexError: If any index is out of bounds. ValueError: If axis is out of bounds. TypeError: If indices is not int or list of ints.
Overload 5.
- Args:
self (amplify.PolyArray[Dim2]): self
indices (list[int]): A single index or a list of indices.
axis (int): Axis to take from. If
None, flattened indexing is used.
- Returns:
amplify.PolyArray[Dim2]: Selected elements. Shape depends on
indicesandaxis.- Raises:
IndexError: If any index is out of bounds. ValueError: If axis is out of bounds. TypeError: If indices is not int or list of ints.
Overload 6.
- Args:
self (amplify.PolyArray[Dim3]): self
indices (int): A single index or a list of indices.
axis (int): Axis to take from. If
None, flattened indexing is used.
- Returns:
amplify.PolyArray[Dim2]: Selected elements. Shape depends on
indicesandaxis.- Raises:
IndexError: If any index is out of bounds. ValueError: If axis is out of bounds. TypeError: If indices is not int or list of ints.
Overload 7.
- Args:
self (amplify.PolyArray[Dim3]): self
indices (list[int]): A single index or a list of indices.
axis (int): Axis to take from. If
None, flattened indexing is used.
- Returns:
amplify.PolyArray[Dim3]: Selected elements. Shape depends on
indicesandaxis.- Raises:
IndexError: If any index is out of bounds. ValueError: If axis is out of bounds. TypeError: If indices is not int or list of ints.
Overload 8.
- Args:
self (amplify.PolyArray[Dim4]): self
indices (int): A single index or a list of indices.
axis (int): Axis to take from. If
None, flattened indexing is used.
- Returns:
amplify.PolyArray[Dim3]: Selected elements. Shape depends on
indicesandaxis.- Raises:
IndexError: If any index is out of bounds. ValueError: If axis is out of bounds. TypeError: If indices is not int or list of ints.
Overload 9.
- Args:
self (amplify.PolyArray[Dim4]): self
indices (list[int]): A single index or a list of indices.
axis (int): Axis to take from. If
None, flattened indexing is used.
- Returns:
amplify.PolyArray[Dim4]: Selected elements. Shape depends on
indicesandaxis.- Raises:
IndexError: If any index is out of bounds. ValueError: If axis is out of bounds. TypeError: If indices is not int or list of ints.
- to_list(self: PolyArray[Dim0]) Poly¶
- to_list(self: PolyArray[Dim1]) list[Poly]
- to_list(self: PolyArray[Dim2]) list[list[Poly]]
- to_list(self: PolyArray[Dim3]) list[list[list[Poly]]]
- to_list(self: PolyArray[Dim4]) list[list[list[list[Poly]]]]
- to_list(self: PolyArray[Dim]) list
Convert the polynomial array to nested Python lists. to_list to_list to_list to_list to_list
For 0D arrays, return the scalar polynomial itself.
Overload 1.
- Args:
self (amplify.PolyArray[Dim0])
- Returns:
amplify.Poly: Nested representation of elements, or the scalar polynomial itself for 0D arrays.
Overload 2.
- Args:
self (amplify.PolyArray[Dim1])
- Returns:
list[amplify.Poly]: Nested representation of elements, or the scalar polynomial itself for 0D arrays.
Overload 3.
- Args:
self (amplify.PolyArray[Dim2])
- Returns:
list[list[amplify.Poly]]: Nested representation of elements, or the scalar polynomial itself for 0D arrays.
Overload 4.
- Args:
self (amplify.PolyArray[Dim3])
- Returns:
list[list[list[amplify.Poly]]]: Nested representation of elements, or the scalar polynomial itself for 0D arrays.
Overload 5.
- Args:
self (amplify.PolyArray[Dim4])
- Returns:
list[list[list[list[amplify.Poly]]]]: Nested representation of elements, or the scalar polynomial itself for 0D arrays.
Overload 6.
- Args:
self (amplify.PolyArray[Dim])
- Returns:
list: Nested representation of elements, or the scalar polynomial itself for 0D arrays.
- to_numpy(self) numpy.ndarray[dtype=float64]¶
Convert the polynomial array to a NumPy
float64ndarray.- 戻り値:
Converted NumPy array.
- 戻り値の型:
- tolist(self: PolyArray[Dim0]) Poly¶
- tolist(self: PolyArray[Dim1]) list[Poly]
- tolist(self: PolyArray[Dim2]) list[list[Poly]]
- tolist(self: PolyArray[Dim3]) list[list[list[Poly]]]
- tolist(self: PolyArray[Dim4]) list[list[list[list[Poly]]]]
- tolist(self: PolyArray[Dim]) list
Alias of
to_list(). tolist tolist tolist tolist tolistOverload 1.
- Args:
self (amplify.PolyArray[Dim0])
- Returns:
amplify.Poly: Nested representation of elements, or the scalar polynomial itself for 0D arrays.
Overload 2.
- Args:
self (amplify.PolyArray[Dim1])
- Returns:
list[amplify.Poly]: Nested representation of elements, or the scalar polynomial itself for 0D arrays.
Overload 3.
- Args:
self (amplify.PolyArray[Dim2])
- Returns:
list[list[amplify.Poly]]: Nested representation of elements, or the scalar polynomial itself for 0D arrays.
Overload 4.
- Args:
self (amplify.PolyArray[Dim3])
- Returns:
list[list[list[amplify.Poly]]]: Nested representation of elements, or the scalar polynomial itself for 0D arrays.
Overload 5.
- Args:
self (amplify.PolyArray[Dim4])
- Returns:
list[list[list[list[amplify.Poly]]]]: Nested representation of elements, or the scalar polynomial itself for 0D arrays.
Overload 6.
- Args:
self (amplify.PolyArray[Dim])
- Returns:
list: Nested representation of elements, or the scalar polynomial itself for 0D arrays.
- tonumpy(self) numpy.ndarray[dtype=float64]¶
Alias of
to_numpy().- 戻り値:
Converted NumPy array.
- 戻り値の型:
- transpose(self, axes: tuple[int, ...] | None = None) PolyArray[_Dim]¶
- transpose(self, *axes: int) PolyArray[_Dim]
Permute axes and return a transposed view. transpose
If
axesis not specified, the axis order is reversed. Negative axes are supported and are normalized using the array dimension.Overload 1.
- Args:
axes (tuple[int, ...] | None): Axis permutation. If
None, the axis order is reversed. Defaults toNone.
- Returns:
amplify.PolyArray[_Dim]: Array with permuted axes.
- Raises:
ValueError: If any axis is out of bounds or permutation is invalid. TypeError: If axes is not a tuple of integers.
Overload 2.
- Args:
*axes (int): Axis permutation specified as positional arguments.
- Returns:
amplify.PolyArray[_Dim]: Array with permuted axes.
- Raises:
ValueError: If any axis is out of bounds or permutation is invalid. TypeError: If axes is not a tuple of integers.
- view(self) PolyArray[_Dim]¶
Return a view of the same underlying data.
- 戻り値:
View of the same underlying data.
- 戻り値の型:
PolyArray[_Dim]
- property T¶
A transposed view of the array.
Equivalent to
transpose()with default axis order.- 戻り値の型:
PolyArray[_Dim]
- __nb_signature__ = 'class PolyArray(typing.Generic[_Dim])'¶
- property shape¶
The shape of the array.
Read this property to get the current shape as a tuple. Set this property to reshape the array in-place if the requested shape is compatible with the current size.