Subscription Messages (PUB-SUB Mode) ==================================== Task Status ----------- **Function:** Real-time task status information is pushed by the control system when the stage of task calculation changes. **Operation**: Fixed as bytes: ``task_status``. **Pushed Message Format:** - **MsgType** (``String``): [Required] Message type, fixed as ``TaskStatus``. - **SN** (``Uint32_t``): [Required] Message sequence ID. - **TaskId** (``String``): [Required] Task ID. - **TaskStatus** (``Uint32_t``): [Required] Task status, refer to the task status definition. **Example:** .. code-block:: json { "MsgType":"TaskStatus", "SN":0, "TaskId":"11D919FA044846F3B4DF453A827AE901", "TaskStatus":3 } Chip Configuration Info Update Flag ----------------------------------- **Function:** After the chip parameters change, the measurement and control all-in-one machine pushes a message informing Sinan that it can send a get request via Router-Dealer mode to query the latest chip configuration information. **Operation**: Fixed as bytes: ``chip_update``. **Pushed Message Format:** - **UpdateFlag** (``Bool``): [Required] Update flag. - **LastUpdateTime** (``Uint64_t``): [Required] Last update time. **Example:** .. code-block:: json { "UpdateFlag":true, "LastUpdateTime": 1705307288685 } Chip Resource Status -------------------- **Function:** When the measurement and control all-in-one machine calculates a task, in multi-thread mode, as long as chip resources are altered (locked, released), the control service will push detailed thread data to Sinan (the qubit usage status of each control service thread); QPilot only needs to focus on the ``use_bits`` field for each thread (t0, t1, t2...). **Operation**: Fixed as bytes: ``probe``. **Pushed Message Format:** - **core_thread.t0** (``Object``): [Required] Thread name of the measurement and control service. - **core_thread.t0.use_bits** (``String Array``): [Required] All qubits of the current thread. **Example:** .. code-block:: json { "inst_status": 1, "linked": 1, "timestamp": 1695182448.7963016, "scheduler": { "status": "InitialState", "queue_len": 3 }, "core_status": { "empty_thread": 3, "pause_read": 0, "thread_num": 5 }, "core_thread": { "t0": { "status": "waiting", "thread_id": "t0", "task_id": "650a6e6f197b42e9aeaad6d6", "start_time": 1695182447.5371444, "user": "admin3", "env_bits": [ "", "", "", ""], "use_bits": [ "q56", "q18", "q68", "q69", "q6", "q2", "q67"] }, "t1": { "status": "ready", "task_id": null, "start_time": null, "user": null, "env_bits": [], "use_bits": [] }, "t2": { "status": "ready", "task_id": null, "start_time": null, "user": null, "env_bits": [], "use_bits": [] }, "t3": { "status": "waiting", "thread_id": "t3", "task_id": "650a6e6e197b42e9aeaad6d0", "start_time": 1695182446.8370538, "user": "admin3", "env_bits": [ "", "", "", "", "", "", "" ], "use_bits": [ "q59", "q30", "q50", "q33", "q47", "q19", "q38" ] }, "t4": { "status": "ready", "task_id": null, "start_time": null, "user": null, "env_bits": [], "use_bits": [] } } } Auto-Calibration Start Info --------------------------- **Function:** When the measurement and control all-in-one machine conducts automatic calibration, it will push calibration qubit info to Sinan; the calibrating qubits will be unavailable during this period. **Operation**: Fixed as bytes: ``calibration_start``. **Pushed Message Format:** - **qubits** (``String Array``): [Required] Calibrated single qubit information. - **couplers** (``String Array``): [Required] Couplers. - **pairs** (``String Array``): [Required] Calibrated qubit pair information. - **discriminators** (``String Array``): [Required] Discriminators. - **point_label** (``Int``): [Required] Used to indicate which label the current calibration acts upon. **Example:** .. code-block:: json { "config_flag": false, "qubits":["q0", "q1", "q2", "q3"], "couplers":["c0-1", "c11-12", "c2-3"], "pairs": ["q0q1", "q2q3"], "discriminators":["q0_01.bin", "q1_01.bin", "q2_01.bin", "q3_01.bin"], "point_label": 2 } Auto-Calibration End Info ------------------------- **Function:** After completing the calibration, a completion message will be pushed to Sinan, and the qubits will return to available status. **Operation**: Fixed as bytes: ``calibration_done``. **Pushed Message Format:** - **qubits** (``String Array``): [Required] Calibrated single qubit information. - **couplers** (``String Array``): [Required] Couplers. - **pairs** (``String Array``): [Required] Calibrated qubit pair information. - **discriminators** (``String Array``): [Required] Discriminators. **Example:** .. code-block:: json { "qubits":["q0", "q1", "q2", "q3"], "couplers":["c0-1", "c11-12", "c2-3"], "pairs": ["q0q1", "q2q3"], "discriminators":["q0", "q1", "q2", "q3"], "config_flag":true, "point_label": 2 } Chip Maintenance Info --------------------- **Function:** Receive chip maintenance start and end info to trigger an automatic pause in Sinan. **If the maintenance time exceeds 2 hours, Sinan pushes an offline maintenance notification to the cloud platform; if the maintenance time does not exceed 2 hours, only Sinan pauses and the cloud platform remains online normally**. **Operation**: Fixed as bytes: ``chip_protect``. **Pushed Message Format:** - **ProtectFlag** (``Bool``): [Required] Maintenance flag. true means maintenance begins, false means maintenance ends. - **DurativeTime** (``Uint64_t``): [Required] Maintenance duration (unit: minutes). - **LastTime** (``Uint64_t``): [Required] Timestamp. **Example:** .. code-block:: json { "ProtectFlag":true, "DurativeTime":10, "LastTime":1705307288685 }