Datasets:
Formats:
json
Languages:
English
Size:
< 1K
ArXiv:
Tags:
mathematics
finite-fields
matrix-rank
arithmetic-carries
bernoulli-numbers
symbolic-computation
Download examples/quickstart.py from PureOne/Qeira-II-Carry-Holonomy-Rank-Law: direct link, hf CLI and curl.
- Browser
- Download file 912 Bytes
-
https://huggingface.co/datasets/PureOne/Qeira-II-Carry-Holonomy-Rank-Law/resolve/main/examples/quickstart.py
- Command line
-
hf download hf://datasets/PureOne/Qeira-II-Carry-Holonomy-Rank-Law/examples/quickstart.py
-
curl -L -o quickstart.py https://huggingface.co/datasets/PureOne/Qeira-II-Carry-Holonomy-Rank-Law/resolve/main/examples/quickstart.py
912 Bytes
| """A small exact-arithmetic example; no third-party dependencies.""" | |
| from pathlib import Path | |
| import sys | |
| sys.path.insert(0, str(Path(__file__).resolve().parents[1])) | |
| from carry_rank import carry, carry_from_defect, defect_coefficients, exact_rank, old_bound | |
| def main(): | |
| for p, r in [(5, 2), (37, 1), (37, 2), (37, 3), (521, 2)]: | |
| print(f'p={p}, r={r}: rank={exact_rank(p, r)}, proposed={old_bound(p, r)}') | |
| p = 37 | |
| x, y = [36, 35], [34, 33] | |
| direct = carry(x, y, p) | |
| recovered = carry_from_defect(x, y, p) | |
| print(f'First carry for x={x}, y={y}: {direct}; defect formula: {recovered}') | |
| assert direct == recovered | |
| print('Missing degree at p=37:', [d for d in range(3, p-1, 2) | |
| if defect_coefficients(p)[d] == 0]) | |
| print('p=521,r=2 above is a formula evaluation; the full matrix is not constructed.') | |
| if __name__ == '__main__': | |
| main() | |