Skip to main content

A Python Package for Quantum Key Distribution

Project description

QKDpy: Quantum Key Distribution Library

License Python CI Release Documentation

QKDpy is a comprehensive Python library for Quantum Key Distribution (QKD) simulations, implementing various QKD protocols, quantum simulators, and cryptographic tools. It provides an intuitive API similar to NumPy, TensorFlow, and scikit-learn, making quantum cryptography accessible to developers and researchers.

Features

  • Quantum Simulation: Simulate qubits, quantum gates, and measurements
  • QKD Protocols: Implementations of BB84, E91, SARG04, and more
  • Key Management: Error correction and privacy amplification algorithms
  • Cryptographic Tools: One-time pad encryption and authentication using quantum keys
  • Visualization: Tools to visualize quantum states and protocol execution
  • Extensible Design: Easy to add new protocols and features
  • Performance: Efficient implementations for simulations

Installation

QKDpy requires Python 3.10 or higher. We recommend using uv for package management:

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone the repository
git clone https://github.com/yourusername/qkdpy.git
cd qkdpy

# Install in development mode
uv pip install -e .

Quick Start

Here's a simple example of using the BB84 protocol to generate a secure key:

from qkdpy import BB84, QuantumChannel

# Create a quantum channel with some noise
channel = QuantumChannel(loss=0.1, noise_model='depolarizing', noise_level=0.05)

# Create a BB84 protocol instance
bb84 = BB84(channel, key_length=100)

# Execute the protocol
results = bb84.execute()

# Print the results
print(f"Generated key: {results['final_key']}")
print(f"QBER: {results['qber']:.4f}")
print(f"Is secure: {results['is_secure']}")

For more examples, see the examples directory.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

QKDpy is licensed under the Apache License 2.0. See LICENSE for the full license text.

Citation

If you use QKDpy in your research, please cite it as described in CITATION.cff.

Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code.

Contact

For questions, suggestions, or issues, please open an issue on GitHub.

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

qkdpy-0.1.8.tar.gz (37.9 kB view details)

Uploaded Source

Built Distribution

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

qkdpy-0.1.8-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file qkdpy-0.1.8.tar.gz.

File metadata

  • Download URL: qkdpy-0.1.8.tar.gz
  • Upload date:
  • Size: 37.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for qkdpy-0.1.8.tar.gz
Algorithm Hash digest
SHA256 a3c19728e7bdbe503faf985d22eca02176985371da3882b3b218099ac724df46
MD5 fd8f8d71a6caaa6a9871893e875760af
BLAKE2b-256 b5f017c5fb220bcfa30a20a27f1502725910ecef1e61da3cac56da914d203451

See more details on using hashes here.

Provenance

The following attestation bundles were made for qkdpy-0.1.8.tar.gz:

Publisher: release.yml on Pranava-Kumar/qkdpy

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

File details

Details for the file qkdpy-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: qkdpy-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for qkdpy-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 e9db1de4502b307657760e8cdca421ece7c2f8b275e4fabc3b4c8247a0e2f739
MD5 72908f854f65ba75baed464bf6f5b012
BLAKE2b-256 f6f95dcf4377e218774d01a6f29fbbda4a9e2345ad47c41d72519174a1e9e498

See more details on using hashes here.

Provenance

The following attestation bundles were made for qkdpy-0.1.8-py3-none-any.whl:

Publisher: release.yml on Pranava-Kumar/qkdpy

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