Metadata-Version: 2.4
Name: xctp
Version: 1.0.1
Summary: XCTP Quantum Computing SDK — 50,000 qubits on classical silicon. By Involved Involutions.
Author-email: "Paul J. Phillips" <Paul@Clearseassolutions.com>
Maintainer-email: Involved Involutions <Paul@Clearseassolutions.com>
License: Apache-2.0
Project-URL: Homepage, https://involvedinvolutions.com
Project-URL: Documentation, https://involvedinvolutions.com/docs-page
Project-URL: API Playground, https://involvedinvolutions.com/playground
Project-URL: Sign Up, https://involvedinvolutions.com/signup
Project-URL: Repository, https://github.com/Domusgpt/Toralabratory
Keywords: quantum,computing,emulation,simulator,qubits,XCTP,circuit,qiskit
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: click>=8.0
Provides-Extra: qiskit
Requires-Dist: qiskit>=1.0; extra == "qiskit"
Provides-Extra: all
Requires-Dist: qiskit>=1.0; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"

# XCTP — Quantum Computing SDK

**50,000 qubits. O(N) memory. 22 gates. Sub-millisecond execution.**

XCTP (Xylatic Cyclo-Toral Processing) is a quantum circuit emulation platform that runs on classical silicon. No quantum hardware required. No decoherence. No gate errors.

