sarcomp.iexp#

sarcomp.iexp(array0: ndarray | Array, dtype=None) ndarray | Array#

Compute the element-wise exponential of the input array and convert it to the specified complex dtype.

Parameters:
  • array0 (Union[np.ndarray, Array]) – The input array, which can be a NumPy ndarray or an instance of the custom Array class.

  • dtype (str, optional) – The target data type for the result. If dtype is None, the result will have the same type as the input array.

Returns:

If dtype is None or a NumPy-supported dtype, returns an np.ndarray. If dtype corresponds to the split-complex Array class, returns an Array instance.

Return type:

Union[np.ndarray, Array]

Raises:
  • ValueError – If the conversion from the input array’s data type to dtype is not supported.

  • KeyError – If the specified conversion function is not found in the functions dictionary.

Examples

>>> import numpy as np
>>> import sarcomp as sc
>>> np_array = np.array([1.0, 2.0, 3.0], dtype=np.float32)
>>> # Example with default dtype (returns np.ndarray)
>>> result = sc.iexp(np_array)
>>> type(result)
<class 'numpy.ndarray'>
>>> # Example with a split-complex64 dtype (returns Array instance)
>>> result = sc.iexp(np_array, dtype='sc8')
>>> type(result)
<class 'sarcomp.Array'>

Performance#

A chart showing performance for sarcomp.iexp

Performance plot for sarcomp.iexp function.#