Message Definition (Router-Dealer Mode)

Submit Calculation Task

Function: This message is used by the Sinan system to issue calculation tasks to the measurement and control system.

Parameter Definition:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

MsgTask

Non-nullable

Sequence ID

SN

Uint32_t

Message sequence number

Non-nullable

Task ID

TaskId

String

Non-nullable

Quantum Program

ConvertQProg

String

Instructions to be executed by the control system

Non-nullable

Task Priority

Configure. TaskPriority

Uint32_t

Currently supports 2 levels: 0: Normal task 1: High priority

Nullable, default is 0

Shot Count

Configure.Shot

Uint32_t

Range: 100\(\sim\)10000; defaults to 1000 if exceeded

Non-nullable

Experiment Mode

Configure. IsExperiment

Bool

true: Experiment mode false: Non-experiment mode, i.e., normal user task mode

Nullable; if null, defaults to normal user task mode

Execution Timing

Configure. ClockCycle

Uint32_t

Maximum circuit execution period, unit: microseconds (\(\mu\)s)

Nullable; Sinan automatically decides whether to pass this parameter based on the max execution period returned by the control system.

Point Label

Configure. PointLabel

Uint32_t

Temporarily set to 128

Non-nullable

Return Information:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

MsgTaskAck

Non-nullable

Sequence ID

SN

Uint32_t

Message sequence number

Non-nullable

Error Code

ErrCode

Uint32_t

Error code

Non-nullable

Error Info

ErrInfo

String

Error description

Nullable if no error; Non-nullable if an error occurs

Request Example

{
    "MsgType":"MsgTask",
    "SN":133,
    "TaskId":"11D919FA044846F3B4DF453A827AE901",
    "ConvertQProg":"QProg-instructions json-string.",
    "Configure":{
        "Shot":1000,
        "TaskPriority":1,
        "IsExperiment": true,
        "PointLabel":128
    }
}

Response Example

{
    "MsgType":"MsgTaskAck",
    "SN":133,
    "ErrCode":2,
    "ErrInfo":"configure error."
}

Query Task Status

Function: Sinan sends task status query information to the measurement and control system to determine the current calculation status of the task. When Sinan fails to receive the calculation results for a long time, it can use this message to query the task status, preventing Sinan from waiting indefinitely under abnormal circumstances.

Parameter Definition:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

TaskStatus

Non-nullable

Sequence ID

SN

Uint32_t

Message sequence number

Non-nullable

Task ID

TaskId

String

Non-nullable

Return Information:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

TaskStatusAck

Non-nullable

Sequence ID

SN

Uint32_t

Heartbeat sequence number

Non-nullable

Task ID

TaskId

String

Non-nullable

Task Status

TaskStatus

Uint32_t

Task status, refer to the task status definitions

Non-nullable

Request Example

{
    "MsgType":"TaskStatus",
    "SN":10086,
    "TaskId":"11D919FA044846F3B4DF453A827AE901"
}

Response Example

{
    "MsgType":"TaskStatusAck",
    "SN":10086,
    "TaskId":"11D919FA044846F3B4DF453A827AE901",
    "TaskStatus":3
}

Return Calculation Results

Function: The measurement and control system returns the calculation results to the Sinan system.

Parameter Definition:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

MsgTaskResult

Non-nullable

Sequence ID

SN

Uint32_t

Message sequence number

Non-nullable

Task ID

TaskId

String

Non-nullable

Collapse Count

ProbCount

Int Array

Collapse counts corresponding to each Key

Non-nullable

Compilation Time Info

NoteTime. CompileTime

Int

Time consumed by task compilation in the control system, unit: ms

Non-nullable

Queuing Time Info

NoteTime. PendingTime

Int

Time consumed by task queuing in the control system, unit: ms

Non-nullable

Measurement Time Info

NoteTime. MeasureTime

Int

Time consumed by task measurement, unit: ms

Non-nullable

Post-processing Time Info

NoteTime. PostProcessTime

Int

Time consumed by task post-processing in the control system, unit: ms

Non-nullable

Error Code

ErrCode

Uint32_t

Error code

Non-nullable

Error Info

ErrInfo

String

Error description

Nullable if no error

Return Information:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

MsgTaskResultAck

Non-nullable

Sequence ID

SN

Uint32_t

Message sequence number

Non-nullable

Error Code

ErrCode

Uint32_t

Error code

Non-nullable

Error Info

ErrInfo

String

Error description

Nullable if no error

Request Example

{
    "MsgType":"MsgTaskResult",
    "SN":133,
    "TaskId":"11D919FA044846F3B4DF453A827AE901",
    #"key":"Quantum states are uniformly represented by hexadecimal strings",
    "Key": [["0x0","0x1"],["0x0","0x1"]],
    "ProbCount": [[111,656],[103,703]],
    "NoteTime":
    {
        "CompileTime":1,
        "PendingTime":94,
        "MeasureTime":2306,
        "PostProcessTime":105
    },
    "ErrCode":0,
    "ErrInfo":""
}

