A High-Fidelity Quantum-Inspired Transformer for Language Modeling
Project description
Quantum Transformer
Quantum Transformer is a specialized framework designed for the development and deployment of quantum-inspired artificial intelligence models. It extends the standard Transformer architecture by integrating quantum gate simulations as a mechanism for attention and feature transformation, providing a novel approach to sequence modeling and representation learning.
Overview
The core objective of the Quantum Transformer project is to provide researchers and developers with a robust toolset for building pre-trained Quantum AI models. By mapping quantum circuit operations (such as rotation gates and entanglement simulations) onto neural network layers, the framework achieves high-fidelity signal processing that mirrors quantum state evolution.
Technical Architecture
The framework is built upon several key technical pillars:
Quantum-Inspired Attention (QIA)
Unlike traditional scaled dot-product attention, QIA utilizes simulated quantum gates to calculate weight distributions. This allows the model to capture complex inter-token dependencies within a high-dimensional quantum-like state space.
Structural Confidence Guard
The framework implements a Shannon Entropy-based monitoring system that evaluates model certainty during autoregressive generation. This provides a mathematically grounded metric for output reliability.
Key-Value (KV) Caching
Optimized inference pathways are implemented using a sliding-window KV cache system, ensuring efficient memory utilization even with absolute positional embeddings.
Installation
The package can be installed via pip:
pip install quantum-transformer
Core Components
- QuantumTransformerLM: The primary language model class, supporting both training and inference.
- BPETokenizer: A professional-grade Byte-Pair Encoding tokenizer for sub-word processing.
- QuantumTransformerConfig: A comprehensive configuration system for defining model hyperparameters and quantum circuit depths.
Usage Example
The following example demonstrates how to load a pre-trained model and perform inference:
from quantum_transformer.model import QuantumTransformerLM
# Load a pre-trained model from the Hugging Face Hub
model = QuantumTransformerLM.from_pretrained("Harishapc01/quantum-qt-4q")
# Execute autoregressive generation
output = model.generate(
prompt="The integration of quantum mechanics with neural networks",
max_new_tokens=128,
temperature=0.7,
top_p=0.9
)
print(output)
Research and Development
Quantum Transformer is intended for:
- Investigating the scalability of quantum-inspired layers in large-scale language models.
- Developing hybrid classical-quantum architectures for natural language processing.
- Benchmarking the efficiency of quantum gate simulations in high-dimensional feature spaces.
License
This project is licensed under the MIT License.
Contact
Quantum AI Team Lead Developer: Harisha P C Email: reach.harishapc@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quantum_transformer-0.1.1.tar.gz.
File metadata
- Download URL: quantum_transformer-0.1.1.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6ad4630a8dacdf1a2ff7b413a4fad5f3d5d494f69054f9b8464cca3ffedaf1f
|
|
| MD5 |
fb256638b7ce4b2823d719b5c74a7abb
|
|
| BLAKE2b-256 |
e4e402d0ba95533a3a1361ddcbaa9bbd959123cc5dae951c32f4c7e84cebd87d
|
Provenance
The following attestation bundles were made for quantum_transformer-0.1.1.tar.gz:
Publisher:
publish.yml on reach-Harishapc/quantum-transformer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quantum_transformer-0.1.1.tar.gz -
Subject digest:
f6ad4630a8dacdf1a2ff7b413a4fad5f3d5d494f69054f9b8464cca3ffedaf1f - Sigstore transparency entry: 1440012114
- Sigstore integration time:
-
Permalink:
reach-Harishapc/quantum-transformer@801b0c862d56bb32fd71eb5638fd3aeb0f86ef1f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/reach-Harishapc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@801b0c862d56bb32fd71eb5638fd3aeb0f86ef1f -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file quantum_transformer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: quantum_transformer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c5396e58751a6e1314b5fa593462b22996316d20732595fa9bcbcaccaa0aa88
|
|
| MD5 |
e2de9bf88b1581688f154a5e72071b7e
|
|
| BLAKE2b-256 |
063551e22ece9a72d75ea0014fb444acf078d9d92b7f9cf74cb47788becf02a9
|
Provenance
The following attestation bundles were made for quantum_transformer-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on reach-Harishapc/quantum-transformer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quantum_transformer-0.1.1-py3-none-any.whl -
Subject digest:
6c5396e58751a6e1314b5fa593462b22996316d20732595fa9bcbcaccaa0aa88 - Sigstore transparency entry: 1440012120
- Sigstore integration time:
-
Permalink:
reach-Harishapc/quantum-transformer@801b0c862d56bb32fd71eb5638fd3aeb0f86ef1f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/reach-Harishapc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@801b0c862d56bb32fd71eb5638fd3aeb0f86ef1f -
Trigger Event:
workflow_dispatch
-
Statement type: