Join the conversation

Join the community of Machine Learners and AI enthusiasts.

Sign Up
animesh1986 
posted an update 13 days ago
Post
167
I built a Quantum Information Agent 🔬, an LLM agent for photonic quantum information that you can trust with numbers.

Ask in plain English, e.g. “Apply global depolarizing noise with p = 0.3 to phi+ and compare it with local depolarizing noise on both photons.” The agent plans the work, calls tested physics tools, and answers with tables and figures.

What makes it different:
• The LLM never computes a number. 32 tools (NumPy/SciPy) do the physics, covered by 638 tests and 30 analytic checks.
• An answer checker compares the model’s text with the tool results before you see it. Unsupported numbers are sent back, and false physics statements are corrected or removed (e.g. an “azimuth” for circular light, CHSH values labelled CHSH/2, wrong comparisons between states).
• Open models through HF Inference Providers (DeepSeek V4 Flash, gpt-oss-120b), with free fallbacks and a daily cost cap.
• A Workbench tab runs the same tools without any model.

Built with LangGraph + Gradio. I’d love feedback, especially from people building agents for scientific domains.

🔗 Demo: animesh1986/quantum-information-agent
💻 Code and tests: https://github.com/animeshQKD/quantum-information-agent

The row-to-parameter checks in your README are a useful safeguard. Another adversarial case: ask for global depolarizing noise at p=0.3, have a scripted model call the tool with p=0.03, then faithfully quote that result. All output numbers could be grounded and within physical bounds, while answering the wrong experiment. Does verification bind the requested parameters to the tool arguments as well? A regression test for that case would separate answer grounding from correct task execution.

·

Thanks, this was a real gap. You're right: grounding (every number appears in a tool result) and physical bounds (C in [0, 1], CHSH ≤ 2√2) both pass when the tool is called with p = 0.03 and the result is quoted faithfully. The answer is consistent with itself, but it describes the wrong experiment.

What I added:

• Parameter binding. Each value in the question is bound to the channel named just before it, in the same sentence. "Global depolarizing with p = 0.3 and local depolarizing with p = 0.1" becomes (global_depolarizing, 0.3) and (depolarizing, 0.1). These pairs are compared with the actual arguments of the noise-tool calls. A mismatch is sent back to the model with the exact difference.

• No silent pass. If the model ignores the note, the answer reaches the user with a visible warning that names the requested and the used value.

• Swapped values. Asking for global 0.3 + local 0.1 but running global 0.1 + local 0.3 is also caught. A check on values alone misses it, because every number is used somewhere.

Your comment also made me look for the same failure one level up: a correct number attached to the wrong quantity. A real run on the Space wrote "p_W = 0.7, so concurrence = 0.7". 0.7 is grounded (it's 1 − p), but the concurrence is 0.55. That is now sent back as well.

Scripted-model tests replay your exact case (asked 0.3, called 0.03), the ignored note and the swap:
https://github.com/animeshQKD/quantum-information-agent/blob/main/test_parameter_binding.py

A known limit: the binding is lexical. Phrasings like "p = 0.3 and 0.1 respectively" aren't bound yet; in that case the check stays silent rather than guessing.

If you have other adversarial cases in mind, I'd be glad to add them as tests.