Response Example

{
    "MsgType":"MsgTaskResultAck",
    "SN":133,
    "ErrCode":3,
    "ErrInfo":"data error."
}

Heartbeat Message

Function: Users probe the connection status between the Sinan system and the measurement and control system. The control system maintains the system services, the Sinan system actively sends heartbeat packets, and upon receiving the heartbeat packet, the control system sends a heartbeat response.

Parameter Definition:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

MsgHeartbeat

Non-nullable

Sequence ID

SN

Uint32_t

Heartbeat message sequence number

Non-nullable

Timestamp

TimeStamp

Uint64_t

64-bit integer timestamp, ms

Non-nullable

Chip ID

ChipID

Uint32_t

Chip name, e.g., 72

Non-nullable

Return Information:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

MsgHeartbeatAck

Non-nullable

Sequence ID

SN

Uint32_t

Heartbeat message sequence number

Non-nullable

Backend ID

backend

Uint32_t

Backend chip ID

Non-nullable

Timestamp

TimeStamp

Uint64_t

64-bit integer timestamp, ms

Non-nullable

Subscription Topic

Topic

String

Topic for subscription messages

Non-nullable

Request Example

{
    "MsgType":"MsgHeartbeat",
    "SN":133,
    "ChipID":72,
    "TimeStamp":1638769359507
}

Response Example

{
    "MsgType":"MsgHeartbeatAck",
    "SN":133,
    "backend":72,
    "TimeStamp":1638769359517,
    "Topic":"Y4-231011-Design_Verification-72bit_300pin_V9.2.3_Base-3#_|_Y4-231011-Design_Verification-72bit_300pin_V9.2.3_Base-3#"
}

Get Chip Calibration Time

Function: The user actively retrieves the time of the last chip calibration performed by the measurement and control system. Returned by the measurement and control system.

Parameter Definition:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

GetUpdateTime

Non-nullable

Sequence ID

SN

Uint32_t

Message sequence number

Non-nullable

Return Information:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

GetUpdateTimeAck

Non-nullable

Sequence ID

SN

Uint32_t

Heartbeat message sequence number

Non-nullable

Backend ID

backend

Uint32_t

Backend chip ID

Non-nullable

Qubit Name for Calibration Timestamp

LastUpdateTime. qubit

Uint32_t

Integer data representing the qubit name

Non-nullable

Qubit Time for Calibration Timestamp

LastUpdateTime. timeStamp

Uint64_t

64-bit integer timestamp, ms

Non-nullable

Error Code

ErrCode

Uint32_t

Error code

Non-nullable

Error Info

ErrInfo

String

Error description

Nullable if no error

Request Example

{
    "MsgType":"GetUpdateTime",
    "SN":133
}

Response Example

{
    "MsgType":"GetUpdateTimeAck",
    "SN":133,
    "backend":72,
    "LastUpdateTime":
    {
        "qubit":[43,45,46,48,49,52,53,54,60],
        "timeStamp":[1687243363189,1687243363189,1687243363189,
        1687243363189,1687243363189,1687243363189,
        1687243363189,1687243363189,1687243363189]
    },
    "ErrCode":0,
    "ErrInfo":""
}

Get RB Experimental Data

Function: The user actively retrieves Randomized Benchmarking (RB) experimental data. Returned by the measurement and control system.

Parameter Definition:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

GetRBData

Non-nullable

Sequence ID

SN

Uint32_t

Message sequence number

Non-nullable

Chip ID

ChipID

Uint32_t

Chip name, e.g., 72

Non-nullable

Return Information:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

GetRBDataAck

Non-nullable

Sequence ID

SN

Uint32_t

Heartbeat message sequence number

Non-nullable

Backend ID

backend

Uint32_t

Backend chip ID

Non-nullable

Single-gate Circuit Depth

SingleGate CircuitDepth

Uint32_t

Maximum depth for single-gate RB experiment circuits

Non-nullable

Double-gate Circuit Depth

DoubleGate CircuitDepth

Uint32_t

Maximum depth for double-gate RB experiment circuits

Non-nullable

Single-qubit Fidelity

SingleGate Fidelity

String

String type map table

Non-nullable

Double-qubit Fidelity

DoubleGate Fidelity

String

String type map table

Non-nullable

Error Code

ErrCode

Uint32_t

Error code

Non-nullable

Error Info

ErrInfo

String

Error description

Nullable if no error

Request Example

{
    "MsgType":"GetRBData",
    "SN":133,
    "ChipID":72
}

Response Example

{
    "MsgType":"GetRBDataAck",
    "SN":133,
    "backend":72,
    "SingleGateCircuitDepth":[50,50,50,50,50,50,50,50,50],
    "DoubleGateCircuitDepth":[0,50,50,50,50,50,0],
    "SingleGateFidelity":
    {
        "qubit":["45","46","48","52"],
        "fidelity":[0.9,0.9,0.9,0.9]
    },
    "DoubleGateFidelity":
    {
        "qubitPair":["45-46","46-52","48-54","52-53"],
        "fidelity":[0.9,0.9,0.9,0.9]
    },
    "ErrCode":0,
    "ErrInfo":""
}

