QPanda3 Runtime MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| QPANDA3_API_KEY | Yes | Your Origin Quantum cloud API key for authentication | |
| QPANDA3_SERVER_URL | No | The URL of the QPanda3 Runtime server (default is https://qpanda3-runtime.qpanda.cn) | https://qpanda3-runtime.qpanda.cn |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tasks | {
"list": {},
"cancel": {},
"requests": {
"tools": {
"call": {}
},
"prompts": {
"get": {}
},
"resources": {
"read": {}
}
}
} |
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| setup_origin_quantum_account_toolA | Configure Origin Quantum qcloud account authentication. Set up credentials to access Origin Quantum computing services. You can provide credentials directly, via a config file, or through environment variables. Args: api_key: API key for authentication. If not provided, reads from QPANDA3_API_KEY environment variable. channel: Channel type - always "qcloud". config_path: Path to config.yml file containing api_key. Returns: Setup status and account information including: - status: "success" or "error" - message: Status description - channel: The channel being used - available_devices: Number of accessible QPU devices Example: # Using direct credentials setup_origin_quantum_account_tool(api_key="your_api_key") |
| list_saved_accounts_toolB | List saved account information. Returns information about the current session's authentication status. QPanda3 Runtime uses session-based authentication rather than persistent account storage. Returns: Dictionary containing: - status: "success" or "error" - accounts: List of account information - message: Status description |
| active_account_info_toolA | Get information about the currently active account. Returns details about the account being used in the current session, including channel type and connection status. Returns: Dictionary containing: - status: "success" or "error" - account: Account details including channel and connection status |
| list_qpu_devices_toolB | List all available QPU (Quantum Processing Unit) devices. Retrieves a list of all quantum computing devices accessible through the current account. Returns: Dictionary containing: - status: "success" or "error" - devices: List of devices, each with: - id: Device identifier - name: Device name - num_qubits: Number of qubits - operational: Whether device is operational - total_devices: Total count of available devices Example: devices = list_qpu_devices_tool() # Use devices["devices"][0]["id"] to get device ID for other tools |
| get_qpu_properties_toolA | Get detailed properties of a specific QPU device. Retrieve comprehensive information about a quantum computing device including its capabilities and current status. Args: device_id: The ID of the quantum device (e.g., '20'). Use list_qpu_devices_tool to find available device IDs. Returns: Dictionary containing: - status: "success" or "error" - device_id: The requested device ID - num_qubits: Number of qubits on the device - topology: Qubit connectivity information - basis_gates: Native gates supported by the device - operational: Current operational status Example: props = get_qpu_properties_tool("20") print(f"Device has {props['num_qubits']} qubits") |
| sample_toolA | Execute quantum circuit sampling task. Submit a quantum circuit for sampling on a QPU device. Sampling executes the circuit multiple times and returns the measurement outcome distribution. Args:
circuit: Quantum circuit(s) to execute. Accepts:
- Single circuit as string (QProg/QCircuit/OriginIR format)
- List of circuits for batch execution
- OriginIR example:
Returns: Dictionary containing: - status: "success" or "error" - task_id: ID for tracking the task - device_id: Target device - shots: Number of shots requested - message: Status message - note: Instructions for retrieving results Example: # Submit a Bell state circuit for sampling result = sample_tool( circuit="QINIT 2\nCREG 2\nH q[0]\nCNOT q[0],q[1]\nMEASURE q[0],c[0]\nMEASURE q[1],c[1]", device_id="20", shots=1000 ) task_id = result["task_id"] Note: Use get_task_status_tool to check progress and get_task_results_tool to retrieve results after the task completes. |
| estimate_toolA | Execute expectation estimation task. Submit a quantum circuit for expectation value estimation. This computes the expectation value ⟨ψ|O|ψ⟩ where |ψ⟩ is the quantum state produced by the circuit and O is the observable. Args: circuit: Quantum circuit(s) to execute. Accepts: - Single circuit as string (QProg/QCircuit/OriginIR format) - List of circuits for batch execution - Note: Circuit should NOT contain measurement operations observable: Observable to measure. Accepts: - Dict format: {"Z0 Z1": 0.5, "X0": -0.3} - Pauli operator string: "IIXY" device_id: Target device ID (e.g., '20'). Returns: Dictionary containing: - status: "success" or "error" - task_id: ID for tracking the task - device_id: Target device - message: Status message - note: Instructions for retrieving results Example: # Estimate expectation value of Z0*Z1 result = estimate_tool( circuit="QINIT 2\nCREG 2\nH q[0]\nCNOT q[0],q[1]", observable="Z0 Z1", device_id="20" ) Note: Use get_task_status_tool to check progress and get_task_results_tool to retrieve results after the task completes. |
| get_task_status_toolA | Get the execution status of a task. Check the current status of a submitted quantum computing task. Args: task_id: The ID of the task (returned by sample_tool or estimate_tool). Returns: Dictionary containing: - status: "success" or "error" - task_id: The task ID - task_status: One of: - "PENDING": Waiting to execute - "RUNNING": Currently executing - "DONE": Completed successfully - "FAILED": Execution failed - "CANCELLED": Cancelled by user - progress: Execution progress (if available) - error_message: Error description (if failed) Example: status = get_task_status_tool("task_12345") if status["task_status"] == "DONE": results = get_task_results_tool("task_12345") |
| get_task_results_toolA | Get the computation results of a completed task. Retrieve the results from a completed quantum computing task. The task must be in DONE status to retrieve results. Args: task_id: The ID of the completed task. Returns: For sampling tasks: - status: "success", "pending", or "error" - task_id: The task ID - task_status: Current status - results: List of measurement outcomes, each containing: - key: List of measurement outcomes (hex format, e.g., "0x0", "0x3") - value: Corresponding probabilities or counts - message: Status message Example: # First check status status = get_task_status_tool("task_12345") if status["task_status"] == "DONE": # Then get results results = get_task_results_tool("task_12345") print(f"Measurement outcomes: {results['results']}") |
| cancel_task_toolA | Cancel a running or pending task. Request cancellation of a submitted task. This is only effective if the task has not yet completed. Args: task_id: The ID of the task to cancel. Returns: Dictionary containing: - status: "success" or "error" - task_id: The task ID - message: Cancellation status Example: cancel_task_tool("task_12345") |
| list_my_tasks_toolB | List user's recent tasks. Retrieve a list of recently submitted quantum computing tasks. Args: limit: Maximum number of tasks to return (default: 10). Returns: Dictionary containing: - status: "success" or "error" - tasks: List of task information, each containing: - task_id: Task identifier - status: Current task status - creation_date: When task was created - backend: Target device - total_tasks: Total number of tasks returned Example: tasks = list_my_tasks_tool(limit=5) for task in tasks["tasks"]: print(f"{task['task_id']}: {task['status']}") |
| create_circuit_observable_binding_toolA | Create a CircuitObservableBinding for multi-objective quantum decision making. This creates a program set that manages multiple quantum circuits and multiple observables for multi-target decision paradigms. This is useful for quantum multi-objective decision scenarios where you need to evaluate multiple strategies (circuits) against multiple objective dimensions (observables). Args: circuits: List of quantum circuits in QProg/QCircuit/OriginIR format. Each circuit represents a different strategy to evaluate. observables: List of observables (Hamiltonians). Each observable represents a different objective dimension to measure. Supports dict format: {"Z0 Z1": 0.5, "X0": -0.3} Returns: Dictionary containing: - status: "success" or "error" - binding_id: Unique ID for referencing this binding (use with add_product_rule_tool, add_zip_rule_tool, and estimate_with_binding_tool) - num_circuits: Number of circuits in the binding - num_observables: Number of observables in the binding - message: Status description Example: # Create binding with 3 circuits and 2 observables binding = create_circuit_observable_binding_tool( circuits=[ "QINIT 2\nCREG 2\nH q[0]\nCNOT q[0],q[1]", "QINIT 2\nCREG 2\nX q[0]\nCNOT q[0],q[1]", "QINIT 2\nCREG 2\nZ q[0]\nSWAP q[0],q[1]" ], observables=[ {"Z0 Z1": 1.0}, {"X0": 0.5} ] ) binding_id = binding["binding_id"] Note: After creating a binding, use add_product_rule_tool or add_zip_rule_tool to define the combinations, then use estimate_with_binding_tool to submit. |
| add_product_rule_toolA | Add product (Cartesian product) rule to CircuitObservableBinding. This generates all combinations of the specified circuits with the specified observables. This is analogous to Python's itertools.product function. For example, if circuit_indices=[0,1,2] and observable_indices=[0,1], it generates combinations: (0,0), (0,1), (1,0), (1,1), (2,0), (2,1). Args: binding_id: The ID returned by create_circuit_observable_binding_tool. circuit_indices: List of circuit indices to include in the product. observable_indices: List of observable indices to include in the product. Returns: Dictionary containing: - status: "success" or "error" - binding_id: The binding ID - combinations_added: Number of combinations added - message: Status description Example: # Add all combinations of 3 circuits with 2 observables (6 total) result = add_product_rule_tool( binding_id="your_binding_id", circuit_indices=[0, 1, 2], observable_indices=[0, 1] ) # This adds combinations: (0,0), (0,1), (1,0), (1,1), (2,0), (2,1) |
| add_zip_rule_toolA | Add zip (one-to-one) rule to CircuitObservableBinding. This generates one-to-one pairs of circuits and observables. This is analogous to Python's zip function. For example, if circuit_indices=[0,2] and observable_indices=[1,0], it generates combinations: (0,1), (2,0). Args: binding_id: The ID returned by create_circuit_observable_binding_tool. circuit_indices: List of circuit indices (must match length of observable_indices). observable_indices: List of observable indices (must match length of circuit_indices). Returns: Dictionary containing: - status: "success" or "error" - binding_id: The binding ID - combinations_added: Number of combinations added - message: Status description Example: # Add specific circuit-observable pairs result = add_zip_rule_tool( binding_id="your_binding_id", circuit_indices=[0, 2], observable_indices=[1, 0] ) # This adds 2 combinations: (circuit_0, observable_1), (circuit_2, observable_0) |
| estimate_with_binding_toolA | Execute expectation estimation using CircuitObservableBinding. Submit a multi-objective expectation estimation task using the previously created CircuitObservableBinding with its product/zip rules defined. Args: binding_id: The ID returned by create_circuit_observable_binding_tool. device_id: Target device ID (e.g., '20'). Returns: Dictionary containing: - status: "success" or "error" - task_id: ID for tracking the task - binding_id: The binding ID used - device_id: Target device - message: Status message - note: Instructions for retrieving results Example: # After creating binding and adding rules result = estimate_with_binding_tool( binding_id="your_binding_id", device_id="20" ) task_id = result["task_id"] Note: Use get_task_status_tool and get_task_results_tool to check progress and retrieve results. |
| list_bindings_toolB | List all stored CircuitObservableBinding objects. Returns a list of all bindings created in the current session. Returns: Dictionary containing: - status: "success" or "error" - bindings: List of binding information - total_bindings: Total count of bindings |
| delete_binding_toolB | Delete a stored CircuitObservableBinding object. Remove a binding from the session storage. Args: binding_id: The ID of the binding to delete. Returns: Dictionary containing: - status: "success" or "error" - message: Status description |
| batch_sample_toolA | Execute batch quantum circuit sampling task. Submit multiple quantum circuits for sampling in a single batch. This is more efficient than submitting circuits one by one. Args: circuits: List of quantum circuits in QProg/QCircuit/OriginIR format. device_id: Target device ID (e.g., '20'). shots: Number of sampling shots per circuit (default: 1000). measure_qubits: Qubit indices to measure (optional). If not specified, uses measurement operations in the circuits. Returns: Dictionary containing: - status: "success" or "error" - task_id: ID for tracking the task - device_id: Target device - num_circuits: Number of circuits in the batch - shots: Number of shots per circuit - message: Status message Example: result = batch_sample_tool( circuits=[ "QINIT 2\nCREG 2\nH q[0]\nCNOT q[0],q[1]\nMEASURE q[0],c[0]\nMEASURE q[1],c[1]", "QINIT 2\nCREG 2\nX q[0]\nCNOT q[0],q[1]\nMEASURE q[0],c[0]\nMEASURE q[1],c[1]" ], device_id="20", shots=1000 ) Note: Use get_task_status_tool and get_task_results_tool to check progress and retrieve results. |
| batch_estimate_toolA | Execute batch expectation estimation with a single observable. Submit multiple quantum circuits for expectation value estimation with a single observable. This is the "n circuits + 1 observable" pattern, useful for comparing different circuit strategies against the same metric. Args: circuits: List of quantum circuits in QProg/QCircuit/OriginIR format. Note: Circuits should NOT contain measurement operations. observable: Observable to measure for all circuits. Supports: - Dict format: {"Z0 Z1": 0.5, "X0": -0.3} device_id: Target device ID (e.g., '20'). Returns: Dictionary containing: - status: "success" or "error" - task_id: ID for tracking the task - device_id: Target device - num_circuits: Number of circuits in the batch - message: Status message Example: result = batch_estimate_tool( circuits=[ "QINIT 2\nCREG 2\nH q[0]\nCNOT q[0],q[1]", "QINIT 2\nCREG 2\nX q[0]\nCNOT q[0],q[1]" ], observable={"Z0 Z1": 1.0}, device_id="20" ) Note: Use get_task_status_tool and get_task_results_tool to check progress and retrieve results. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| get_service_status_resource | Get current QPanda3 Runtime service status. Returns information about the connection status and available devices. |
| get_bell_state_resource | Get a ready-to-run Bell state (quantum entanglement) circuit. Returns a 2-qubit circuit that creates the Bell state |Φ+⟩ = (|00⟩ + |11⟩)/√2. This is the simplest demonstration of quantum entanglement. The returned circuit field can be passed directly to sample_tool. Expected results: ~50% '00' and ~50% '11', never '01' or '10'. |
| get_ghz_state_resource | Get a ready-to-run 3-qubit GHZ state (multi-qubit entanglement) circuit. Returns a circuit that creates the GHZ state |GHZ⟩ = (|000⟩ + |111⟩)/√2. This generalizes the Bell state to demonstrate 3-qubit entanglement. The returned circuit field can be passed directly to sample_tool. Expected results: ~50% '000' and ~50% '111', no other outcomes. |
| get_random_circuit_resource | Get a ready-to-run quantum random number generator circuit. Returns a 4-qubit circuit that generates truly random bits using quantum superposition. Each qubit is put in superposition and measured. The returned circuit field can be passed directly to sample_tool. Expected results: All 16 outcomes (0000-1111) with ~6.25% probability each. |
| get_superposition_resource | Get the simplest possible quantum circuit - single qubit superposition. Returns a 1-qubit circuit that demonstrates quantum superposition by applying a Hadamard gate to create (|0⟩ + |1⟩)/√2. The returned circuit field can be passed directly to sample_tool. Expected results: ~50% '0' and ~50% '1'. |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/OriginQ/qpanda3-runtime-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server