Skip to main content
Glama
LuuOW

qrouter

by LuuOW

qrouter

用于科学知识的量子自然语言检索。

一个研究产物:通过将查询和文本都编码为量子态(编译为变分电路的 DisCoCat 张量图),并利用玻恩定则(Born-rule)重叠进行排序,从而将查询路由到相关文本。目前可在经典计算机上模拟;设计目标是也能在 Quantinuum H 系列处理器和(通过嵌入)Xanadu 光子处理器上运行。

在线演示: https://qrouter.ask-meridian.uk

$ curl 'https://qrouter.ask-meridian.uk/rank?q=photons+going+through+barriers&top_k=3'

请参阅 docs/deploy.md 了解托管架构(共享虚拟机上的 systemd + Cloudflare Tunnel)以及如何在 stub 和 lambeq 后端之间切换服务器。

状态

暂定名称。第一天的脚手架。非产品。不稳定。甚至还没有形成明确的观点。

Related MCP server: ragi

这是什么,不是什么

是: 一个关于组合量子语义结构(参考 Coecke 等人的研究)是否能提供比经典稠密嵌入更有意义的检索行为的实验——特别是在几何结构比规模更重要的小型语料库上。

不是: 一个更快的检索器、更好的嵌入器,或者任何你应该在生产环境中使用的东西。在经典硬件上,量子电路模拟比 cosine(a, b) 更慢。重点在于结构是否重要,而不是它是否快速。

技术栈

  • Python 3.12+

  • lambeq — DisCoCat 解析 + 电路编译

  • PennyLane — 变分量子电路 + 自动微分

  • JAX — 梯度(lambeq 支持此后端)

  • pytest, ruff

  • uv 用于环境管理

第一周计划

  1. 第 1-2 天:阅读 Coecke 的《Mathematical Foundations of QNLP》(2020 年)+ Lorenz 等人的《QNLP in Practice》(2023 年)。运行 lambeq 的 MNIST 教程。

  2. 第 3-4 天:50 个 arXiv quant-ph 摘要 → DisCoCat 解析 → 模拟电路 → 成对玻恩定则重叠 → 玩具检索演示。

  3. 第 5-6 天:连接到 MCP stdio,以便 qrouter 可以作为工具从 Claude / Cursor / Windsurf 中调用。

  4. 第 7 天:决定——是深入研究纯 QNLP,还是转向光子储备池前端。

参考资料

  • Coecke, B., de Felice, G., Meichanetzidis, K., Toumi, A. (2020). Foundations for Near-Term Quantum Natural Language Processing.

  • Lorenz, R., Pearson, A., Meichanetzidis, K., Kartsaklis, D., Coecke, B. (2023). QNLP in Practice: Running Compositional Models of Meaning on a Quantum Computer. JAIR 76.

  • Quantinuum lambeq: https://github.com/CQCL/lambeq

许可证

MIT(见 LICENSE)。

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    A generic Model Context Protocol (MCP) server for high-accuracy document reranking using sentence-transformers (Cross-Encoder). Ideal for enhancing RAG and AI agent decision-making. sentence-transformers (Cross-Encoder) を使用して文書の関連度を再計算・ソートする汎用 MCP (Model Context Protocol) サーバー。
    1
    1
    Apache 2.0
  • A
    license
    A
    quality
    D
    maintenance
    Local-first RAG indexing and semantic search MCP server. Enables document retrieval and context-aware queries using local embedding models.
    3
    5 npm
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for Qdrant vector database with local BERT embeddings. Enables semantic search and vector storage operations through natural language.
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    A Model Context Protocol (MCP) server with Retrieval-Augmented Generation (RAG) for answering questions about imaginary SuperNova documentation. Enables semantic search over documentation using HuggingFace embeddings.
    1
    MIT