Swarmauri Matrix Hamming(7,4)
The swarmauri_matrix_hamming74 package provides a binary Hamming (7,4) code matrix that extends MatrixBase. It includes generator and parity-check representations, encoding and decoding helpers, and tight integration with the swarmauri_metric_hamming package for error detection and correction workflows.
Features
- 🧮 Binary matrix implementation built on
MatrixBasewith full indexing and arithmetic support. - 🧷 Generator and parity-check matrix accessors for classic Hamming (7,4) coding schemes.
- 📨 Encoding, syndrome calculation, and nearest-codeword decoding helpers powered by the Hamming metric.
- 🔁 Binary-safe matrix operations (addition, subtraction, multiplication, and matrix multiplication modulo 2).
Installation
Using uv
uv pip install swarmauri_matrix_hamming74
Using pip
pip install swarmauri_matrix_hamming74
Usage
from swarmauri_matrix_hamming74 import Hamming74Matrix
matrix = Hamming74Matrix()
message = [1, 0, 1, 1]
codeword = matrix.encode(message)
# Introduce a single-bit error
received = codeword.copy()
received[3] ^= 1
# Decode using syndrome lookup and Hamming distance search
nearest = matrix.nearest_codeword(received)
print(nearest) # Recovers the original codeword
Support
- Python 3.10, 3.11, and 3.12
- Licensed under the Apache-2.0 license
Contributing
We welcome contributions! Please submit issues and pull requests through the Swarmauri SDK GitHub repository.
Metadata
Release files for swarmauri_matrix_hamming74 0.9.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swarmauri_matrix_hamming74-0.9.3.tar.gz | 8.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swarmauri_matrix_hamming74-0.9.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.2 kB
Release files / swarmauri_matrix_hamming74-0.9.3.tar.gz
| Download URL | swarmauri_matrix_hamming74-0.9.3.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3e9493da99dbdd0a21524163d2663516d252d8434c7563ae657f77df1122d9e
|
|
BLAKE2b-256 checksum How to use checksums |
5fad83e6f5d1e7547e2731c7570db20fff981a97f3041889657b9e95223336ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / swarmauri_matrix_hamming74-0.9.3-py3-none-any.whl
| Download URL | swarmauri_matrix_hamming74-0.9.3-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23c6fe92466dc1b7a69b6810772314843b19e38756aa5258c4321ac4615c0f54
|
|
BLAKE2b-256 checksum How to use checksums |
35185818c324015c5787c38fdd53c13505d0d29adaf0710e4cc4b1f7bb5af7b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|