pysiglib.log_sig_join#
Added in version v3.0.0.
- log_sig_join(log_sig, displacement, dimension, degree, *, n_jobs=1)[source]#
Extends a truncated log-signature by a single displacement vector using the Baker-Campbell-Hausdorff (BCH) formula. This is the log-signature analogue of
sig_join.Given a log-signature \(L(x)\) and a displacement \(v\), this computes
\[L(x * v) = \text{BCH}(L(x), v),\]where \(v\) is embedded as a degree-1 element of the free Lie algebra.
Note
log_sigis expected in the Lyndon bracket basis (method=2output). You must callpysiglib.prepare_log_sig(dimension, degree, method=2)before using this function. This precomputes the Lyndon basis and BCH coefficients needed internally.- Parameters:
log_sig (numpy.ndarray | torch.tensor) – The existing truncated log-signature, of shape
(..., log_sig_length).displacement (numpy.ndarray | torch.tensor) – The displacement vector, of shape
(..., dimension). Leading batch dimensions must match those oflog_sig.dimension (int) – Dimension of the underlying space, \(d\).
degree (int) – Truncation level of the log-signature, \(N\).
n_jobs (int) – Number of threads to run in parallel. If n_jobs = 1, the computation is run serially. If set to -1, all available threads are used. For n_jobs below -1, (max_threads + 1 + n_jobs) threads are used. For example if n_jobs = -2, all threads but one are used.
- Returns:
Extended log-signature, \(L(x * v)\).
- Return type:
numpy.ndarray | torch.tensor
Example:#
import pysiglib import numpy as np dimension = 5 degree = 3 pysiglib.prepare_log_sig(dimension, degree, method=2) path = np.random.uniform(size=(100, dimension)) ls = pysiglib.log_sig(path, degree, method=2) displacement = np.random.uniform(size=(dimension,)) extended_ls = pysiglib.log_sig_join(ls, displacement, dimension, degree)
Citation#
If you found this library useful in your research, please consider citing the paper:
@article{shmelev2025pysiglib,
title={pySigLib-Fast Signature-Based Computations on CPU and GPU},
author={Shmelev, Daniil and Salvi, Cristopher},
journal={arXiv preprint arXiv:2509.10613},
year={2025}
}