Topology-aware quantum compiler using universal transfer matrices (24 theorems, 42K+ tests, 0 failures)
Project description
Nativ3 — Topology-Aware Quantum Compiler
24 theorems. 42,000+ tests. Zero failures.
Quantum circuit topology and classical network topology are the same mathematical object, connected by a universal 4×4 transfer matrix with bond dimension 4 = 2⊗2.
Install
pip install nativ3
pip install nativ3[qiskit] # with Qiskit integration
Quick Start
from nativ3 import compile_circuit
# Define your circuit as (control, target) pairs
circuit = [(0,1), (0,2), (0,3), (1,2), (2,3)]
# Define hardware connectivity
hardware = {0:[1], 1:[0,2,4], 2:[1,3], 3:[2,4], 4:[1,3]}
# Calibration data (from IBM Quantum)
calibration = {
"qubits": {q: {"gate_fidelity": 0.998} for q in range(5)},
"edges": {(i,j): {"cx_fidelity": 0.97} for i in range(5) for j in hardware.get(i,[])}
}
# Compile: finds optimal qubit mapping maximizing topology cost Z
mapping, Z, swaps = compile_circuit(circuit, hardware, calibration)
print(f"Optimal mapping: {mapping}")
print(f"Topology cost Z: {Z:.4f}")
print(f"SWAP gates needed: {swaps}")
What Z Captures That SWAP Count Doesn't
- Per-qubit fidelity (not all qubits are equal)
- Per-edge CX fidelity (not all connections are equal)
- Chain length effects (longer chains decay nonlinearly)
- Hub structure (star circuits prefer high-connectivity nodes)
- Multi-gate optimization (different transfer matrix per gate type)
Among mappings with the same SWAP count, Z discriminates by up to 35%.
Key Results
| Theorem | Result |
|---|---|
| T1-T2 | Non-transitivity of CU topology, F = cos⁴(α) |
| T15-T16 | Universal 4×4 transfer matrix, bond dimension 4 |
| T17 | Projector angle: det(M) = 0, classical stochastic matrix |
| T19 | Relay = eigenvector of gate at projector |
| T22 | Self-referential: M is itself a CU gate |
| T23 | Novelty formula with conservation law |
| T24 | Deflection D² = 1-Z², breathing ratchet |
Links
- Paper: doi.org/10.5281/zenodo.19302455
- IDE: nativ3.shift8.space
- Breathing Mode: breathing.shift8.space
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 nativ3-0.2.0.tar.gz.
File metadata
- Download URL: nativ3-0.2.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0830db742536d9665447e1d5eddff8b745174d881d9ab051ac9beac6e0ba5042
|
|
| MD5 |
4b1f139cd7402c691fb93ead01368a43
|
|
| BLAKE2b-256 |
8b6ca94477569a1ae5491505f1953ec9efaa49dd7ff4b93958ed0606c9e0db4c
|
File details
Details for the file nativ3-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nativ3-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaab7e7f3df744136f3f2207dfd0d1ba0efaf72b8aa91b2363f09d95afb61619
|
|
| MD5 |
86bd00a42831ea161bbe97b1b9850b21
|
|
| BLAKE2b-256 |
a22328adf2790160bba6330a95b621de2933449445bf4d90ba9409d3b6e51fb2
|