Skip to main content

Add-on implementation of frequency compensation for qcrypto.

Project description

fpfind

An add-on implementation of frequency compensation for qcrypto.

Installation

pip3 install fpfind

Requirements:

  • Python 3.8 and above, running in Linux
  • gcc (if running freqcd, preferably in PATH for auto-compilation)

The stable releases are tagged and listed here.

Usage

Binaries and scripts are defined in pyproject.toml and will be exposed to the path; commonly used scripts are listed below.

# For general timestamp viewing
parse-timestamps {TIMESTAMPS}
show-timestamps {TIMESTAMPS}

# For frequency compensation (and in context of coincidence finding)
fpfind -t {TIMESTAMPS1} -T {TIMESTAMPS2}
freqcd -X -udF fpipe -f 568 < {TIMESTAMPS}
[costream -V5 ... |] freqservo -V5 -udF fpipe -f 568

See Hints for usage hints.

Upgrading

See Migration for moving between major versions, e.g. v2 to v3.

Motivation

Quantum key distribution requires some form of clock synchronization to retain high signal-noise ratio when pairing photon detection/generation events. This is usually achieved by having a stable clock (e.g. Rb clock, GPS receiver) or a separate clock transfer channel.

Timing correlated photons used in the QKD itself can also be used as a resource for clock synchronization, by identifying and tracking the timing delay $\tau$ using the second-order coherence $g^{(2)}(\tau)$. The timing drift in the signal indicates a frequency offset/drift between the two parties, which can be corrected with a feedback loop. This opens up the use of clock references with weaker frequency stability like quartz clocks.

This library implements the frequency compensation modules supplementing the core qcrypto QKD software stack, and a reference usage can be found in QKDServer.

Schematic

Components for frequency compensation (implemented in this library) are highlighted in yellow below.

In particular:

  • freqcd.c performs frequency correction
  • fpfind.py replaces pfind.c for initial frequency estimation
  • freqservo.py performs frequency drift estimation

Limitations

  • The FFT buffer size is limited to 2**31 bins due to the implicit casting to int32 performed internally by np.bincount on older versions of numpy. This corresponds to a buffer order value upper bounded to q = 31 for fpfind. To bypass this limitation, supply an alternative implementation for np.bincount.

Troubleshooting

Certain issues may appear when attempting an install on RaspbianOS:

  • Importing numpy yields the error message stating libopenblas.so could not be found (this is the underlying linear algebra library for Numpy); installing the libopenblas-dev library fixes this, e.g. apt install libopenblas-dev

Contributing

Version tags (as of v2) follow romantic versioning (a variation on semantic versioning). In the SemVer language: PATCH is incremented for non-breaking changes, MINOR for breaking changes that are easy to patch downstream, and MAJOR is reserved for large breaking changes that require careful syntax adjustments.

Dynamic versioning is handled by poetry, so bumping the version simply involves adding a lightweight git tag (with "v" prepended, e.g. git tag {VERSION} [COMMIT]). Local version modifiers (e.g. dates) are removed for compatibility with PyPI rules.

Commit messages to roughly follow Angular commit message guidelines (which aligns with the Conventional Commits specification). The type should be one of the following: feat, fix, chore, test, docs, build, ci. If a scope is provided, it should be one of:

  • fpfind
  • fpplot
  • freqcd
  • freqservo
  • parser (for both timestamp and epoch)

Commit messages can be automatically checked using pre-commit, after installing:

pre-commit install

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

fpfind-3.3.5.tar.gz (73.0 kB view details)

Uploaded Source

Built Distribution

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

fpfind-3.3.5-py3-none-any.whl (83.1 kB view details)

Uploaded Python 3

File details

Details for the file fpfind-3.3.5.tar.gz.

File metadata

  • Download URL: fpfind-3.3.5.tar.gz
  • Upload date:
  • Size: 73.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fpfind-3.3.5.tar.gz
Algorithm Hash digest
SHA256 7583ba0f1aa9ff4efa6e80aff1a699c119201add317e4c1e5f5b1b7fff561c01
MD5 dacd74473cba8a52d1ac699a0a0ed436
BLAKE2b-256 c86e94c67efb3ed9494c72534298c8f86758ccc8b3d300005e700fca272f6117

See more details on using hashes here.

Provenance

The following attestation bundles were made for fpfind-3.3.5.tar.gz:

Publisher: release.yaml on s-fifteen-instruments/fpfind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fpfind-3.3.5-py3-none-any.whl.

File metadata

  • Download URL: fpfind-3.3.5-py3-none-any.whl
  • Upload date:
  • Size: 83.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fpfind-3.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a6a1bc03d1954229fe80e2fce554832a9653e1d2823a13c0a5db37e09727e2b8
MD5 b04e25b919527349bce0f9d90ee407e0
BLAKE2b-256 2b873f47f85b74a5eb713f8ac93e0eb7d7b7320bdd223226001b5da020bf4a54

See more details on using hashes here.

Provenance

The following attestation bundles were made for fpfind-3.3.5-py3-none-any.whl:

Publisher: release.yaml on s-fifteen-instruments/fpfind

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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