semvec/pypi-packages huggingface dataset:
zoon-format 1.0.3
ZOON - Zero Overhead Object Notation for LLM context optimization
License: MIT
Requires Python: >=3.10
Keywords: ai, compression, context-window, json, llm, tokens

# ZOON Python

> **ZOON** - Zero Overhead Object Notation

A Python implementation of the [ZOON format](https://github.com/zoon-format/zoon/blob/main/SPEC.md) for LLM context optimization. Achieves ~60% token reduction compared to JSON while maintaining 100% data fidelity.

[![PyPI](https://img.shields.io/pypi/v/zoon-format)](https://pypi.org/project/zoon-format/)
[![License](https://img.shields.io/badge/License-MIT-green)](LICENSE)

## Installation

```bash
pip install zoon-format
```

Or with uv:

```bash
uv add zoon-format
```

## Quick Start

```python
import zoon

data = [
    {"id": 1, "name": "Alice", "role": "admin", "active": True},
    {"id": 2, "name": "Bob", "role": "user", "active": True},
    {"id": 3, "name": "Carol", "role": "user", "active": False},
]

encoded = zoon.encode(data)
print(encoded)
# # id:i+ name:s role=admin|user active:b
# Alice admin 1
# Bob user 1
# Carol user 0

decoded = zoon.decode(encoded)
assert decoded == data
```

## Features

- **~60% Token Reduction**: Reduced LLM context usage vs JSON
- **100% Lossless**: Perfect round-trip encoding/decoding
- **Type-Safe**: Preserves integers, floats, booleans, nulls, and strings
- **Auto-Increment IDs**: `i+` columns are omitted from data rows
- **Smart Enums**: Automatic header-based typing for repeated values

## API Reference

### `zoon.encode(data: Any) -> str`

Encode Python data to ZOON format.

### `zoon.decode(zoon_string: str) -> Any`

Decode ZOON string back to Python data.

## License

MIT License. © 2025-PRESENT Carsen Klock
janus-quantum 1.0.2
轻量级量子电路构建、模拟和编译框架
License: MIT
Requires Python: >=3.9
Keywords: quantum, quantum-computing, quantum-circuit, quantum-simulation, qubits

# Janus 量子电路框架

[![PyPI version](https://badge.fury.io/py/janus-quantum.svg)](https://badge.fury.io/py/janus-quantum)
[![Documentation Status](https://readthedocs.org/projects/janus-quantum/badge/?version=latest)](https://janus-quantum.readthedocs.io/zh-cn/latest/?badge=latest)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)

**Janus** 是一个轻量级、高性能的量子电路构建、模拟和编译框架。

## ✨ 特性

- 🚀 **轻量高效** - 纯 Python 实现，依赖少，启动快
- 🔧 **60+ 量子门** - 完整的标准门库，支持参数化电路
- 📊 **多种模拟器** - 状态向量、密度矩阵、噪声模拟
- ⚡ **电路优化** - 多级优化 Pass，自动门合并与消除
- 🎨 **可视化** - 文本和图像电路绘制
- 📁 **JSON 格式** - 简洁的电路存储和交换格式

## 📦 安装

```bash
pip install janus-quantum
```

完整安装（包含可视化）：

```bash
pip install janus-quantum[full]
```

## 🚀 快速开始

### 创建 Bell 态

```python
from janus.circuit import Circuit
from janus.simulator import StatevectorSimulator

# 创建电路
qc = Circuit(2)
qc.h(0)
qc.cx(0, 1)

# 模拟运行
sim = StatevectorSimulator()
result = sim.run(qc, shots=1000)
print(result.counts)  # {'00': ~500, '11': ~500}

# 查看电路
print(qc.draw())
```

输出：
```
q0: ─H─●─
       │
q1: ───X─
```

### 参数化电路

```python
from janus.circuit import Circuit, Parameter
import numpy as np

theta = Parameter('theta')

qc = Circuit(1)
qc.ry(theta, 0)

# 绑定参数
bound_qc = qc.bind_parameters({theta: np.pi/2})
```

### 噪声模拟

```python
from janus.simulator import NoisySimulator, NoiseModel, depolarizing_channel

noise_model = NoiseModel()
noise_model.add_all_qubit_quantum_error(
    depolarizing_channel(0.01),
    ['h', 'x', 'cx']
)

noisy_sim = NoisySimulator(noise_model)
result = noisy_sim.run(qc, shots=1000)
```

### 电路优化

```python
from janus.compiler import compile_circuit

optimized = compile_circuit(qc, optimization_level=2)
```

## 📚 文档

完整文档请访问：[https://janus-quantum.readthedocs.io](https://janus-quantum.readthedocs.io)

## 🔧 支持的量子门

### 单比特门
`H`, `X`, `Y`, `Z`, `S`, `T`, `RX`, `RY`, `RZ`, `U`, `P`, ...

### 两比特门
`CX`, `CY`, `CZ`, `CH`, `SWAP`, `iSWAP`, `CRX`, `CRY`, `CRZ`, `RXX`, `RYY`, `RZZ`, ...

### 多比特门
`CCX` (Toffoli), `CCZ`, `CSWAP` (Fredkin), `MCX`, `MCP`, ...

## 📁 项目结构

```
janus/
├── circuit/      # 电路构建和表示
├── simulator/    # 量子模拟器
├── compiler/     # 电路编译器
├── decompose/    # 门分解
├── optimize/     # 高级优化
└── encode/       # 量子态编码
```

## 🤝 贡献

欢迎贡献代码！请查看 [贡献指南](https://janus-quantum.readthedocs.io/zh-cn/latest/contributing.html)。

## 📄 许可证

MIT License - 详见 [LICENSE](LICENSE) 文件。