API Reference

Lifecycle Functions

quickmp.initialize() → None

Initialize the quickmp backend.

Initializes all available devices and selects device 0.

quickmp.finalize() → None

Finalize the quickmp backend.

Device Management

quickmp.get_device_count() → int

Get the number of available devices.

Returns:

number of VE devices, CPU: always 1)

Return type:

Number of available devices (VE

quickmp.use_device(device: int) → None

Switch to the specified device.

The device is selected per thread. Threads that have not called use_device() use device 0.

Parameters:

device – Device ID to use

quickmp.get_current_device() → int

Get the device ID selected for the calling thread.

Returns:

Currently selected device ID

Matrix Profile Computation

quickmp.selfjoin(T: numpy.ndarray, m: int, normalize: bool = True) → numpy.ndarray

Compute the matrix profile for time series T.

The computation is parallelized over all cores of the device. To compute the matrix profiles of many time series, selfjoin_batch() is faster.

Parameters:
  • T – Time series

  • m – Window size

  • normalize – If True (default), use Z-normalized Euclidean distance. If False, use raw Euclidean distance.

Returns:

Matrix profile

quickmp.selfjoin_batch(T: numpy.ndarray, m: int, normalize: bool = True) → numpy.ndarray

Compute the matrix profiles for a batch of time series of the same length.

Time series are processed in parallel, which is faster than calling selfjoin() for each time series when there are many of them.

Parameters:
  • T – 2D array where each row is a time series

  • m – Window size

  • normalize – If True (default), use Z-normalized Euclidean distance. If False, use raw Euclidean distance.

Returns:

2D array where each row is the matrix profile of the corresponding time series

quickmp.abjoin(T1: numpy.ndarray, T2: numpy.ndarray, m: int, normalize: bool = True) → numpy.ndarray

Compute the matrix profile between time series T1 and T2.

The computation is parallelized over all cores of the device.

Parameters:
  • T1 – Time series

  • T2 – Time series

  • m – Window size

  • normalize – If True (default), use Z-normalized Euclidean distance. If False, use raw Euclidean distance.

Returns:

Matrix profile

Low-Level Functions

quickmp.sliding_dot_product(T: numpy.ndarray, Q: numpy.ndarray) → numpy.ndarray

Compute the sliding dot product between time series T and Q.

Parameters:
  • T – Time series

  • Q – Time series

Returns:

Sliding dot product

quickmp.compute_mean_std(T: numpy.ndarray, m: int) → tuple[numpy.ndarray, numpy.ndarray]

Compute the mean and standard deviation of every subsequence in time series T.

Parameters:
  • T – Time series

  • m – Window size

Returns:

Tuple of mean and standard deviation