Skip to content

← array package

MatrixExponential

Calculate the exponential of a matrix or stack thereof (where the last two dimensions are the matrix dimensions).

Note that this is not the elementwise exponential. More Info... Version 1.0.0

Ports/Properties

backend

Optional compute backend to use. Keep is the current default, which resolves to that of the template array if one is provided and otherwise numpy unless overridden. Numpy is the standard CPU backend that underpins most of NeuroPype's operations. The others require one or more GPUs to be present on the system, except for torch-cpu. For best performance, keep all arrays that interact with each other (via processing nodes) on the same backend.

verbose name
Backend
default value
keep
port type
EnumPort
value type
str (can be None)

precision

Numeric precision to use. Can be reduced to save memory (e.g. if running on GPU).

verbose name
Precision
default value
keep
port type
EnumPort
value type
str (can be None)

array

Matrix (stack) to process.

verbose name
Array
default value
None
port type
DataPort
value type
AnyNumeric (can be None)
data direction
INOUT

upper_triangular

If True, the input matrix is assumed to be upper triangular, which can speed up the computation.

verbose name
Upper Triangular
default value
False
port type
BoolPort
value type
bool (can be None)

max_squarings

Maximum number of squarings to use in the scaling and squaring method. If the actual number of squarings is larger, NaN is returned. Not used by all backends.

verbose name
Squaring Limit
default value
16
port type
IntPort
value type
int (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)

lists_as_arrays

Whether to treat lists as numeric arrays, as opposed to a recursive data structure. This is equivalent to converting any list operand(s) to arrays before passing them to the node. Broadly, enabling this allows for more efficient processing of lists of arrays as operands, with some limitations and caveats, as follows. If one operand was a list and the other an array, an array will be returned, and if all were lists, a list will be returned (if the operand lists themselves contained arrays, the result is still a "pure" list of potentially nested lists of numbers). A limitation is that input lists may contain ONLY numbers or arrays of the same shape. In contrast, when the option is disabled, then if one operand is a list and the other is not a list (e.g., a number, array, etc), then each element of the list is separately undergoing the operation while the other operand is held fixed. This has the consequence that a) the result will generally be a list if at least one operand is a list and b) the result will be mathematically different when one is a list and the other is an array, because the array will be separately combined with each list element. Note the default for this option was enabled by default in NeuroPype 2023. The option can also be set globally or in a context using the WithOptions node, for example for pipeline-wide backwards compatibility.

verbose name
Lists As Arrays
default value
False
port type
BoolPort
value type
bool (can be None)