Table of Contents
Fetching ...

C4Q: A Chatbot for Quantum

Yaiza Aragonés-Soria, Manuel Oriol

TL;DR

C4Q addresses the challenge that generic LLMs produce unreliable quantum computing answers by implementing a classification-LLM driven pipeline that feeds a dedicated logical engine leveraging Qiskit to generate correct responses. The system covers defining, drawing, and applying a broad set of one- and two-qubit gates, with extensive training data generation and rigorous evaluation (QA LLM accuracy ≈ $0.98$ and robust unit tests with 151 cases). The architecture couples a Django API, PostgreSQL storage, and specialized LLMs to ensure accuracy over probabilistic output, aiming to make quantum programming accessible to non-experts. This work demonstrates a practical, accuracy-first chatbot that can serve as a reliable tool for learning and coding in quantum computing, with clear avenues for broadening topic coverage and improving conversational capabilities in future work.

Abstract

Quantum computing is a growing field that promises many real-world applications such as quantum cryptography or quantum finance. The number of people able to use quantum computing is however still very small. This limitation comes from the difficulty to understand the concepts and to know how to start coding. Therefore, there is a need for tools that can assist non-expert in overcoming this complexity. One possibility would be to use existing conversational agents. Unfortunately ChatGPT and other Large-Language Models produce inaccurate results. This article presents C4Q, a chatbot that answers accurately basic questions and guides users when trying to code quantum programs. Contrary to other approaches C4Q uses a pre-trained large language model only to discover and classify user requests. It then generates an accurate answer using an own engine. Thanks to this architectural design, C4Q's answers are always correct, and thus C4Q can become a support tool that makes quantum computing more available to non-experts.

C4Q: A Chatbot for Quantum

TL;DR

C4Q addresses the challenge that generic LLMs produce unreliable quantum computing answers by implementing a classification-LLM driven pipeline that feeds a dedicated logical engine leveraging Qiskit to generate correct responses. The system covers defining, drawing, and applying a broad set of one- and two-qubit gates, with extensive training data generation and rigorous evaluation (QA LLM accuracy ≈ and robust unit tests with 151 cases). The architecture couples a Django API, PostgreSQL storage, and specialized LLMs to ensure accuracy over probabilistic output, aiming to make quantum programming accessible to non-experts. This work demonstrates a practical, accuracy-first chatbot that can serve as a reliable tool for learning and coding in quantum computing, with clear avenues for broadening topic coverage and improving conversational capabilities in future work.

Abstract

Quantum computing is a growing field that promises many real-world applications such as quantum cryptography or quantum finance. The number of people able to use quantum computing is however still very small. This limitation comes from the difficulty to understand the concepts and to know how to start coding. Therefore, there is a need for tools that can assist non-expert in overcoming this complexity. One possibility would be to use existing conversational agents. Unfortunately ChatGPT and other Large-Language Models produce inaccurate results. This article presents C4Q, a chatbot that answers accurately basic questions and guides users when trying to code quantum programs. Contrary to other approaches C4Q uses a pre-trained large language model only to discover and classify user requests. It then generates an accurate answer using an own engine. Thanks to this architectural design, C4Q's answers are always correct, and thus C4Q can become a support tool that makes quantum computing more available to non-experts.
Paper Structure (16 sections, 8 figures)

This paper contains 16 sections, 8 figures.

Figures (8)

  • Figure 1: Answer of ChatGPT when asked about the quantum gate Pauli Z.
  • Figure 2: Answer of C4Q when asked to define the quantum gate Pauli Z.
  • Figure 3: Answer of C4Q when asked to create a circuit representation of the quantum gate Pauli Z.
  • Figure 4: Answer of C4Q when asked to apply the quantum gate Pauli Z on $\ket{1}$.
  • Figure 5: Architecture diagram of C4Q.
  • ...and 3 more figures