Files
lucidia-core/quantum_engine/layers.py
Alexa Louise 6afdb4b148 Initial extraction from blackroad-prism-console
Lucidia Core - AI reasoning engines for specialized domains:
- Physicist (867 lines) - energy modeling, force calculations
- Mathematician (760 lines) - symbolic computation, proofs
- Geologist (654 lines) - terrain modeling, stratigraphy
- Engineer (599 lines) - structural analysis, optimization
- Painter (583 lines) - visual generation, graphics
- Chemist (569 lines) - molecular analysis, reactions
- Analyst (505 lines) - pattern recognition, insights
- Plus: architect, researcher, mediator, speaker, poet, navigator

Features:
- FastAPI wrapper with REST endpoints for each agent
- CLI with `lucidia list`, `lucidia run`, `lucidia api`
- Codex YAML configurations for agent personalities
- Quantum engine extensions

12,512 lines of Python across 91 files.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 08:00:53 -06:00

22 lines
563 B
Python

"""Layer helpers wrapping TorchQuantum primitives."""
from __future__ import annotations
from torch import nn
from third_party import torchquantum as tq
class RandomLayer(tq.RandomLayer):
"""Expose torchquantum.RandomLayer."""
class QFTLayer(tq.QFTLayer):
"""Expose torchquantum.QFTLayer."""
class QutritEmulator(nn.Module):
"""Encode a trit with two qubits and penalise the forbidden state."""
def forward(self, qdev, wires):
# Probability of reaching the forbidden |11> state acts as a penalty
return qdev.prob_11(wires)