Skip to main content

Python interface for cppkh Khovanov homology computation with runtime C++ compilation.

Project description

cppkh-interface

cppkh-interface is a Python package for computing integer Khovanov homology with the C++ cppkh implementation.

Version 0.1.2 resolves link crossing signs by tracing directed PD edge incidences with the SageMath convention. It does not infer signs from numeric arc-label ordering.

The package is compatible with the main javakh-interface function:

import cppkh_interface

pd_code = [[1, 5, 2, 4], [3, 1, 4, 6], [5, 3, 6, 2]]
print(cppkh_interface.solve_khovanov(pd_code, de_r1=True, de_k8=True))
print(cppkh_interface.solve_many_khovanov([pd_code, pd_code]))

Unlike wrappers that ship a prebuilt DLL or shared object, this package ships the cppkh C++ source file in built distributions and compiles a local executable on first use through cpp-simple-interface. The compiled executable is cached for later calls.

In the repository checkout, the package does not keep a committed backup copy of the C++ source. The build backend copies ../../src/main.cpp into the package data directory only while poetry build or poetry publish --build is running, then removes that temporary copy.

Install

pip install cppkh-interface

A g++ compatible compiler must be available at runtime. To select a compiler, set CXX before importing or calling the package:

CXX=clang++ python your_script.py

Windows PowerShell:

$env:CXX = "C:\path\to\g++.exe"
python your_script.py

Build And Publish

From this directory:

poetry build
poetry publish

Use poetry publish --build to build and upload in one command.

For local testing:

poetry run python -m cppkh_interface "[[1,5,2,4], [3,1,4,6], [5,3,6,2]]"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cppkh_interface-0.1.2.tar.gz (36.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cppkh_interface-0.1.2-py3-none-any.whl (36.5 kB view details)

Uploaded Python 3

File details

Details for the file cppkh_interface-0.1.2.tar.gz.

File metadata

  • Download URL: cppkh_interface-0.1.2.tar.gz
  • Upload date:
  • Size: 36.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.5 Windows/11

File hashes

Hashes for cppkh_interface-0.1.2.tar.gz
Algorithm Hash digest
SHA256 caac26b4ed8d09d46b49f89c08728eafb1780096e38e567d254878af05a829e4
MD5 288573ab58320376380fa05449293224
BLAKE2b-256 e00162ac11dec423716673ca77c160c0df72f97018e580a7286a8b0dea740d33

See more details on using hashes here.

File details

Details for the file cppkh_interface-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cppkh_interface-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 36.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.5 Windows/11

File hashes

Hashes for cppkh_interface-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 74a50e6e731a3aef678a113c443477619b2165627304746377c311eb3d2cdbf1
MD5 7453d8080dd16bcdf3009ef095e9b8b4
BLAKE2b-256 3c13e57377f01780dd8f82576eb5985d33c9acb4a72439a8982fd682ee94eea0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page