क्षण — Sanskrit for the precise instant, the smallest measure of time.
Open, reproducible PNT (positioning, navigation and timing) resilience simulation with published quantum-sensor performance models.
Kshana is an open, reproducible PNT-resilience simulator with quantum-sensor
performance models — PNT being positioning, navigation, and timing. This package is a thin
PyO3 (abi3, the stable Python binary interface) wrapper over the
same Rust engine: you pass a scenario TOML (Tom's Obvious, Minimal Language) string in and get a reproducible JSON (JavaScript Object Notation) result back. It quantifies, in hard numbers,
what quantum clocks, quantum inertial sensors, and optical time-transfer buy a
navigation system over classical PNT. Every result is reproducible from
scenario + seed + engine version, and every sensor parameter is traceable to a
published source.
Validated, not asserted. 666/666 AIAA (American Institute of Aeronautics and Astronautics) SGP4 (Simplified General Perturbations 4, the standard satellite-orbit propagator) vectors to 4.12 mm · Cowell force model 0.08 m vs Orekit 12.2 · Galileo 0.61 m / Swarm-A 0.10 m vs real ESA (European Space Agency) precise ephemerides · GCRS→ITRS (Geocentric Celestial Reference System to International Terrestrial Reference System) bit-for-bit vs SOFA/ERFA (the International Astronomical Union's Standards of Fundamental Astronomy library and its open port, Essential Routines for Fundamental Astronomy) · ML (machine-learning) metrics exact vs scikit-learn · 66 of 174 capabilities validated against independent external oracles; 104 honestly labelled Modelled, 4 partner-owned.
Validated against external oracles — every row gated in continuous integration
Each row is checked against an independent external oracle (real dataset, independent reference implementation, or published reference vectors) and re-checked in CI (continuous integration).
| Capability | Result | External oracle | |
|---|---|---|---|
| ✅ | SGP4/SDP4 (Simplified Deep-space Perturbations 4) propagation | 666/666 vectors, worst 4.12 mm | AIAA 2006-6753 (Vallado) + independent sgp4 crate |
| ✅ | Numerical Cowell force model | 0.08 m / 24 h, 275 epochs | Orekit 12.2 DormandPrince853 (CS GROUP) |
| ✅ | Orbit fit vs precise ephemeris | Galileo 0.61 m · Swarm-A 0.10 m | ESA/ESOC (European Space Operations Centre) SP3 (the Standard Product 3 precise-orbit format of the International GNSS Service, GNSS being Global Navigation Satellite System) precise orbits |
| ✅ | GCRS→ITRS frame chain | bit-for-bit vs SOFA; ≤ 0.86 m vs SPICE (Spacecraft, Planet, Instrument, C-matrix, Events — the planetary-geometry toolkit) | ERFA/SOFA + ANISE (Attitude, Navigation, Instrument, Spacecraft, Ephemeris — a pure-Rust SPICE) |
| ✅ | Allan deviations | reproduce reference deviations | NIST SP 1065 (National Institute of Standards and Technology Special Publication 1065) + Stable32 on a real Cs (caesium) clock |
| ✅ | GNSS DOP (dilution of precision) · ML detector metrics | to 1e-6 · to 1e-9 | gnss_lib_py · scikit-learn |
Install
pip install kshana
Wheels are built for Linux, macOS, and Windows on each release tag. To build from
source instead, use maturin: pip install maturin && maturin develop --features python.
Usage
The example is complete: it carries its own scenario, so it runs as written with nothing else on disk.
import json, kshana
# A complete scenario, not a sketch: scenarios/clock-holdover.toml without its comment
# lines. It runs 2 h, 10 min of GNSS then about 1.8 h with GNSS denied, and asks how long
# a strontium optical clock and a chip-scale atomic clock (CSAC) each hold time to within
# 20 ns. sigma_y(1s) is a clock's Allan deviation at an averaging time of one second;
# q_wf, the white-frequency-noise intensity, is its square.
toml = """
seed = 42
threshold_ns = 20.0
[time]
step_s = 10.0
duration_s = 7200.0
[gnss]
windows = [
{ t0 = 0.0, t1 = 600.0, state = "nominal" },
{ t0 = 600.0, t1 = 7200.0, state = "denied" },
]
[clock_quantum]
id = "optical-sr-lattice"
provenance = "Strontium optical lattice clock, space-oriented goal sigma_y(1s)=1e-15 (Origlia/Schiller/Bongs et al., arXiv:1503.08457); q_wf=sigma_y(1s)^2; ground-demonstrator maturity, not flown; flicker/aging not modeled"
y0 = 5.0e-17
q_wf = 1.0e-30
q_rw = 0.0
[clock_classical]
id = "csac-sa45s"
provenance = "Microchip SA65 / SA.45s CSAC datasheet sigma_y(1s)=3e-10; q_wf=sigma_y(1s)^2; flicker/aging not modeled"
y0 = 5.0e-10
q_wf = 9.0e-20
q_rw = 0.0
"""
result = json.loads(kshana.run(toml)) # the full result document
print(result["quantum"]["fom"]["integrity"])
# The JSON result, the chart as SVG (Scalable Vector Graphics) and a one-line summary,
# all from one engine run:
result_json, chart_svg, summary = kshana.run_full(toml)
print(kshana.version(), summary)
Every other reference scenario is a file under
scenarios/ in the repository;
pass its text to kshana.run the same way. With the Rust command-line interface (CLI)
installed, kshana example <name> prints any of them.
Beyond run / run_full / version, the module exposes run_typed (a structured
result object), validate_toml (lint → list of error strings), scenario_kinds (the
dispatchable kinds as a Python list of dictionaries), list_kinds (the same metadata as
one JSON string — kept as a string so existing callers do not break; call
json.loads(kshana.list_kinds()), or use scenario_kinds() for the parsed list), and
error_kind (the KshanaError tag for a rejected scenario) — see
docs/PYTHON_API.md.
Every figure of merit is labelled validated or modelled; optical-clock figures are space goals on ground hardware (no strontium optical clock has flown). Maturity is not uniform across domains — Earth PNT is real-data validated; deep-space / Mars navigation is simulation-validated; real-mission deep-space OD (orbit determination) is on the roadmap.
Learn more
- Full README & validation matrix → https://github.com/AshfordeOU/kshana
- Live playground (runs in your browser as WebAssembly) → https://kshana.dev
- Python application programming interface (API) → docs/PYTHON_API.md
- Capabilities → docs/CAPABILITY.md
- Validation & provenance → docs/VALIDATION.md · docs/PROVENANCE.md
Licence
Free and open source under the GNU AGPL-3.0-only (the GNU Affero General Public License, version 3 only). A commercial licence is available from Ashforde OÜ (an Estonian private limited company; OÜ = osaühing) for proprietary/closed integration — see LICENSING.md. Professionally developed and maintained by Ashforde OÜ; commercial support, integration, and proprietary extensions available.
Metadata
Release files for kshana 0.28.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kshana-0.28.0.tar.gz | 3.3 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| kshana-0.28.0-cp39-abi3-win_arm64.whl | CPython 3.9 | abi3 | Windows ARM64 | Details |
| kshana-0.28.0-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| kshana-0.28.0-cp39-abi3-manylinux_2_28_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| kshana-0.28.0-cp39-abi3-manylinux_2_28_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ ARM64 | Details |
| kshana-0.28.0-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| kshana-0.28.0-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 20.9 MB
Release files / kshana-0.28.0.tar.gz
| Download URL | kshana-0.28.0.tar.gz |
|---|---|
| Size | 3.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7cfc85327efff25ec3fe946ea5eff31d6df49d9db0be51fae05aac103c7a8618
|
|
BLAKE2b-256 checksum How to use checksums |
6d703e8ac4f760efd0d63a53ec9d1820a87dcaf5dd0d76dc4ac9788e9595b05e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / kshana-0.28.0-cp39-abi3-win_arm64.whl
| Download URL | kshana-0.28.0-cp39-abi3-win_arm64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.9 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
c2c97170f01c5bc226f28d7344941a2dfa906fb30f96cf921a8587e5fa2e5dd8
|
|
BLAKE2b-256 checksum How to use checksums |
b14a6a850739f31173e162bb2c588890161fb445797e139313bbe66ee7a3d6ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / kshana-0.28.0-cp39-abi3-win_amd64.whl
| Download URL | kshana-0.28.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
8898a257820f1cc541e65046a1fad0eceb9f6c8abb43a34573152683e6e8f571
|
|
BLAKE2b-256 checksum How to use checksums |
d45703334f7c010ab08041dd0a51329d88342b7997a27995dd75b3abf0cb028f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / kshana-0.28.0-cp39-abi3-manylinux_2_28_x86_64.whl
| Download URL | kshana-0.28.0-cp39-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
a839c1e8e65eab5c817d4057077e8d319510563301dbfceb6f8a3796f320b3bc
|
|
BLAKE2b-256 checksum How to use checksums |
a049101e386d36fd8b20fbdb134dc3385fafb0f162cf1247bb313fc9e34d1f10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / kshana-0.28.0-cp39-abi3-manylinux_2_28_aarch64.whl
| Download URL | kshana-0.28.0-cp39-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
3121a557898c59ebe389b5917e3c7b49f70958e5588637f40458f859668e4995
|
|
BLAKE2b-256 checksum How to use checksums |
325eba77acd973cde45c85fce266e5d767738ba0b6f839186efcf06b5321f898
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / kshana-0.28.0-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | kshana-0.28.0-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
371bfb46c75e7a6b80e34c3917921bb5c6c5430eba43926f4a683f561d332030
|
|
BLAKE2b-256 checksum How to use checksums |
7ff73a1c2a6a100ccb1fd35559d2d5c157f358574ac38b685e2f480a0bc7db2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / kshana-0.28.0-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | kshana-0.28.0-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
c33052e7224f5bea9dede462742520aeecd43d2f6c3275716be7bd8d9fbcb34f
|
|
BLAKE2b-256 checksum How to use checksums |
cd29a31fa67687080ce8c2ebef810cec9c0c0f9bd89d229fcd9847d8216a46e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|