# ๐ Quantum RNG
A high-performance quantum-inspired random number generator that leverages quantum mechanical principles in classical computing environments. This library simulates quantum phenomena on classical hardware to generate high-quality random numbers with proven entropy characteristics.
## โจ Features
- Quantum-inspired random number generation using simulated quantum effects:
- Quantum superposition
- State vector evolution
- Quantum entanglement
- Decoherence simulation
- High entropy output (63.999872 bits/sample)
- Comprehensive test suite with statistical validation
- Extensive documentation and examples
- Cross-platform C implementation
- Hardware-optimized performance
## โก Performance
- 4.82M operations per second
- 178.45 MB/sec throughput
- ~4KB context size
- Optimized for L1 cache usage
- Verified non-deterministic output
- Competitive with leading classical RNGs while providing quantum properties
## ๐ ๏ธ Installation
```bash
# Clone the repository
git clone https://github.com/tsotchke/quantum_rng.git
cd quantum_rng
# Build the library and examples
make
```
## ๐ Quick Start
```c
#include <quantum_rng.h>
int main() {
qrng_ctx *ctx;
qrng_error err;
// Initialize RNG
err = qrng_init(&ctx, NULL, 0);
if (err != QRNG_SUCCESS) {
fprintf(stderr, "Failed to initialize: %s\n", qrng_error_string(err));
return 1;
}
// Generate random numbers
printf("Random uint64: %lu\n", qrng_uint64(ctx));
printf("Random double: %f\n", qrng_double(ctx));
printf("Random range [1,6]: %d\n", qrng_range(ctx, 1, 6));
// Cleanup
qrng_free(ctx);
return 0;
}
```
## ๐ Documentation
- [Quantum RNG Deep Dive](docs/quantum_rng.md) - Comprehensive explanation of the quantum RNG's principles, advantages, and impact
- [API Reference](docs/api_reference.md) - Detailed API documentation with examples
- [Quantum Principles](docs/quantum_principles.md) - Technical details of quantum simulation
- [Performance Analysis](docs/performance_analysis.md) - Detailed performance metrics and comparisons
## ๐ก Examples
### ๐ Cryptography
The initial release includes two cryptographic examples that demonstrate the library's capabilities in security applications:
#### Key Derivation
- Implementation: [examples/crypto/key_derivation.c](examples/crypto/key_derivation.c)
- Tests: [examples/crypto/key_derivation_test.c](examples/crypto/key_derivation_test.c)
- Analysis: [examples/crypto/key_derivation_analysis.md](examples/crypto/key_derivation_analysis.md)
Features:
- Quantum-enhanced key derivation
- Multiple iterations showing optimization progress
- Comprehensive test suite
- Performance analysis
#### Key Exchange
- Implementation: [examples/crypto/key_exchange.c](examples/crypto/key_exchange.c)
- Tests: [examples/crypto/key_exchange_test.c](examples/crypto/key_exchange_test.c)
- Analysis: [examples/crypto/key_exchange_analysis.md](examples/crypto/key_exchange_analysis.md)
Features:
- Secure key exchange protocol
- Quantum entropy integration
- Test suite with security verification
- Performance benchmarks
### ๐น Finance
#### Monte Carlo Simulation
- Implementation: [examples/finance/monte_carlo.c](examples/finance/monte_carlo.c)
- Header: [examples/finance/monte_carlo.h](examples/finance/monte_carlo.h)
- Analysis: [examples/finance/monte_carlo_analysis.md](examples/finance/monte_carlo_analysis.md)
Features:
- Advanced financial modeling using quantum randomness
- Efficient path generation
- Statistical analysis tools
- Performance optimizations
- Comprehensive documentation
### ๐ฒ Games
#### Quantum Dice
- Implementation: [examples/games/quantum_dice.c](examples/games/quantum_dice.c)
- Header: [examples/games/quantum_dice.h](examples/games/quantum_dice.h)
A simple but effective demonstration of the RNG in action:
- Fair dice rolling implementation
- Configurable sides (d4, d6, d8, d10, d12, d20, etc.)
- Statistical distribution tests
- Example of basic RNG usage
## ๐งช Testing
The library includes a comprehensive test suite:
```bash
# Run all tests
make test
# Run specific test suites
./tests/comprehensive_test # Full functionality verification
./tests/edge_cases_test # Edge case handling
./tests/test_quantum_rng # Core RNG validation
```
### Statistical Testing
```bash
# Run statistical tests
./tests/statistical/statistical_tests
# Run quantum property verification
./tests/quantum_stats
```
## ๐ Performance Testing
```bash
# Run full benchmark suite
make benchmark
./benchmark_suite
# Run specific benchmarks
./tests/benchmark_matrix # Matrix operation performance
```
## ๐ฎ Future Improvements
We have several exciting examples and applications in development that will be released soon:
### Finance Applications
- Options Pricing - Black-Scholes model with quantum entropy
- Quantum Portfolio - Portfolio optimization using quantum principles
- Heston Model - Stochastic volatility modeling
### Game Development
- Quantum Evolution - Evolutionary algorithms with quantum randomness
- Particle System - Physics-based particle simulation
- Procedural Worlds - Terrain and world generation
- Quantum Slots - Fair slot machine implementation
- Terrain Generation - Advanced landscape generation
- Loot System - Fair item drop system
### Machine Learning
- Quantum Transformer - RNG-enhanced transformer architecture
- Neural Initialization - Quantum-inspired weight initialization
- Quantum GAN - Generative adversarial network with quantum noise
### Scientific Applications
- Molecular Dynamics - Particle simulation
- Quantum Walk - Random walk implementations
- Weather Simulation - Atmospheric modeling
- Quantum Noise - Advanced noise generation
### Networking
- Quantum Routing - Network routing algorithms
- Traffic Simulation - Network traffic modeling
Each of these examples will be thoroughly tested and documented before release, demonstrating the versatility of the Quantum RNG library across different domains.
## ๐ค Contributing
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details on:
- Code style and standards
- Testing requirements
- Documentation expectations
- Pull request process
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐ Acknowledgments
- Nielsen & Chuang's "Quantum Computation and Quantum Information"
- The quantum computing research community
- All contributors and testers
## ๐ Citation
If you use this library in your research, please cite:
```bibtex
@software{quantum_rng,
title = {Semi-Classical Quantum Random Number Generator With Examples},
author = {tsotchke},
year = {2024},
url = {https://github.com/tsotchke/quantum_rng}
}
```
Raw data
{
"_id": null,
"home_page": null,
"name": "semi-classicalqrng-py-bindings",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "random, number, generator, quantum, cryptography",
"author": null,
"author_email": "Your Name <you@example.com>",
"download_url": "https://files.pythonhosted.org/packages/0e/f4/7e9f32cbcca9c5ec3dd2902c4ad46955aff0e49a32f74b7fbf48b6f8a769/semi_classicalqrng_py_bindings-1.1.0.tar.gz",
"platform": null,
"description": "# \ud83c\udf0c Quantum RNG\n\nA high-performance quantum-inspired random number generator that leverages quantum mechanical principles in classical computing environments. This library simulates quantum phenomena on classical hardware to generate high-quality random numbers with proven entropy characteristics.\n\n## \u2728 Features\n\n- Quantum-inspired random number generation using simulated quantum effects:\n - Quantum superposition\n - State vector evolution\n - Quantum entanglement\n - Decoherence simulation\n- High entropy output (63.999872 bits/sample)\n- Comprehensive test suite with statistical validation\n- Extensive documentation and examples\n- Cross-platform C implementation\n- Hardware-optimized performance\n\n## \u26a1 Performance\n\n- 4.82M operations per second\n- 178.45 MB/sec throughput\n- ~4KB context size\n- Optimized for L1 cache usage\n- Verified non-deterministic output\n- Competitive with leading classical RNGs while providing quantum properties\n\n## \ud83d\udee0\ufe0f Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/tsotchke/quantum_rng.git\ncd quantum_rng\n\n# Build the library and examples\nmake\n```\n\n## \ud83d\ude80 Quick Start\n\n```c\n#include <quantum_rng.h>\n\nint main() {\n qrng_ctx *ctx;\n qrng_error err;\n \n // Initialize RNG\n err = qrng_init(&ctx, NULL, 0);\n if (err != QRNG_SUCCESS) {\n fprintf(stderr, \"Failed to initialize: %s\\n\", qrng_error_string(err));\n return 1;\n }\n \n // Generate random numbers\n printf(\"Random uint64: %lu\\n\", qrng_uint64(ctx));\n printf(\"Random double: %f\\n\", qrng_double(ctx));\n printf(\"Random range [1,6]: %d\\n\", qrng_range(ctx, 1, 6));\n \n // Cleanup\n qrng_free(ctx);\n return 0;\n}\n```\n\n## \ud83d\udcda Documentation\n\n- [Quantum RNG Deep Dive](docs/quantum_rng.md) - Comprehensive explanation of the quantum RNG's principles, advantages, and impact\n- [API Reference](docs/api_reference.md) - Detailed API documentation with examples\n- [Quantum Principles](docs/quantum_principles.md) - Technical details of quantum simulation\n- [Performance Analysis](docs/performance_analysis.md) - Detailed performance metrics and comparisons\n\n## \ud83d\udca1 Examples\n\n### \ud83d\udd12 Cryptography\n\nThe initial release includes two cryptographic examples that demonstrate the library's capabilities in security applications:\n\n#### Key Derivation\n- Implementation: [examples/crypto/key_derivation.c](examples/crypto/key_derivation.c)\n- Tests: [examples/crypto/key_derivation_test.c](examples/crypto/key_derivation_test.c)\n- Analysis: [examples/crypto/key_derivation_analysis.md](examples/crypto/key_derivation_analysis.md)\n\nFeatures:\n- Quantum-enhanced key derivation\n- Multiple iterations showing optimization progress\n- Comprehensive test suite\n- Performance analysis\n\n#### Key Exchange\n- Implementation: [examples/crypto/key_exchange.c](examples/crypto/key_exchange.c)\n- Tests: [examples/crypto/key_exchange_test.c](examples/crypto/key_exchange_test.c)\n- Analysis: [examples/crypto/key_exchange_analysis.md](examples/crypto/key_exchange_analysis.md)\n\nFeatures:\n- Secure key exchange protocol\n- Quantum entropy integration\n- Test suite with security verification\n- Performance benchmarks\n\n### \ud83d\udcb9 Finance\n\n#### Monte Carlo Simulation\n- Implementation: [examples/finance/monte_carlo.c](examples/finance/monte_carlo.c)\n- Header: [examples/finance/monte_carlo.h](examples/finance/monte_carlo.h)\n- Analysis: [examples/finance/monte_carlo_analysis.md](examples/finance/monte_carlo_analysis.md)\n\nFeatures:\n- Advanced financial modeling using quantum randomness\n- Efficient path generation\n- Statistical analysis tools\n- Performance optimizations\n- Comprehensive documentation\n\n### \ud83c\udfb2 Games\n\n#### Quantum Dice\n- Implementation: [examples/games/quantum_dice.c](examples/games/quantum_dice.c)\n- Header: [examples/games/quantum_dice.h](examples/games/quantum_dice.h)\n\nA simple but effective demonstration of the RNG in action:\n- Fair dice rolling implementation\n- Configurable sides (d4, d6, d8, d10, d12, d20, etc.)\n- Statistical distribution tests\n- Example of basic RNG usage\n\n## \ud83e\uddea Testing\n\nThe library includes a comprehensive test suite:\n\n```bash\n# Run all tests\nmake test\n\n# Run specific test suites\n./tests/comprehensive_test # Full functionality verification\n./tests/edge_cases_test # Edge case handling\n./tests/test_quantum_rng # Core RNG validation\n```\n\n### Statistical Testing\n```bash\n# Run statistical tests\n./tests/statistical/statistical_tests\n\n# Run quantum property verification\n./tests/quantum_stats\n```\n\n## \ud83d\udcca Performance Testing\n\n```bash\n# Run full benchmark suite\nmake benchmark\n./benchmark_suite\n\n# Run specific benchmarks\n./tests/benchmark_matrix # Matrix operation performance\n```\n\n## \ud83d\udd2e Future Improvements\n\nWe have several exciting examples and applications in development that will be released soon:\n\n### Finance Applications\n- Options Pricing - Black-Scholes model with quantum entropy\n- Quantum Portfolio - Portfolio optimization using quantum principles\n- Heston Model - Stochastic volatility modeling\n\n### Game Development\n- Quantum Evolution - Evolutionary algorithms with quantum randomness\n- Particle System - Physics-based particle simulation\n- Procedural Worlds - Terrain and world generation\n- Quantum Slots - Fair slot machine implementation\n- Terrain Generation - Advanced landscape generation\n- Loot System - Fair item drop system\n\n### Machine Learning\n- Quantum Transformer - RNG-enhanced transformer architecture\n- Neural Initialization - Quantum-inspired weight initialization\n- Quantum GAN - Generative adversarial network with quantum noise\n\n### Scientific Applications\n- Molecular Dynamics - Particle simulation\n- Quantum Walk - Random walk implementations\n- Weather Simulation - Atmospheric modeling\n- Quantum Noise - Advanced noise generation\n\n### Networking\n- Quantum Routing - Network routing algorithms\n- Traffic Simulation - Network traffic modeling\n\nEach of these examples will be thoroughly tested and documented before release, demonstrating the versatility of the Quantum RNG library across different domains.\n\n## \ud83e\udd1d Contributing\n\nWe welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details on:\n\n- Code style and standards\n- Testing requirements\n- Documentation expectations\n- Pull request process\n\n## \ud83d\udcdc License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\ude4f Acknowledgments\n\n- Nielsen & Chuang's \"Quantum Computation and Quantum Information\"\n- The quantum computing research community\n- All contributors and testers\n\n## \ud83d\udcdd Citation\n\nIf you use this library in your research, please cite:\n\n```bibtex\n@software{quantum_rng,\n title = {Semi-Classical Quantum Random Number Generator With Examples},\n author = {tsotchke},\n year = {2024},\n url = {https://github.com/tsotchke/quantum_rng}\n}\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Quantum-inspired Random Number Generator (QRNG) for Python",
"version": "1.1.0",
"project_urls": {
"Documentation": "https://github.com/yourusername/qrng#readme",
"Homepage": "https://github.com/yourusername/qrng",
"Issues": "https://github.com/yourusername/qrng/issues",
"Repository": "https://github.com/yourusername/qrng.git"
},
"split_keywords": [
"random",
" number",
" generator",
" quantum",
" cryptography"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "8a48d0c4abb4027bb4749837ee8771ad2ec8fc2a965aaef80657b1d06c001756",
"md5": "2b8f43ca3f84732366648738d2f4ebda",
"sha256": "8744f534dcd4d2a920aada06f422c8ad896d600de8fa302949128e21b582d3e8"
},
"downloads": -1,
"filename": "semi_classicalqrng_py_bindings-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2b8f43ca3f84732366648738d2f4ebda",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 7362,
"upload_time": "2025-02-01T04:30:20",
"upload_time_iso_8601": "2025-02-01T04:30:20.393376Z",
"url": "https://files.pythonhosted.org/packages/8a/48/d0c4abb4027bb4749837ee8771ad2ec8fc2a965aaef80657b1d06c001756/semi_classicalqrng_py_bindings-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0ef47e9f32cbcca9c5ec3dd2902c4ad46955aff0e49a32f74b7fbf48b6f8a769",
"md5": "df47f2f22fd8a775babe2de328aa7775",
"sha256": "f26cdf263ae74c68ff8c335013f188f7f373fe82f72dcbdaec054f2d8c783ad4"
},
"downloads": -1,
"filename": "semi_classicalqrng_py_bindings-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "df47f2f22fd8a775babe2de328aa7775",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 16266,
"upload_time": "2025-02-01T04:30:23",
"upload_time_iso_8601": "2025-02-01T04:30:23.119581Z",
"url": "https://files.pythonhosted.org/packages/0e/f4/7e9f32cbcca9c5ec3dd2902c4ad46955aff0e49a32f74b7fbf48b6f8a769/semi_classicalqrng_py_bindings-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-01 04:30:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yourusername",
"github_project": "qrng#readme",
"github_not_found": true,
"lcname": "semi-classicalqrng-py-bindings"
}