Built by [Involved Involutions](https://involvedinvolutions.com). Patent pending (CSS-2026-007-PROV).

## Install

```bash
pip install xctp
```

## Quick Start

```python
from xctp import XCTP

# Get your free API key at https://involvedinvolutions.com/signup
qpu = XCTP(api_key="xctp-your-key-here")

# Run a Bell state circuit
result = qpu.run(qpu.circuit(2).h(0).cx(0, 1), shots=1024)
print(result.counts)       # {'00': 512, '11': 512}
print(result.histogram())  # ASCII bar chart
```

### Run Locally (No API Key Needed)

```python
from xctp import XCTP

local = XCTP(backend="local")
result = local.run(local.circuit(2).bell(), shots=1000)
print(result.most_likely)  # '00' or '11'
print(result.probabilities)  # {'00': 0.49, '11': 0.51}
```

## Features

| Feature | Details |
|---------|---------|
| **Max qubits** | 50,000 (cloud) / ~25 (local) |
| **Gates** | H, X, Y, Z, S, T, Rx, Ry, Rz, P, CX, CZ, CP, SWAP, CCX, QFT + aliases |
| **Input formats** | Python SDK, OpenQASM 2.0, JSON |
| **Engines** | SparseQPU (exact), CNTA (O(N) geometric), TEE (legacy), auto dispatch |
| **Execution** | Sync, async, batch (up to 100 circuits) |
| **Webhooks** | POST results to your URL on job completion |

## Circuit Builder

Fluent API for constructing quantum circuits:

```python
from xctp import Circuit

# Build any circuit with chaining
circuit = (Circuit(4)
    .h(0)
    .cx(0, 1)
    .cx(1, 2)
    .cx(2, 3))  # 4-qubit GHZ state

# Single-qubit gates
Circuit(1).h(0)                    # Hadamard
Circuit(1).x(0)                    # Pauli-X (bit flip)
Circuit(1).z(0)                    # Pauli-Z (phase flip)
Circuit(1).rx(0, 3.14159)          # Rx rotation
Circuit(1).ry(0, 1.5708)           # Ry rotation
Circuit(1).rz(0, 0.7854)           # Rz rotation
Circuit(1).p(0, 1.5708)            # Phase gate
Circuit(1).s(0)                    # S gate (pi/2)
Circuit(1).t(0)                    # T gate (pi/4)

# Two-qubit gates
Circuit(2).cx(0, 1)                # CNOT
Circuit(2).cz(0, 1)                # Controlled-Z
Circuit(2).cp(0, 1, 0.7854)        # Controlled phase
Circuit(2).swap(0, 1)              # SWAP

# Three-qubit gates
Circuit(3).ccx(0, 1, 2)            # Toffoli

# Presets
Circuit(2).bell()                   # Bell state (2 qubits)
Circuit(8).ghz()                    # GHZ state (any N)
Circuit(4).h_all()                  # H on every qubit
```

### Serialization

```python
circuit = Circuit(2).bell()

# To/from JSON
json_str = circuit.to_json()
restored = Circuit.from_json(json_str)

# To/from dict
d = circuit.to_dict()
restored = Circuit.from_dict(d)
```

## Qiskit Integration

Convert existing Qiskit circuits to run on XCTP:

```python
from qiskit import QuantumCircuit
from xctp import XCTP
from xctp.interop.qiskit import from_qiskit, to_qiskit

# Qiskit -> XCTP
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()

qpu = XCTP(api_key="xctp-...")
result = qpu.run(from_qiskit(qc), shots=1024)
print(result.counts)  # {'00': 510, '11': 514}

# XCTP -> Qiskit (round-trip)
qc2 = to_qiskit(Circuit(2).bell())
```

Install Qiskit support: `pip install xctp[qiskit]`

## OpenQASM 2.0

Send QASM strings directly to the API:

```python
import requests

qasm = """
OPENQASM 2.0;
include "qelib1.inc";
qreg q[2];
creg c[2];
h q[0];
cx q[0],q[1];
measure q -> c;
"""

resp = requests.post("https://involvedinvolutions.com/api/v1/run-qasm", json={
    "api_key": "xctp-...",
    "qasm": qasm,
    "shots": 1024
})
print(resp.json()["counts"])
```

## CLI

```bash
xctp login                           # Store your API key
xctp health                          # Check API status
xctp account                         # Show tier and usage
xctp run circuit.json --shots 1024   # Run from JSON file
xctp run --bell --shots 1000         # Run Bell state
xctp run --ghz 8 --shots 1024        # Run 8-qubit GHZ
xctp run --bell --local              # Run offline (no API key)
```

## Async & Batch Execution

```python
qpu = XCTP(api_key="xctp-...")

# Async: submit and poll
job_id = qpu.submit(Circuit(2).bell(), shots=1024)
result = qpu.get_job(job_id)

# Batch: submit via API (up to 100 circuits)
import requests
resp = requests.post("https://involvedinvolutions.com/api/v1/batch", json={
    "api_key": "xctp-...",
    "circuits": [
        {"num_qubits": 2, "gates": [{"gate": "h", "target": 0}, {"gate": "cx", "control": 0, "target": 1}], "shots": 512},
        {"num_qubits": 3, "gates": [{"gate": "h", "target": 0}, {"gate": "cx", "control": 0, "target": 1}, {"gate": "cx", "control": 1, "target": 2}], "shots": 512},
    ]
})
batch = resp.json()
print(f"Batch {batch['batch_id']}: {batch['total']} circuits queued")
```

## Pricing

| Tier | Qubits | Compute | Cost |
|------|--------|---------|------|
| **Free** | 50 | 60 seconds | $0 |
| **Professional** | 1,000 | Unlimited | Half your current bill |
| **Enterprise** | 50,000 | Unlimited | Custom |

Get started free at [involvedinvolutions.com/signup](https://involvedinvolutions.com/signup).

## Links

- **Website:** [involvedinvolutions.com](https://involvedinvolutions.com)
- **API Docs:** [involvedinvolutions.com/docs-page](https://involvedinvolutions.com/docs-page)
- **Playground:** [involvedinvolutions.com/playground](https://involvedinvolutions.com/playground)
- **Sign Up:** [involvedinvolutions.com/signup](https://involvedinvolutions.com/signup)

## License

Apache 2.0 - [Involved Involutions](https://involvedinvolutions.com) / Clear Seas Solutions LLC
