Expert agent in quantum code generation and quantum computing concept explanations.
The Quantum Developer Agent is a specialized AI agent that generates quantum code (QASM and Qiskit), explains quantum computing concepts, and implements classical quantum algorithms like Grover, Shor, Deutsch-Jozsa, and more.
- ๐ฌ Quantum Code Generation: Creates clean and efficient QASM 2.0/3.0 and Qiskit code
- ๐ Concept Explanations: Provides detailed explanations of quantum computing concepts
- ๐งฎ Algorithm Implementation: Implements classical quantum algorithms (Grover, Shor, Deutsch-Jozsa, QFT, etc.)
- โก Code Optimization: Suggests optimizations to reduce gates and circuit depth
- ๐ Documentation: Generates well-documented code with helpful comments
- Model: Granite 4.2 8B via Ollama (
ollama:granite4.2:8b) - Port: 8001
- Type: AgentStack Server with A2A protocol
- Tools: None (Pure LLM for code generation)
- Framework: BeeAI + Granite/Ollama + A2A
- Python 3.11+
- Ollama with
granite4.2:8b(Watsonx remains an optional fallback)
[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
"python-dotenv>=1.0.0", # Environment variable management
]-
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/
This agent is the quantum code generation specialist of the multi-agent system:
Responsibilities:
- โ Generate clean and efficient QASM 2.0/3.0 code
- โ Create documented Qiskit code
- โ Explain quantum computing concepts
- โ Implement classical quantum algorithms
- โ Optimize quantum circuits
- โ Provide educational examples
Does NOT:
- โ Does not execute circuits (use Computing Agent for that)
- โ Does not query backend status (use Status Agent)
- โ Does not retrieve job results (use Status Agent)
Communication:
-
Receives requests via A2A from Operations Agent (port 8000)
-
Responds with QASM/Qiskit code and explanations
-
Can be invoked directly on port 8001
-
uvpackage manager (recommended) orpip
cd quantum-developer-agent
# Install dependencies
uv sync
# or
pip install -e .Create .env file from template:
cp .env.example .envEdit .env with your credentials:
# Watsonx
WATSONX_API_KEY=your_watsonx_api_key_here
WATSONX_PROJECT_ID=your_project_id_here
WATSONX_API_URL=https://us-south.ml.cloud.ibm.com/ml/v1/text/chat?version=2023-05-29
# Developer Agent Configuration
OLLAMA_API_BASE=http://127.0.0.1:11434
DEVELOPER_MODEL=ollama:granite4.2:8b
DEVELOPER_HOST=127.0.0.1
DEVELOPER_PORT=8001# Using the start script (recommended)
./start.sh
# Or directly with uv
uv run server
# Or with Python
python -m quantum_developer_agent.agentcurl http://localhost:8001/.well-known/agent-card.jsoncurl -X POST http://localhost:8001 \
-H "Content-Type: application/json" \
-d '{
"messages": [{
"role": "user",
"content": "Create a Bell state circuit in QASM"
}]
}'Response includes:
- Complete QASM 2.0 code
- Detailed explanation of the circuit
- Expected measurement results
- Practical applications
curl -X POST http://localhost:8001 \
-H "Content-Type: application/json" \
-d '{
"messages": [{
"role": "user",
"content": "Implement Grover'\''s algorithm for 3 qubits"
}]
}'Response includes:
- Complete Grover's algorithm implementation
- Oracle and diffuser components
- Step-by-step explanation
- Quantum advantage analysis
curl -X POST http://localhost:8001 \
-H "Content-Type: application/json" \
-d '{
"messages": [{
"role": "user",
"content": "Explain what quantum entanglement is"
}]
}'Response includes:
- Detailed 3-4 paragraph explanation
- QASM code example demonstrating entanglement
- How the code works
- Practical applications
The agent has deep knowledge of these quantum algorithms:
- Grover's Algorithm: Quantum search with O(โN) complexity
- Amplitude Amplification: Generalization of Grover
- Deutsch-Jozsa Algorithm: Determine if function is constant or balanced
- Bernstein-Vazirani Algorithm: Find hidden binary string
- Simon's Algorithm: Find period of function with hidden symmetry
- Quantum Fourier Transform (QFT): Quantum analog of DFT
- Shor's Algorithm: Integer factorization in polynomial time
- Bell States, GHZ States, W States
- Quantum Teleportation
- Superdense Coding
- Swap Test
quantum-developer-agent/
โโโ src/
โ โโโ quantum_developer_agent/
โ โโโ __init__.py
โ โโโ agent.py # Main agent implementation
โโโ .env.example # Environment template
โโโ .gitignore # Git ignore rules
โโโ Dockerfile # Docker configuration
โโโ pyproject.toml # Project dependencies
โโโ start.sh # Start script
โโโ README.md # This file
dependencies = [
"agentstack-sdk==0.4.0rc1",
"beeai_framework>=0.1.76",
"python-dotenv>=1.0.0",
]# Build image
docker build -t quantum-developer-agent .
# Run container
docker run -p 8001:8001 --env-file .env quantum-developer-agent
# Run in background
docker run -d -p 8001:8001 --env-file .env --name quantum-dev quantum-developer-agent
# View logs
docker logs -f quantum-dev
# Stop container
docker stop quantum-devThe project is configured to use uv for dependency management and execution:
# Install dependencies
uv sync
# Run the server
uv run server
# Run with custom port
DEVELOPER_PORT=9001 uv run serverThis agent is designed to work as part of the Quantum Lab Agent System:
- Invoked by: Quantum Lab Agent (Port 8000)
- Communication: A2A protocol (Agent-to-Agent)
- Purpose: Generate quantum code when requested by the orchestrator
While designed for A2A communication, the agent can also be used standalone:
import requests
response = requests.post(
"http://localhost:8001",
json={
"messages": [{
"role": "user",
"content": "Create a superposition circuit"
}]
}
)
print(response.json())Problem: Port already in use
# Find process using port 8001
lsof -i :8001
# Kill process
kill -9 <PID>Problem: Missing dependencies
# Reinstall dependencies
uv sync --reinstallProblem: Watsonx API errors
- Check your API key in
.env - Verify project ID is correct
- Check Watsonx service status
- For local inference, run
ollama pull granite4.2:8b
Problem: Agent generates wrong algorithm
- Be specific in your request
- Use exact algorithm names (e.g., "Grover's algorithm" not "search algorithm")
- The agent is trained to distinguish between different algorithms
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
- Quantum Developer Agent - Code generation and algorithm implementation (this repository)
- Quantum Lab Agent System - Main orchestrator coordinating all agents
This agent is part of the Quantum Lab Agent System. For contributions, please refer to the main system repository.
Apache 2.0 License
- Built with BeeAI Framework
- Powered by IBM Watsonx
- LLM: Granite 4.2 8B via Ollama