Files
blackroad-operating-system/packs/research-lab/quantum/quantum_engine/device.py
Alexa Louise 0108860bff feat: Add Research Lab pack with paralleled math modules
Create comprehensive research-lab pack structure with mathematical
and quantum computing modules from blackroad-prism-console:

Math Modules:
- hilbert_core.py: Hilbert space symbolic reasoning
- collatz/: Distributed Collatz conjecture verification
- linmath/: Linear mathematics C library
- lucidia_math_forge/: Symbolic proof engine
- lucidia_math_lab/: Experimental mathematics

Quantum Modules:
- lucidia_quantum/: Quantum core
- quantum_engine/: Circuit simulation

Experiments:
- br_math/: Gödel gap, quantum experiments

Includes pack.yaml manifest and comprehensive README.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 23:49:03 -06:00

20 lines
608 B
Python

"""Device wrapper around torchquantum.QuantumDevice."""
from __future__ import annotations
from third_party import torchquantum as tq
from .policy import guard_env, set_seed
class Device:
"""Lightweight wrapper providing deterministic setup and QASM export."""
def __init__(self, n_wires: int, bsz: int = 1, device: str = 'cpu', seed: int | None = None):
guard_env()
set_seed(seed)
self.qdev = tq.QuantumDevice(n_wires=n_wires, bsz=bsz, device=device)
def qasm(self) -> str:
"""Return a QASM-like string of the operations."""
return self.qdev.qasm()