Get Chip Configuration Parameters

Function: Retrieve chip configuration parameters (JSON data), returned by the measurement and control system.

Parameter Definition:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

GetChipConfig

Non-nullable

Sequence ID

SN

Uint32_t

Message sequence number

Non-nullable

Chip ID

ChipID

Uint32_t

Chip name, e.g., 72

Non-nullable

Return Information:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

GetChipConfigAck

Non-nullable

Sequence ID

SN

Uint32_t

Heartbeat message sequence number

Non-nullable

Backend ID

backend

Uint32_t

Backend chip ID

Non-nullable

Workspace List

PointLabelList

Uint32_t Array

List of workspace modes supported by the current chip

Non-nullable

Chip Parameters

ChipConfig

string

JSON string of chip parameters

Non-nullable

Error Code

ErrCode

Uint32_t

Error code

Non-nullable

Error Info

ErrInfo

String

Error description

Nullable if no error

Request Example

{
    "MsgType":"GetChipConfig",
    "SN":133,
    "ChipID":72
}

Response Example

{
    "MsgType":"GetChipConfigAck",
    "SN":133,
    "backend":72,
    "PointLabelList":[1,2],
    "ChipConfig":{
      "1":"QuantumChipArch.json related configuration information",
      "2":"QuantumChipArch.json related configuration information"
    },
    "ErrCode":0,
    "ErrInfo":""
}

Request Specific Task Results

Function: Used under abnormal circumstances when Sinan fails to correctly receive the calculation results returned by the measurement and control system. Sinan actively requests the calculation result information of a specified task.

Parameter Definition:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

GetTaskResult

Non-nullable

Sequence ID

SN

Uint32_t

Message sequence number

Non-nullable

Task ID

TaskId

String

Task ID

Non-nullable

Return Information: The returned result information format is consistent with the “Return Calculation Results” section, but the fields “TaskResult” and “FidelityMat” are removed.

Note: The message sequence number in the returned result must match the sequence number of the request message.

Request Example:

{
    "MsgType":"GetTaskResult",
    "SN":134,
    "TaskId":"11D919FA044846F3B4DF453A827AE901"
}

Response Example:

{
    "MsgType":"MsgTaskResult",
    "SN":134,
    "TaskId":"11D919FA044846F3B4DF453A827AE901",
    #"key":"Quantum states are uniformly represented by hexadecimal strings",
    "Key": [["0x0","0x1"],["0x0","0x1"]],
    "ProbCount": [[111,656],[103,703]],
    "NoteTime":
    {
        "CompileTime":1,
        "PendingTime":94,
        "MeasureTime":2306,
        "PostProcessTime":105
    },
    "ErrCode":0,
    "ErrInfo":""
}

Set Exclusive VIP Machine Time

Function: Used in specific scenarios where Sinan sets exclusive machine time, ensuring that tasks do not need to queue during this period.

Parameter Definition:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

SetVip

Non-nullable

Sequence ID

SN

Uint32_t

Message sequence number

Non-nullable

Offset Time

OffsetTime

Uint64_t

Relative offset time from current system time (unit: seconds)

Non-nullable

Exclusive Time

ExclusiveTime

Uint64_t

Duration of the exclusive machine time (unit: seconds)

Non-nullable

Return Information:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

SetVipAck

Non-nullable

Sequence ID

SN

Uint32_t

Message sequence number

Non-nullable

Error Code

ErrCode

Uint32_t

Error code

Non-nullable

Error Info

ErrInfo

String

Error description

Nullable if no error

Request Example:

{
    "MsgType":"SetVip",
    "SN":134,
    "OffsetTime":120,
    "ExclusiveTime":600
}

Response Example:

{
    "MsgType":"SetVipAck",
    "SN":134,
    "ErrCode":0,
    "ErrInfo":""
}

Release Exclusive VIP Machine Time

Function: Used to release the exclusive machine time operation after completing the exclusive machine time tasks, reverting back to the normal mode.

Parameter Definition:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

ReleaseVip

Non-nullable

Sequence ID

SN

Uint32_t

Message sequence number

Non-nullable

Return Information:

Description

Name

Type

Notes

Is Nullable

Message Type

MsgType

String

ReleaseVipAck

Non-nullable

Sequence ID

SN

Uint32_t

Message sequence number

Non-nullable

Error Code

ErrCode

Uint32_t

Error code

Non-nullable

Error Info

ErrInfo

String

Error description

Nullable if no error

Request Example:

{
    "MsgType":"ReleaseVip",
    "SN":135
}

Response Example:

{
    "MsgType":"ReleaseVipAck",
    "SN":135,
    "ErrCode":0,
    "ErrInfo":""
}