Specialized agent for querying IBM Quantum backend status, technical information, and job results in real-time.
The Quantum Status Agent provides real-time IBM Quantum information using BeeAI with Granite 4.2 8B through Ollama (ollama:granite4.2:8b).
- π¬ Backend Status Queries: Lists all available quantum computers with operational status
- βοΈ Technical Information: Detailed backend properties (qubits, errors, topology)
- πΊοΈ Backend Canvas: Live chip topology, readout errors, queue, calibration, and coherence summary
- π Job Results Canvas: Opens freshly retrieved measurement histograms with the local query timestamp
- π Job Status & Results: Queries individual job status and measurement results
- π Job Comparison: Side-by-side comparison of multiple quantum jobs
- πΌοΈ Visual Histograms: Automatic generation of result visualizations
- π€ A2A Protocol: Can be invoked by other agents via Agent-to-Agent communication
βββββββββββββββββββββββββββββββββββββββββββ
β Quantum Status Agent (Port 8002) β
β β
β βββββββββββββββββββββββββββββββββββββ β
β β ReActAgent (Granite 4.2 8B) β β
β β - Reasoning & Acting Pattern β β
β β - Tool Selection & Execution β β
β βββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββ β
β β Query Tools β β
β β β’ IBMQuantumStatusTool β β
β β β’ IBMQuantumInfoTool β β
β β β’ IBMQuantumJobTool β β
β β β’ IBMQuantumJobComparisonTool β β
β βββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββ β
β β IBM Quantum Service β β
β β β’ QiskitRuntimeService β β
β β β’ Backend queries β β
β β β’ Job retrieval β β
β βββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββ
- Python 3.11 or higher
[project]
requires-python = ">=3.11,<4.0"
dependencies = [
"agentstack-sdk==0.4.0rc1", # Framework for creating agents
"beeai_framework>=0.1.76", # BeeAI Framework for agents
"qiskit>=1.0.0", # IBM Quantum SDK
"qiskit-ibm-runtime>=0.20.0", # IBM Quantum Runtime
"python-dotenv>=1.0.0", # Environment variable management
"matplotlib>=3.7.0", # Histogram generation
]-
Python 3.11+
python --version # Must be 3.11 or higher -
uv (Package Manager - Recommended)
# Install uv curl -LsSf https://astral.sh/uv/install.sh | sh # Verify installation uv --version
-
IBM Watsonx (Credentials required)
- Watsonx API Key
- Watsonx Project ID
- Get them at: https://cloud.ibm.com/
-
IBM Quantum (Credentials required)
- IBM Quantum Token
- Get it at: https://quantum.ibm.com/
This agent is the status query specialist of the multi-agent system:
Responsibilities:
- β List available quantum backends (simulators and real hardware)
- β Query technical backend information (qubits, errors, topology)
- β Get individual job status
- β Retrieve completed execution results
- β Compare results from multiple jobs
- β Generate measurement histograms
- β Provide real-time information
Does NOT:
- β Does not generate quantum code (use Developer Agent for that)
- β Does not execute circuits (use Computing Agent for that)
- β Only queries, does not modify or execute
Communication:
- Receives requests via A2A from Operations Agent (port 8000)
- Responds with tables, statuses, and formatted results
- Can be invoked directly on port 8002
Available tools:
IBMQuantumStatusTool- Lists available backendsIBMQuantumInfoTool- Detailed backend informationIBMQuantumJobTool- Job status and resultsIBMQuantumJobComparisonTool- Multi-job comparison
- uv package manager (recommended)
- IBM Quantum account with API token
- IBM Watsonx account with API key
# Clone the repository
git clone <your-repo-url>
cd quantum-status-agent
# Copy environment template
cp .env.example .envEdit .env with your credentials:
# IBM Quantum Configuration
QISKIT_IBM_TOKEN=your_ibm_quantum_token_here
# IBM Watsonx Configuration
WATSONX_API_URL=https://us-south.ml.cloud.ibm.com/ml/v1/text/chat?version=2023-05-29
WATSONX_API_KEY=your_watsonx_api_key_here
WATSONX_PROJECT_ID=your_watsonx_project_id_here
# Status Agent Model
OLLAMA_API_BASE=http://127.0.0.1:11434
STATUS_MODEL=ollama:granite4.2:8b
# Server Configuration
STATUS_HOST=127.0.0.1
STATUS_PORT=8002Using uv (recommended):
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e .Using pip:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e .Option A: Using the start script (recommended)
chmod +x start.sh
./start.shOption B: Using uv directly
uv run serverOption C: Using Python
python -m quantum_status_agent.agentThe agent will start on http://127.0.0.1:8002
Lists all available quantum computers with their operational status.
Parameters:
only_hardware(bool): If true, shows only real quantum hardware (no simulators)
Example Query:
"What quantum computers are available?"
"Which is the least busy backend?"
"Show me only real quantum hardware"
Output:
- Table with all backends
- Type (Hardware/Simulator)
- Number of qubits
- Operational status
- Jobs in queue
- Recommendation for least busy
Gets detailed technical information about a specific backend.
Parameters:
backend_name(str): Name of the backend (e.g., "ibm_brisbane")
Example Query:
"Give me detailed information about ibm_brisbane"
"What are the properties of ibm_kingston?"
"How many qubits does ibm_kyiv have?"
Output:
- Qubit properties (T1, T2, frequency)
- Quantum gate errors
- Connectivity topology rendered as an Agent Stack Canvas artifact
- Visual health summary with queue, calibration, readout error, two-qubit error, T1, and T2 medians
- Supported operations
- Processor configuration
Canvas is generated only when the request names exactly one ibm_* backend. Backend lists and job queries remain text responses.
Queries the status and results of quantum jobs.
Parameters:
job_id(str): Job ID to query, or empty to list all jobsfilter_status(str): Filter by status ("all", "running", "queued", "done", "error")
Example Query:
"What is the status of job d671cklbujdc73cvbp30?"
"Show me my recent jobs"
"Show me my running jobs"
"List my completed jobs"
Output:
- Job status (QUEUED, RUNNING, DONE, ERROR)
- Measurement results (if completed)
- Probability distribution
- Visual histogram (PNG)
- Recent jobs table (if listing)
Compares results from multiple quantum jobs side by side.
Parameters:
job_ids(list): List of 2 to 5 Job IDs to compare
Example Query:
"Compare the results of jobs d6cd297g4t5c7385dh4g and d6cd2bknsg9c739a32p0"
"Compare jobs abc123 and xyz789"
"What is the difference between these jobs: job1, job2, job3?"
Output:
- Comparative table with results from each job
- Analysis of differences
- Identification of patterns
- Most probable states from each job
Query:
What quantum computers are available?
Response:
π¬ **Available Quantum Computers on IBM Quantum**
| Backend | Type | Qubits | Status | Queue | Version |
|---------|------|--------|--------|-------|---------|
| ibm_brisbane | βοΈ Hardware | 127 | π’ OK | 5 | 2 |
| ibm_kyoto | βοΈ Hardware | 127 | π’ OK | 12 | 2 |
| ibm_osaka | βοΈ Hardware | 127 | π’ OK | 8 | 2 |
| simulator_statevector | π» Simulator | 5000 | π’ OK | 0 | 1 |
π‘ **Recommendation:** ibm_brisbane has the shortest queue (5 jobs)
Query:
Give me detailed information about ibm_brisbane
Response:
βοΈ **IBM Brisbane - Technical Information**
**General:**
- Qubits: 127
- Status: π’ Operational
- Queue: 5 jobs
- Version: 2
**Qubit Properties (Average):**
- T1 (relaxation): 245.3 ΞΌs
- T2 (coherence): 189.7 ΞΌs
- Frequency: 4.85 GHz
- Readout error: 1.2%
**Gate Errors:**
- Single-qubit gates: 0.03%
- Two-qubit gates (CX): 0.8%
**Topology:** Heavy-hex lattice
**Max Circuits:** 300
**Max Shots:** 100,000
Query:
What is the status of job d671cklbujdc73cvbp30?
Response:
π **Job Status: d671cklbujdc73cvbp30**
**Status:** β
DONE
**Backend:** ibm_brisbane
**Shots:** 1024
**Created:** 2024-03-05 14:23:15 UTC
**Results:**
| State | Counts | Probability |
|-------|--------|-------------|
| 100 | 963 | 94.04% |
| 000 | 31 | 3.03% |
| 101 | 18 | 1.76% |
| 001 | 12 | 1.17% |
[Histogram visualization]
π― **Interpretation:** Grover's algorithm successfully found the target state |100β© with 94% probability.
Query:
Compare the results of jobs d6cd297g4t5c7385dh4g and d6cd2bknsg9c739a32p0
Response:
π **Job Comparison**
| State | Job 1 (d6cd297g...) | Job 2 (d6cd2bkn...) |
|-------|---------------------|---------------------|
| 00 | 512 (50.0%) | 498 (48.6%) |
| 11 | 498 (48.6%) | 514 (50.2%) |
| 01 | 8 (0.8%) | 7 (0.7%) |
| 10 | 6 (0.6%) | 5 (0.5%) |
**Analysis:**
- Both jobs show Bell state entanglement pattern
- Expected distribution: ~50% |00β© and ~50% |11β©
- Small variations are due to quantum noise
- Results are consistent between executions
docker build -t quantum-status-agent .docker run -d \
--name quantum-status-agent \
-p 8002:8002 \
--env-file .env \
quantum-status-agentversion: '3.8'
services:
quantum-status-agent:
build: .
ports:
- "8002:8002"
env_file:
- .env
restart: unless-stoppedThis agent can be invoked by other agents using the A2A (Agent-to-Agent) protocol.
from agentstack_sdk.a2a.client import A2AClient
# Create A2A client
status_client = A2AClient(base_url="http://127.0.0.1:8002")
# Query backend status
response = await status_client.run(
input="What quantum computers are available?",
context=context
)The agent exposes the following skills via A2A:
- quantum-backend-status: Backend availability queries
- quantum-backend-info: Technical backend information
- quantum-job-status: Job status and results
- quantum-job-comparison: Multi-job comparison
The agent uses a ReAct (Reasoning and Acting) pattern to:
- Analyze the user query
- Select the appropriate tool
- Execute the tool with correct parameters
- Format the response with the tool output
All responses follow this structure:
- Tool Output: Complete, unmodified data from the tool
- Context: Brief explanation or interpretation
- Suggestions: Next steps or related queries (optional)
- β Always use a tool - Never respond without querying IBM Quantum
- β Show complete data - Never summarize or omit information
- β Exact format - Copy tool output exactly as returned
- β Never invent data - All information must come from tools
quantum-status-agent/
βββ src/
β βββ quantum_status_agent/
β βββ __init__.py
β βββ agent.py # Main agent logic
β βββ tools/
β βββ __init__.py
β βββ quantum_status_tool.py # Backend listing
β βββ quantum_info_tool.py # Backend details
β βββ quantum_job_tool.py # Job queries
β βββ quantum_job_comparison_tool.py # Job comparison
βββ pyproject.toml # Dependencies
βββ .env.example # Environment template
βββ .gitignore
βββ Dockerfile
βββ start.sh # Startup script
βββ README.md
- Create a new tool class in
src/quantum_status_agent/tools/ - Inherit from
Toolbase class - Implement
inputSchema()and_run()methods - Register in
tools/__init__.py - Add to agent's tool list in
agent.py
# Install dev dependencies
uv pip install -e ".[dev]"
# Run tests
pytest
# Type checking
mypy src/- Never commit
.envfile with real credentials - Use environment variables for all sensitive data
- Rotate API keys regularly
- Use HTTPS in production
- Implement rate limiting for public deployments
| Variable | Description | Required | Default |
|---|---|---|---|
QISKIT_IBM_TOKEN |
IBM Quantum API token | Yes | - |
WATSONX_API_URL |
Watsonx API endpoint | Yes | - |
WATSONX_API_KEY |
Watsonx API key | Yes | - |
WATSONX_PROJECT_ID |
Watsonx project ID | Yes | - |
STATUS_MODEL |
BeeAI provider-qualified model | No | ollama:granite4.2:8b |
STATUS_HOST |
Server host | No | 127.0.0.1 |
STATUS_PORT |
Server port | No | 8002 |
Problem: Missing environment variables
Solution:
# Check .env file exists
ls -la .env
# Verify all required variables are set
cat .env | grep -E "QISKIT_IBM_TOKEN|WATSONX_API_KEY|WATSONX_PROJECT_ID"Problem: Invalid token or network issues
Solution:
# Test IBM Quantum connection
python -c "from qiskit_ibm_runtime import QiskitRuntimeService; QiskitRuntimeService(token='YOUR_TOKEN').backends()"Problem: Backend not found or job ID invalid
Solution:
- Verify backend name is correct (use status tool to list available backends)
- Check job ID format (should be alphanumeric string)
- Ensure job belongs to your IBM Quantum account
This agent is part of the Quantum Computing Multi-Agent System. Here are the related repositories:
- Quantum Computing Agent - Circuit execution specialist
- Quantum Status Agent - Status monitoring and job tracking (this repository)
- Quantum Developer Agent - Code generation and algorithm implementation
- Quantum Lab Agent System - Main orchestrator coordinating all agents
- IBM Quantum Documentation
- Qiskit Documentation
- BeeAI Framework
- AgentStack SDK
- A2A Protocol Specification
[Your License Here]
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
For issues and questions:
- Open an issue on GitHub
- Contact: [[email protected]]
Built with β€οΈ using BeeAI Framework, IBM Watsonx, and IBM Quantum