Skip to main content

Quantum computing framework with multi-backend support

Project description

TyxonQ

Full-stack Quantum Software Framework on Real Machine

License Python

Real Quantum Hardware

For Chinese Introduction, see: 中文README.

For Japanese Introduction, see: 日本語README.

TyxonQ​​ 太玄量子 is a full-stack quantum software framework for quantum simulation, optimization, and quantum machine learning. Forked from the open-source project ​​TensorCircuit​​ and licensed under Apache License 2.0, it integrates modern quantum programming paradigms including automatic differentiation, just-in-time compilation, and hardware acceleration.

🚀 REAL QUANTUM HARDWARE READY: TyxonQ supports real quantum machine execution through our quantum cloud services powered by QureGenAI. Currently featuring the Homebrew_S2 quantum processor, enabling you to run your quantum algorithms on actual quantum hardware, not just simulators.

Try Real Quantum Computer Right Now!: Getting a Key to register and obtain your API key.

Directly use the TyxonQ cloud task submission API. For details, see the documentation: docs/tyxonq_cloud_api.md

Innovatively combining generative AI, heterogeneous computing architectures, TyxonQ delivers ​​end-to-end solutions​​ for quantum chemistry, drug discovery, and materials science.

🏗️ Quantum-Classical Hybrid Architecture

TyxonQ implements a comprehensive quantum-classical hybrid workflow that bridges high-level quantum algorithms to executable quantum programs:

Architect of TyxonQ

Architecture Components:
  • 🧮 Quantum Algorithm Layer: High-level quantum algorithm specification
  • 🔄 Circuit Structure: Parameterized quantum circuits with rotation parameters
  • ⚙️ Logic Circuit Synthesis: Automated circuit optimization and compilation
  • 🎯 Qubit Mapping: Physical qubit topology-aware mapping and routing
  • 💻 Hardware Execution: Direct execution on Homebrew_S2 quantum processor

Features

🔥 Real Quantum Hardware Integration

  • Production-Ready Quantum Execution: Direct integration with QureGenAI's Homebrew_S2 quantum processor
  • Pulse-Level Control: Support for both gate-level operations and pulse-level signals for advanced quantum control
  • Real-Time Quantum Computing: Execute your quantum algorithms on actual quantum hardware with low latency
  • Quantum-Classical Hybrid Workflows: Seamlessly combine classical preprocessing with quantum execution
  • Microwave Pulse Support: Advanced pulse-level control interface for complex quantum experiments. Supports 8 waveform types including Gaussian, DRAG, CosineDrag, and more. Features parameterized waveforms and TQASM 0.2 generation. Learn more →

🚀 Upcoming API & MCP Services (Coming Soon)

  • 🔗 Quantum API Gateway: RESTful APIs for direct quantum hardware access
  • 🤖 LLM Integration: Model Control Protocol (MCP) services for large language model integration
  • ☁️ Quantum Cloud Services: Scalable quantum computing as a service
  • 📊 Real-time Monitoring: Quantum job monitoring and result analytics

Unified Quantum-Classical Hybrid Computing Paradigm​​

  • Supports efficient simulation and optimization of variational quantum algorithms (​​VQE, QAOA​​), featuring a built-in ​​automatic differentiation engine​​ for seamless integration with PyTorch/TensorFlow gradient computation workflows.
  • Provides a ​​hybrid task scheduler​​ that dynamically allocates quantum hardware and classical computing resources (CPU/GPU) for acceleration​​.

Multi-Level Hardware Support​​

​​- Direct Quantum Hardware Integration​​: Compatible with mainstream quantum processors (e.g., superconducting), supporting low-level control from ​​gate-level operations​​ to ​​pulse-level signals :fire: :fire: :fire:​.

  • Advanced Pulse Control: Comprehensive pulse-level interface supporting 8 waveform types (Gaussian, DRAG, CosineDrag, Flattop, Sine, Cosine, Constant, GaussianSquare) with parameterized control and TQASM 0.2 generation for precise quantum manipulation.
  • ​​Heterogeneous Computing Optimization​​: Enhances simulation throughput via ​​GPU vectorization​​ and quantum instruction compilation.

Generative AI Integration​​

  • Built-in Generative ​Quantum Eigensolver (GQE)​​ and ​​Quantum Machine Learning (QML) modules for direct pre-trained model deployment in tasks like molecular structure generation and protein folding computing.
  • Supports ​​large language model (LLM) interaction​​, enabling automated ​​"natural language → quantum circuit"​​ generation (experimental feature).

