Skip to main content

H-Signature

A C++ or Python Library for computing the h-signature as defined in [1].

What is the H-signature? In the simplest case, it tells you whether two closed 3D curves are linked, or unlinked. The figure below shows some examples. Four visual examples of the H-signature

In the general case, the H-signature is computed between one closed curve $\tau$ and a skeleton of closed curves $S=\{S_1,\dots,S_m\}$. In code, each curve is a matrix of [3xN] (C++) or [Nx3] (Python) where N is the number of points in the curve. The H-signature is a vector (ordered list) of integers, where each element correspond to the h-signature of $\tau$ with respect to one curve in $S$.

Installation

For python:

pip install h-signature

For C++:

# The only option we offer is building from source with cmake 
git clone git@github.com:UM-ARM-Lab/h-signature.git
cd h-signature
mkdir build
# The only dependency is Eigen3
sudo apt install libeigen3-dev
# Build and run tests
cd build
cmake ..
make
ctest

API

There is only one function!

# Python with numpy
from h_signature.h_signature_np import get_h_signature
# Tau is an [Nx3] numpy array and skeleton is a dict of [3xN] numpy arrays
h_sig = get_h_signature(tau, skeleton)
print(h_sig)
// C++ with Eigen
#include <h_signature/h_signature.hpp>
// The above header has these typedefs
// typedef Eigen::Matrix3Xd Loop;
// typedef std::map<std::string, Eigen::Matrix3Xd> Skeleton;

// And this is the function, that's it! 
HSignature get_h_signature(Loop const &loop, Skeleton const & skeleton);

Citation

Metadata

Release files for h-signature 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for h-signature 0.0.5
File Size Uploaded Provenance
h_signature-0.0.5.tar.gz 4.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for h-signature 0.0.5
File Interpreter ABI Platform
h_signature-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / h_signature-0.0.5.tar.gz

Download URL h_signature-0.0.5.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e7bab0d3ec1f9fc11c90454970bf363321845815af3677b601894bf4d462b8fc
BLAKE2b-256 checksum
How to use checksums
df5bedffe55ce015a9789733bec6d4c4ccf5398e7e3747009614b33622c52f18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / h_signature-0.0.5-py3-none-any.whl

Download URL h_signature-0.0.5-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
125483a1fe5721d5a76a7c7c442a8d88711d1bef93da10da1690301cd749fa4a
BLAKE2b-256 checksum
How to use checksums
8c945bda44b7763baa5f56915b1ef5763be4be04364d5c0497518f3b2b5714aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Security for h-signature 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page