An open source library for Order Truncated Imaginary (OTI) Numbers. An algebra for efficient arbitrary-order, multivariate differentiation.
Useful links:
- Documentation (work in progress)
- Theory, references, lecture notes and other information on Hypercomplex-based Automatic Differentiation HYPAD.
OTILIB
This is the repository of the Order Truncated Imaginary numbers (OTI numbers) implemented in different programming languages. OTI numbers, initially developed in the Ph.D. thesis "Order Truncated Imaginary Algebra for Computation of Multivariable High-Order Derivatives in Finite Element Analysis". OTI numbers are an extension of Dual numbers, which can be used to compute high-order derivatives with respect to multiple variables. In contrast to the Dual numbers (
This library provides multiple implementations of OTI numbers. A core implementation is provided in C that supports various techniques to efficiently treat scalar and array operations such as matrix multiplication, vector dot product, vector array operations, etc.
Ongoing research and updates are currently focused to improve efficiency of the Python and Fortran implementation of OTIs.
Currently three implementations are supported:
- Dynamic-Dense (outdated),
- Static-Dense (modern, fastest) and
- Dynamic-Sparse (Slower, but the most versatile and robust)
Most operations implemented so far are serial, and some support OpenMP parallelization. It is expected in the near future to fully support parallel excecution using OpenMP, MPI and GPU parallelization (OpenCL/CUDA/Metal, to be defined).
- C (C99) for core routines.
- Python (Version 3 or newer. This library requires Cython
- Fortran (F95 or newer, static dense implementation)
For more detailed instructions, see installation
This library has been tested on:
- Unix platforms.
- macOS (Tested on Sonoma 14.5)
- Windows (Only working under WSL)
- Create the conda environment with dependencies from the
environment.yml
file:
conda env create -f environment.yml
conda activate pyoti
- Create a
build
directory within the library's master folder, and configure the compilation usign CMake:
cd path/to/src/otilib
mkdir build
cd build
cmake ..
make
- Generate the precomputed data using the following command:
make gendata
- Add the current folder to the conda path using :
conda activate pyoti
conda develop .
The current version depends on stdlib.h
and math.h
Requirements:
- Numpy
- Scipy
- Cython (For compilation only)
- CMake (For compilation only)
For the full Finite Element support, the following libraries are required.
- PyVista
- GMSH (and Python-GMSH)
- scikit-umfpack
- scikit-sparse
- vtk
- To be defined
- Report an issue using the Github interface, and this will be addressed in an orderly fashion.