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.

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.1.tar.gz (35.0 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.1-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cppkh_interface-0.1.1.tar.gz
  • Upload date:
  • Size: 35.0 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.1.tar.gz
Algorithm Hash digest
SHA256 b07d37ad239cfb51a32f8634e43c990fd5733dbdf6338a7a50911f6c28d6c51a
MD5 3851755a897d6a659fec6240120a306b
BLAKE2b-256 853fdeca00aa79b282c1a6b9dbe581e93081d92be66068cfa5072359343c638f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cppkh_interface-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 35.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88a74dff08afdd40f8f118b585103a1c75a189eb8fc9763dd13f13b657305306
MD5 11716a422c6ca70a3badcb993ad22099
BLAKE2b-256 dc8f43b9c1a9ccf0b036bf0062f41fc1a7469a3e135a8bcb076a63e8edf2cade

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