Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quantum_transformer-0.1.1.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

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

quantum_transformer-0.1.1-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

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

Hashes for quantum_transformer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f6ad4630a8dacdf1a2ff7b413a4fad5f3d5d494f69054f9b8464cca3ffedaf1f
MD5 fb256638b7ce4b2823d719b5c74a7abb
BLAKE2b-256 e4e402d0ba95533a3a1361ddcbaa9bbd959123cc5dae951c32f4c7e84cebd87d

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantum_transformer-0.1.1.tar.gz:

Publisher: publish.yml on reach-Harishapc/quantum-transformer

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

File details

Details for the file quantum_transformer-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for quantum_transformer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c5396e58751a6e1314b5fa593462b22996316d20732595fa9bcbcaccaa0aa88
MD5 e2de9bf88b1581688f154a5e72071b7e
BLAKE2b-256 063551e22ece9a72d75ea0014fb444acf078d9d92b7f9cf74cb47788becf02a9

See more details on using hashes here.

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

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