Domain-Specific Toolkits​​

  • Quantum Chemistry Suite​​: Includes molecular Hamiltonian builders and electronic structure analysis tools, compatible with classical quantum chemistry and drug discovery framework like PySCF, ByteQC and ​​OpenMM​​.
  • ​​Materials Simulation Library​​: Integrates ​​quantum-accelerated density functional theory (DFT)​​ modules for predicting novel material band structures.

🚀 Roadmap & Development Status

✅ Current Features (v1.x)

  • Quantum circuit simulation and optimization
  • Real quantum hardware execution (Homebrew_S2)
  • Advanced pulse-level control interface with 8 waveform types and TQASM 0.2 support
  • Automatic differentiation engine
  • Multi-backend support (NumPy, PyTorch, TensorFlow, JAX)
  • Variational quantum algorithms (VQE,GQE,QAOA)
  • Quantum chemistry toolkit integration

🔄 In Progress (v2.x)

  • Quantum API Gateway - RESTful APIs for quantum hardware access
  • MCP Services - Large language model integration protocols
  • Advanced quantum error correction protocols
  • Enhanced pulse-level control interface - Additional waveform types and advanced calibration features
  • Real-time quantum job monitoring dashboard
  • Quantum circuit optimization using machine learning

🎯 Future Plans (v3.x+)

  • Multi-QPU Support - Support for additional quantum processors
  • Quantum Networking - Distributed quantum computing capabilities
  • Advanced QML Models - Pre-trained quantum machine learning models
  • Natural Language Interface - "English → Quantum Circuit" generation
  • Quantum Advantage Benchmarks - Standardized performance metrics
  • Enterprise Cloud Platform - Scalable quantum computing infrastructure

🧪 Experimental Features

  • Quantum generative adversarial networks (QGANs)
  • Quantum federated learning protocols
  • Quantum-enhanced drug discovery pipelines
  • Materials discovery acceleration frameworks

Installation

Currently supported operating systems: Linux and Mac.

The package now is written in pure Python and can be obtained via pip or

Install from source:

uv build
uv pip install dist/tyxonq-0.1.1-py3-none-any.whl

pip as:

# use a python virtual environment
python -m venv pyv_tyxonq
source pyv_tyxonq/bin/activate
pip install tyxonq

or

uv pip install tyxonq

or you can install it from github:

git clone https://github.com/QureGenAI-Biotech/TyxonQ.git
cd tyxonq
pip install --editable .

Get Started Example

See examples/Get_Started_Demo.ipynb

🔑 Real Quantum Hardware Setup

Getting API Access

  1. Apply for API Key: Visit TyxonQ Quantum AI Portal to register and obtain your API key
  2. Hardware Access: Request access to Homebrew_S2 quantum processor through API TyxonQ QPU API

Configuration

Set up your API credentials:

import tyxonq as tq
from tyxonq.cloud import apis
import getpass

# Configure quantum hardware access
API_KEY = getpass.getpass("Input your TyxonQ API_KEY:")
apis.set_token(API_KEY) # Get from https://www.tyxonq.com

Real Hardware Example

See 'examples/simple_demo_1.py' , run:

python examples/simple_demo_1.py

Code:

import tyxonq as tq
import getpass
from tyxonq.cloud import apis
import time
# Configure for real quantum hardware
apis.set_token(getpass.getpass("Input your TyxonQ API_KEY: "))

provider = "tyxonq"
device = "homebrew_s2"

# Create and execute quantum circuit on real hardware
def quantum_hello_world():
    c = tq.Circuit(2)
    c.H(0)                    # Hadamard gate on qubit 0
    c.CNOT(0, 1)             # CNOT gate between qubits 0 and 1
    c.rx(1, theta=0.2)       # Rotation around x-axis
    
    # Execute on real quantum hardware

    print("Submit task to TyxonQ")

    task = apis.submit_task(provider = provider,
                        device = device,
                        circuit = c,
                        shots = 100)
    print(f"Task submitted: {task}")
    print("Wait 20 seconds to get task details")
    time.sleep(20)
    print(f"Real quantum hardware result: {task.details()}")

quantum_hello_world()

🎛️ Advanced Pulse Support

TyxonQ provides comprehensive pulse-level control capabilities for advanced quantum experiments and precise quantum manipulation.

