tyxonq


Nametyxonq JSON
Version 0.9.9 PyPI version JSON
download
home_pageNone
SummaryQuantum computing framework with multi-backend support
upload_time2025-09-19 06:21:16
maintainerNone
docs_urlNone
authorNone
requires_python<3.13,>=3.10
licenseApache-2.0
keywords quantum quantum-computing quantum-machine-learning quantum-chemistry quantum-simulation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h2><p align="center">TyxonQ</p></h2>
<h3><p align="center">A Modular Full-stack Quantum Software Framework on Real Machine</p></h3>

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/downloads/)
[![Real Quantum Hardware](https://img.shields.io/badge/Quantum%20Hardware-Homebrew__S2-brightgreen)](https://www.tyxonq.com/)

For Chinese Introduction, see: [中文README](README_cn.md).
For Japanese Introduction, see: [日本語README](README_jp.md).

TyxonQ 太玄量子 is a next‑generation quantum programming framework with a stable IR, pluggable compiler, unified device abstraction (simulators and hardware), a single numerics backend interface (NumPy/PyTorch/CuPyNumeric), and a device runtime friendly postprocessing layer. It is designed to mirror real devices while remaining simple for engineers and scientists.

### Core goals
- **System‑architect‑friendly, hardware‑realistic programming model**: stable IR + chain pipeline mirroring real device execution; clear contracts for compiler, devices, and postprocessing; closest‑to‑hardware code path.

- **Quantum AIDD (Quantum Computational Chemistry for advanced AI Drug Design)**: PySCF‑like UX, hardware‑realistic execution; familiar molecule/ansatz APIs route to device or numerics without code changes. Mission: prioritize drug design—provide missing microscopic Quantum Chemistry data and robust computational tools for AI drug discovery; roadmap includes drug design–oriented Hamiltonians, method optimization, and AI‑for‑QC.

- **Dual paths**: Hamiltonians, measurement grouping, shot planning, device execution (shots/noise) and exact numerics (statevector/MPS) with shared semantics.

- **Extensible domain layer**: algorithms and chem libs are modular for specialized extensions.

***Try Real Quantum Computer Right Now!***: [Getting a Key](https://www.tyxonq.com/) to register and obtain your API key. 
Directly use the TyxonQ cloud task submission API. For details, see the example: [examples/cloud_api_task.py](cloud_api_task.py)


## Quick start

### Minimal circuit → simulator / hardware
```python
import tyxonq as tq
from tyxonq.postprocessing import metrics
import getpass
tq.set_backend("numpy")

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

# Build once
c = tq.Circuit(2).h(0).cx(0, 1).measure_z(0).measure_z(1)

# Simulator path
sim = (
    c.compile()
     .device(provider="simulator", device="statevector", shots=4096)
     .postprocessing(method=None)
     .run()
)

# Hardware path (example target)
hw = (
    c.compile(output="qasm")
     .device(provider="tyxonq", device="homebrew_s2", shots=4096)
     .run()
)

def counts_of(res):
    payload = res if isinstance(res, dict) else (res[0] if res else {})
    return payload.get("result", {})

ez_sim = metrics.expectation(counts_of(sim), z=[0, 1])
ez_hw  = metrics.expectation(counts_of(hw),  z=[0, 1])
print("E[Z] (sim)", ez_sim)
print("E[Z] (hw) ", ez_hw)
```

### Minimal Quantum Chemistry (PySCF‑style)
```python
# pip install pyscf  # required for UCCSD example
import tyxonq as tq
from tyxonq.applications.chem.algorithms.uccsd import UCCSD
from tyxonq.applications.chem import molecule

tq.set_backend("numpy")

# Preset H2 molecule (RHF defaults handled inside UCCSD)
ucc = UCCSD(molecule.h2)

# Device chain on simulator (counts → energy)
e = ucc.kernel(shots=2048, provider="simulator", device="statevector")
# Device chain on real machine (counts → energy)
#e = ucc.kernel(shots=2048, provider="tyxonq", device="homebrew_s2")
print("UCCSD energy (device path):", e)
```


## Installation
```bash
pip install tyxonq
# or from source
uv build && uv pip install dist/tyxonq-*.whl
```

## 🔑 Quantum Hardware Setup
### Getting API Access
1. **Apply for API Key**: Visit [TyxonQ Quantum AI Portal](https://www.tyxonq.com/) 
to register and obtain your API key
2. **Hardware Access**: Request access to **Homebrew_S2** quantum processor through 
API [TyxonQ QPU API](https://www.tyxonq.com)

### Hardware API Configuration
Set up your API credentials:

```python
import tyxonq as tq
import getpass

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

## Architecture
<p align="center">
  <img src="./docs/images/architect.png" alt="TyxonQ Architecture" width="100%">
</p>


### Key features
- **Chain API**: `Circuit.compile().device(...).postprocessing(...).run()`.
- **Compiler passes**: measurement rewrite/grouping, light‑cone simplify, shot scheduling.
- **Devices**: statevector/density‑matrix/MPS simulators and hardware drivers (e.g., `tyxonq:homebrew_s2`).
- **Numerics**: one ArrayBackend for NumPy/PyTorch/CuPyNumeric powering simulators and research kernels.
- **Libraries**: `libs/circuits_library` (templates: VQE/QAOA/trotter/state‑prep), `libs/quantum_library` (numeric kernels), `libs/hamiltonian_encoding` (OpenFermion I/O, encodings), `libs/optimizer` (interop).
- **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.

- **Pulse-Level Control**: Support for both gate-level operations and **pulse-level signals** for advanced quantum control

- **Quantum API Gateway**: RESTful APIs for direct quantum hardware access

- **☁️ Quantum Cloud Services**: Scalable quantum computing as a service



### Quantum AIDD Key features
- **Algorithms**: HEA and UCC family (UCC/UCCSD/k‑UpCCGSD/pUCCD) with consistent energy/gradient/kernel APIs.
- **Runtimes**: device runtime forwards grouped measurements to postprocessing; numeric runtime provides exact statevector/civector (supports PyTorch autograd).
- **Hamiltonians**: unified sparse/MPO/FCI‑function outputs; convenient molecule factories (`applications/chem/molecule.py`).
- **Measurement and shots**: compiler‑driven grouping and shot scheduling enable deterministic, provider‑neutral execution.
- **Properties**: RDM1/2 and basic property operators; dynamics numeric path caches MPO/term matrices to avoid rebuilds.
- **Bridges**: OpenFermion I/O via `libs/hamiltonian_encoding`; tight interop with PySCF for references and integrals.
- **Chem libs**: `applications/chem/chem_libs/` including `circuit_chem_library` (UCC family ansatz), `quantum_chem_library` (CI/civector ops), `hamiltonians_chem_library` (HF/integrals → Hamiltonians).

- **AIDD (AI Drug Design) field Feature**
  - Drug‑design‑oriented Hamiltonians and workflows (ligand–receptor fragments, solvent/embedding, coarse‑grained models) prioritized for AI Drug Design.
  - Method optimization for AIDD tasks: tailored ansatz/measurement grouping, batched parameter‑shift/QNG, adaptive shot allocation.
  - AI‑for‑QC bridges: standardized data schemas and export of Quantum Chemistry field data (energies, RDMs, expectations,ansatz,active space,etc) for QC algorithms development.
  - Expanded properties and excited states (VQD/pVQD) aligned with spectroscopy and binding‑relevant observables.


## Dependencies
- Python >= 3.10 (supports Python 3.10, 3.11, 3.12+)
- PyTorch >= 1.8.0


## 📧 Contact & Support

- **Home**: [www.tyxonq.com](https://www.tyxonq.com)
- **Technical Support**: [code@quregenai.com](mailto:code@quregenai.com)
- **General Inquiries**: [bd@quregenai.com](mailto:bd@quregenai.com)
- **Issue**: [github issue](https://github.com/QureGenAI-Biotech/TyxonQ/issues)

#### 微信公众号 | Official WeChat
<img src="docs/images/wechat_offical_qrcode.jpg" alt="TyxonQ 微信公众号" width="200">

#### 开发者交流群 | Developer Community
<img src="docs/images/developer_group_qrcode.png" alt="TyxonQ 开发者交流群" width="200">

*扫码关注公众号获取最新资讯 | 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

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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "tyxonq",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.10",
    "maintainer_email": null,
    "keywords": "quantum, quantum-computing, quantum-machine-learning, quantum-chemistry, quantum-simulation",
    "author": null,
    "author_email": "TyxonQ Development Team <code@quregenai.com>",
    "download_url": "https://files.pythonhosted.org/packages/8a/4b/4ef2020f4955b2127d32df1ea508f7b30b4116605e34004b22331b2e1cfe/tyxonq-0.9.9.tar.gz",
    "platform": null,
    "description": "<h2><p align=\"center\">TyxonQ</p></h2>\n<h3><p align=\"center\">A Modular Full-stack Quantum Software Framework on Real Machine</p></h3>\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/downloads/)\n[![Real Quantum Hardware](https://img.shields.io/badge/Quantum%20Hardware-Homebrew__S2-brightgreen)](https://www.tyxonq.com/)\n\nFor Chinese Introduction, see: [\u4e2d\u6587README](README_cn.md).\nFor Japanese Introduction, see: [\u65e5\u672c\u8a9eREADME](README_jp.md).\n\nTyxonQ \u592a\u7384\u91cf\u5b50 is a next\u2011generation quantum programming framework with a stable IR, pluggable compiler, unified device abstraction (simulators and hardware), a single numerics backend interface (NumPy/PyTorch/CuPyNumeric), and a device runtime friendly postprocessing layer. It is designed to mirror real devices while remaining simple for engineers and scientists.\n\n### Core goals\n- **System\u2011architect\u2011friendly, hardware\u2011realistic programming model**: stable IR + chain pipeline mirroring real device execution; clear contracts for compiler, devices, and postprocessing; closest\u2011to\u2011hardware code path.\n\n- **Quantum AIDD (Quantum Computational Chemistry for advanced AI Drug Design)**: PySCF\u2011like UX, hardware\u2011realistic execution; familiar molecule/ansatz APIs route to device or numerics without code changes. Mission: prioritize drug design\u2014provide missing microscopic Quantum Chemistry data and robust computational tools for AI drug discovery; roadmap includes drug design\u2013oriented Hamiltonians, method optimization, and AI\u2011for\u2011QC.\n\n- **Dual paths**: Hamiltonians, measurement grouping, shot planning, device execution (shots/noise) and exact numerics (statevector/MPS) with shared semantics.\n\n- **Extensible domain layer**: algorithms and chem libs are modular for specialized extensions.\n\n***Try Real Quantum Computer Right Now\uff01***: [Getting a Key](https://www.tyxonq.com/) to register and obtain your API key. \nDirectly use the TyxonQ cloud task submission API. For details, see the example: [examples/cloud_api_task.py](cloud_api_task.py)\n\n\n## Quick start\n\n### Minimal circuit \u2192 simulator / hardware\n```python\nimport tyxonq as tq\nfrom tyxonq.postprocessing import metrics\nimport getpass\ntq.set_backend(\"numpy\")\n\n# Configure quantum hardware access\n#API_KEY = getpass.getpass(\"Input your TyxonQ API_KEY:\")\n#tq.set_token(API_KEY) # Get from https://www.tyxonq.com\n\n# Build once\nc = tq.Circuit(2).h(0).cx(0, 1).measure_z(0).measure_z(1)\n\n# Simulator path\nsim = (\n    c.compile()\n     .device(provider=\"simulator\", device=\"statevector\", shots=4096)\n     .postprocessing(method=None)\n     .run()\n)\n\n# Hardware path (example target)\nhw = (\n    c.compile(output=\"qasm\")\n     .device(provider=\"tyxonq\", device=\"homebrew_s2\", shots=4096)\n     .run()\n)\n\ndef counts_of(res):\n    payload = res if isinstance(res, dict) else (res[0] if res else {})\n    return payload.get(\"result\", {})\n\nez_sim = metrics.expectation(counts_of(sim), z=[0, 1])\nez_hw  = metrics.expectation(counts_of(hw),  z=[0, 1])\nprint(\"E[Z] (sim)\", ez_sim)\nprint(\"E[Z] (hw) \", ez_hw)\n```\n\n### Minimal Quantum Chemistry (PySCF\u2011style)\n```python\n# pip install pyscf  # required for UCCSD example\nimport tyxonq as tq\nfrom tyxonq.applications.chem.algorithms.uccsd import UCCSD\nfrom tyxonq.applications.chem import molecule\n\ntq.set_backend(\"numpy\")\n\n# Preset H2 molecule (RHF defaults handled inside UCCSD)\nucc = UCCSD(molecule.h2)\n\n# Device chain on simulator (counts \u2192 energy)\ne = ucc.kernel(shots=2048, provider=\"simulator\", device=\"statevector\")\n# Device chain on real machine (counts \u2192 energy)\n#e = ucc.kernel(shots=2048, provider=\"tyxonq\", device=\"homebrew_s2\")\nprint(\"UCCSD energy (device path):\", e)\n```\n\n\n## Installation\n```bash\npip install tyxonq\n# or from source\nuv build && uv pip install dist/tyxonq-*.whl\n```\n\n## \ud83d\udd11 Quantum Hardware Setup\n### Getting API Access\n1. **Apply for API Key**: Visit [TyxonQ Quantum AI Portal](https://www.tyxonq.com/) \nto register and obtain your API key\n2. **Hardware Access**: Request access to **Homebrew_S2** quantum processor through \nAPI [TyxonQ QPU API](https://www.tyxonq.com)\n\n### Hardware API Configuration\nSet up your API credentials:\n\n```python\nimport tyxonq as tq\nimport getpass\n\n# Configure quantum hardware access\nAPI_KEY = getpass.getpass(\"Input your TyxonQ API_KEY:\")\ntq.set_token(API_KEY) # Get from https://www.tyxonq.com\n# legacy style\n# apis.set_token(API_KEY) # Get from https://www.tyxonq.com\n```\n\n## Architecture\n<p align=\"center\">\n  <img src=\"./docs/images/architect.png\" alt=\"TyxonQ Architecture\" width=\"100%\">\n</p>\n\n\n### Key features\n- **Chain API**: `Circuit.compile().device(...).postprocessing(...).run()`.\n- **Compiler passes**: measurement rewrite/grouping, light\u2011cone simplify, shot scheduling.\n- **Devices**: statevector/density\u2011matrix/MPS simulators and hardware drivers (e.g., `tyxonq:homebrew_s2`).\n- **Numerics**: one ArrayBackend for NumPy/PyTorch/CuPyNumeric powering simulators and research kernels.\n- **Libraries**: `libs/circuits_library` (templates: VQE/QAOA/trotter/state\u2011prep), `libs/quantum_library` (numeric kernels), `libs/hamiltonian_encoding` (OpenFermion I/O, encodings), `libs/optimizer` (interop).\n- **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.\n\n- **Pulse-Level Control**: Support for both gate-level operations and **pulse-level signals** for advanced quantum control\n\n- **Quantum API Gateway**: RESTful APIs for direct quantum hardware access\n\n- **\u2601\ufe0f Quantum Cloud Services**: Scalable quantum computing as a service\n\n\n\n### Quantum AIDD Key features\n- **Algorithms**: HEA and UCC family (UCC/UCCSD/k\u2011UpCCGSD/pUCCD) with consistent energy/gradient/kernel APIs.\n- **Runtimes**: device runtime forwards grouped measurements to postprocessing; numeric runtime provides exact statevector/civector (supports PyTorch autograd).\n- **Hamiltonians**: unified sparse/MPO/FCI\u2011function outputs; convenient molecule factories (`applications/chem/molecule.py`).\n- **Measurement and shots**: compiler\u2011driven grouping and shot scheduling enable deterministic, provider\u2011neutral execution.\n- **Properties**: RDM1/2 and basic property operators; dynamics numeric path caches MPO/term matrices to avoid rebuilds.\n- **Bridges**: OpenFermion I/O via `libs/hamiltonian_encoding`; tight interop with PySCF for references and integrals.\n- **Chem libs**: `applications/chem/chem_libs/` including `circuit_chem_library` (UCC family ansatz), `quantum_chem_library` (CI/civector ops), `hamiltonians_chem_library` (HF/integrals \u2192 Hamiltonians).\n\n- **AIDD (AI Drug Design) field Feature**\n  - Drug\u2011design\u2011oriented Hamiltonians and workflows (ligand\u2013receptor fragments, solvent/embedding, coarse\u2011grained models) prioritized for AI Drug Design.\n  - Method optimization for AIDD tasks: tailored ansatz/measurement grouping, batched parameter\u2011shift/QNG, adaptive shot allocation.\n  - AI\u2011for\u2011QC bridges: standardized data schemas and export of Quantum Chemistry field data (energies, RDMs, expectations,ansatz,active space,etc) for QC algorithms development.\n  - Expanded properties and excited states (VQD/pVQD) aligned with spectroscopy and binding\u2011relevant observables.\n\n\n## Dependencies\n- Python >= 3.10 (supports Python 3.10, 3.11, 3.12+)\n- PyTorch >= 1.8.0\n\n\n## \ud83d\udce7 Contact & Support\n\n- **Home**: [www.tyxonq.com](https://www.tyxonq.com)\n- **Technical Support**: [code@quregenai.com](mailto:code@quregenai.com)\n- **General Inquiries**: [bd@quregenai.com](mailto:bd@quregenai.com)\n- **Issue**: [github issue](https://github.com/QureGenAI-Biotech/TyxonQ/issues)\n\n#### \u5fae\u4fe1\u516c\u4f17\u53f7 | Official WeChat\n<img src=\"docs/images/wechat_offical_qrcode.jpg\" alt=\"TyxonQ \u5fae\u4fe1\u516c\u4f17\u53f7\" width=\"200\">\n\n#### \u5f00\u53d1\u8005\u4ea4\u6d41\u7fa4 | Developer Community\n<img src=\"docs/images/developer_group_qrcode.png\" alt=\"TyxonQ \u5f00\u53d1\u8005\u4ea4\u6d41\u7fa4\" width=\"200\">\n\n*\u626b\u7801\u5173\u6ce8\u516c\u4f17\u53f7\u83b7\u53d6\u6700\u65b0\u8d44\u8baf | Scan to follow for latest updates*  \n*\u626b\u7801\u52a0\u5165\u5f00\u53d1\u8005\u7fa4\u8fdb\u884c\u6280\u672f\u4ea4\u6d41 | Scan to join developer community*\n\n### Development Team\n- **QureGenAI**: Quantum hardware infrastructure and services\n- **TyxonQ Core Team**: Framework development and optimization\n- **Community Contributors**: Open source development and testing\n\n## License\nTyxonQ is open source, released under the Apache License, Version 2.0.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Quantum computing framework with multi-backend support",
    "version": "0.9.9",
    "project_urls": {
        "Documentation": "https://github.com/QureGenAI-Biotech/TyxonQ",
        "Homepage": "https://github.com/QureGenAI-Biotech/TyxonQ",
        "Issues": "https://github.com/QureGenAI-Biotech/TyxonQ/issues",
        "Official Website": "https://www.tyxonq.com",
        "Repository": "https://github.com/QureGenAI-Biotech/TyxonQ"
    },
    "split_keywords": [
        "quantum",
        " quantum-computing",
        " quantum-machine-learning",
        " quantum-chemistry",
        " quantum-simulation"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "08f34e8f56c01b5b859840726ffefb0f6412db5db988b1206a2dc904fb81a24b",
                "md5": "b9e030ce3aa4a6928d3b82960959b2be",
                "sha256": "1f822382bef6c4a1d2f76c01fb609303ecb8cd67d76c84fea14f4e07e686636f"
            },
            "downloads": -1,
            "filename": "tyxonq-0.9.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b9e030ce3aa4a6928d3b82960959b2be",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.10",
            "size": 220427,
            "upload_time": "2025-09-19T06:21:15",
            "upload_time_iso_8601": "2025-09-19T06:21:15.116422Z",
            "url": "https://files.pythonhosted.org/packages/08/f3/4e8f56c01b5b859840726ffefb0f6412db5db988b1206a2dc904fb81a24b/tyxonq-0.9.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8a4b4ef2020f4955b2127d32df1ea508f7b30b4116605e34004b22331b2e1cfe",
                "md5": "f049f3269494f02ab72744ecccb9be5f",
                "sha256": "4ead4f3a4239fd27ce4ee1b3fe7c3e9fb894e4da1421084116198e6660ed38fd"
            },
            "downloads": -1,
            "filename": "tyxonq-0.9.9.tar.gz",
            "has_sig": false,
            "md5_digest": "f049f3269494f02ab72744ecccb9be5f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.10",
            "size": 199554,
            "upload_time": "2025-09-19T06:21:16",
            "upload_time_iso_8601": "2025-09-19T06:21:16.791243Z",
            "url": "https://files.pythonhosted.org/packages/8a/4b/4ef2020f4955b2127d32df1ea508f7b30b4116605e34004b22331b2e1cfe/tyxonq-0.9.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-19 06:21:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "QureGenAI-Biotech",
    "github_project": "TyxonQ",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "tyxonq"
}
        
Elapsed time: 1.71535s