ErrorCode ErrorCode is an enumeration representing error codes returned by QPilot OS operations. These codes indicate the type of failure that occurred during quantum job submission, execution, or result retrieval.
Overview Error codes help diagnose issues when interacting with the QPilot OS platform. Each code corresponds to a specific category of failure, from database errors to chip offline conditions.
Enum Values Success Value Description NO_ERROR_FOUND No error occurred; the operation completed successfully
Value Description DATABASE_ERROR A database operation failed ORIGINIR_ERROR The OriginIR program string is invalid or malformed JSON_FIELD_ERROR A required JSON field is missing or contains an invalid value ERR_PARAMETER Invalid or missing parameter in the request ERR_TASK_CONFIG Task configuration is invalid
Backend and Computation Errors Value Description BACKEND_CALC_ERROR The backend encountered an error during computation ERR_UNSUPPORT_BACKEND_TYPE The specified backend type is not supported ERR_QVM_INIT_FAILED Quantum virtual machine initialization failed ERR_QCOMPILER_FAILED The quantum compiler encountered an error CLUSTER_SIMULATE_CALC_ERR Cluster simulation computation failed CLUSTER_BASE Base cluster error
Resource Limit Errors Value Description ERR_TASK_BUF_OVERFLOW Task buffer overflow; too many tasks queued EXCEED_MAX_QUBIT The program exceeds the maximum number of qubits supported by the chip EXCEED_MAX_CLOCK The program exceeds the maximum circuit depth (clock cycles) allowed ERR_SUB_GRAPH_OUT_OF_RANGE The subgraph specification is out of the valid range ERR_TASK_STATUS_BUF_OVERFLOW Task status buffer overflow ERR_QPROG_LENGTH The quantum program exceeds the maximum allowed length
Circuit and Compilation Errors Value Description ERR_PRE_ESTIMATE Pre-estimation of circuit resources failed ERR_MATE_GATE_CONFIG Mate gate configuration error ERR_FIDELITY_MATRIX Fidelity matrix computation error ERR_QST_PROG Invalid Quantum State Tomography program ERR_EMPTY_PROG The submitted quantum program is empty ERR_QUBIT_SIZE Invalid qubit size specification ERR_QUBIT_TOPO Qubit topology error ERR_QUANTUM_CHIP_PROG Quantum chip program error ERR_REPEAT_MEASURE Repeated measurement configuration error ERR_OPERATOR_DB Operator database error
Task Management Errors Value Description ERR_UNKNOW_TASK_TYPE Unknown or unsupported task type ERR_NOT_FOUND_APP_ID The specified application ID was not found ERR_NOT_FOUND_TASK_ID The specified task ID was not found ERR_PARSER_SUB_TASK_RESULT Failed to parse sub-task results ERR_TASK_TERMINATED The task was terminated before completion
Network and Connection Errors Value Description ERR_SYS_CALL_TIME_OUT System call timed out ERR_INVALID_URL The provided URL is invalid ERR_BACKEND_CHIP_TASK_SOCKET_WRONG Backend chip task socket error ERR_TCP_INIT_FATLT TCP initialization failed ERR_TCP_SERVER_HALT TCP server is halted or unreachable
Chip Availability Value Description ERR_CHIP_OFFLINE The target quantum chip is currently offline ERR_SCHEDULE_CHIP_TOPOLOGY_SUPPORTED The chip topology is not supported by the scheduler
General Value Description UNDEFINED_ERROR An undefined or unrecognized error occurred
Examples python from pyqpanda3 . pilot_service import QPilotService
service = QPilotService ( url = " https://qpilot.originquantum.cn " , api_key = " key " )
task_id = service . async_run ( prog , shot = 1000 )
# Query and check for errors
state , results , err_code , err_info = service . query_result ( task_id )
if err_code == 0 : # NO_ERROR_FOUND
print ( " Operation succeeded " )
elif err_code == 1 : # ERR_CHIP_OFFLINE
print ( " The chip is offline; try a different backend " )
elif err_code == 2 : # EXCEED_MAX_QUBIT
print ( " Program uses too many qubits for this chip " )
elif err_code == 3 : # ERR_TASK_TERMINATED
print ( " Task was terminated " )
else :
print ( f "Error { err_code } : { err_info } " ) See Also