Key Features

  • 8 Waveform Types: Gaussian, DRAG, CosineDrag, Flattop, Sine, Cosine, Constant, GaussianSquare
  • Parameterized Control: Dynamic waveform generation with mathematical precision
  • TQASM 0.2 Generation: Industry-standard pulse-level circuit representation
  • Hardware Integration: Direct execution on quantum processors like Homebrew_S2

Quick Example

import tyxonq as tq
from tyxonq import waveforms

# Create pulse-enabled circuit
qc = tq.Circuit(1)
qc.use_pulse()

# Define parameterized waveform
param_t = tq.Param("t")
builder = qc.calibrate("rabi_experiment", [param_t])
builder.new_frame("drive_frame", param_t)
builder.play("drive_frame", waveforms.CosineDrag(param_t, 0.2, 0.0, 0.0))
builder.build()

# Generate TQASM code
tqasm_code = qc.to_tqasm()
print(tqasm_code)

Documentation


Basic Usage and Guide

Considering that the features and documentation related to ​​TyxonQ characteristics​​ are currently under development, you can refer to the upstream library ​​Tensorcircuit​​ for usage guidance in the interim: Quick Start and full documentation. We will promptly update the ​​TyxonQ documentation and tutorials in English, Chinese and Japanese​​.

  • Circuit manipulation:
import tyxonq as tq
c = tq.Circuit(2)
c.H(0)
c.CNOT(0,1)
c.rx(1, theta=0.2)
print(c.wavefunction())
print(c.expectation_ps(z=[0, 1]))
print(c.sample(allow_state=True, batch=1024, format="count_dict_bin"))
  • Runtime behavior customization:
tq.set_backend("tensorflow")
tq.set_dtype("complex128")
tq.set_contractor("greedy")
  • Automatic differentiations with jit:
def forward(theta):
    c = tq.Circuit(2)
    c.R(0, theta=theta, alpha=0.5, phi=0.8)
    return tq.backend.real(c.expectation((tq.gates.z(), [0])))

g = tq.backend.grad(forward)
g = tq.backend.jit(g)
theta = tq.array_to_tensor(1.0)
print(g(theta))

Dependencies

  • Python >= 3.10, <3.13 (supports Python 3.10, 3.11, 3.12)

📧 Contact & Support

微信公众号 | Official WeChat

TyxonQ 微信公众号

开发者交流群 | Developer Community

TyxonQ 开发者交流群

扫码关注公众号获取最新资讯 | Scan to follow for latest updates
扫码加入开发者群进行技术交流 | Scan to join developer community

Development Team

  • QureGenAI: Quantum hardware infrastructure and services
  • TyxonQ Core Team: Framework development and optimization
  • Community Contributors: Open source development and testing

Changelog

Recent Updates(Summary)

  • v0.3.0 - Add comprehensive pulse-level control capabilities for advanced quantum experiments and precise quantum manipulation.
  • v0.2.1 — Official Python 3.10+ support; updated Chinese and Japanese READMEs; Homebrew_S2 HTTP API and documentation updated for multi-tool invocation and MCP service integration.
  • v0.1.1 — Initial public release; support for real quantum hardware Homebrew_S2 integration; added cloud task management examples; improved multi-backend and automatic differentiation experience.
  • v0.1.0 — Internal preview; framework skeleton with basic circuit/compiler/backend modules.

License

TyxonQ is open source, released under the Apache License, Version 2.0.

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

tyxonq-0.3.0.tar.gz (280.2 kB view details)

Uploaded Source

Built Distribution

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

tyxonq-0.3.0-py3-none-any.whl (281.6 kB view details)

Uploaded Python 3

File details

Details for the file tyxonq-0.3.0.tar.gz.

File metadata

  • Download URL: tyxonq-0.3.0.tar.gz
  • Upload date:
  • Size: 280.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for tyxonq-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6fe1bb2eea3c27014fda2a6f1bae06e4ec2cbf70e12db1dea2470f3e928ee554
MD5 25c0032dd6c1035a068ba16fb7b3be65
BLAKE2b-256 e05e3c25c109f3c143005866f5c9e09fec330ab5897ff24cff0fa62ddb39e63e

See more details on using hashes here.

File details

Details for the file tyxonq-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: tyxonq-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 281.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for tyxonq-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 956f2c572ff64c000cda49ee6eed327f28bb2e574ff0d00a5030386dc22cbf58
MD5 68f10d3ec6de67810373dbaedf206c3b
BLAKE2b-256 4ecbfc2cc0bb15a20c6b3aa4cee31b7c6054707006a92e4ecb9778fc2e61d8e3

See more details on using hashes here.

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