diff --git a/backend/oas/provider/openapi.yaml b/backend/oas/provider/openapi.yaml index 40a3e78..7efa147 100644 --- a/backend/oas/provider/openapi.yaml +++ b/backend/oas/provider/openapi.yaml @@ -13,7 +13,7 @@ servers: - url: http://localhost:8888 description: Local server url paths: - /devices/{deviceId}: + /devices/{device_id}: patch: tags: - devices @@ -23,7 +23,7 @@ paths: security: [] parameters: - in: path - name: deviceId + name: device_id description: Device ID required: true schema: @@ -36,58 +36,24 @@ paths: schema: $ref: '#/components/schemas/devices.DeviceDataUpdate' examples: - status update (NOT_AVAILABLE): + status update (unavailable): value: command: DeviceStatusUpdate - status: NOT_AVAILABLE - restartAt: '2023-09-10T14:00:00Z' - status update (AVAILABLE): + status: unavailable + restart_at: '2023-09-10T14:00:00Z' + status update (available): value: command: DeviceStatusUpdate - status: AVAILABLE + status: available pending tasks update: value: command: DevicePendingTasksUpdate - nPendingTasks: 6 + n_pending_tasks: 6 calibrationData update: value: command: DeviceCalibrationUpdate - calibrationData: - qubitConnectivity: - - (1,4) - - (4,5) - - (5,8) - t1: - '0': 55.51 - '1': 37.03 - '2': 57.13 - t2: - '0': 99.31 - '1': 111.03 - '2': 30.12 - roError: - '0': 0.0467 - '1': 0.18 - '2': 0.355 - gateError: - sx: - '0': 0.00692 - '1': 0.00296 - '2': 0.072 - measProb0As1: - '0': 0.00608 - '1': 0.012 - '2': 0.248 - measProb1As0: - '0': 0.0281 - '1': 0.386 - '2': 0.0811 - gateDuration: - sx: - '0': 29.3 - '1': 50.9 - '2': 45.4 - calibratedAt: '2023-09-10T14:00:00Z' + device_info: '{ ''calibration_data'': { ''qubit_connectivity'': [''(1,4)'', ''(4,5)'', ''(5,8)''], ''t1'': {''0'': 55.51, ''1'': 37.03, ''2'': 57.13}, ''t2'': {''0'': 99.31, ''1'': 111.03, ''2'': 30.12}, ''ro_error'': {''0'': 4.67e-2, ''1'': 1.8e-1, ''2'': 3.55e-1}, ''gate_error'': {''sx'': {''0'': 6.92e-3, ''1'': 2.96e-3, ''2'': 7.2e-2}}, ''meas_prob0_as1'': {''0'': 6.08e-3, ''1'': 1.2e-2, ''2'': 2.48e-1}, ''meas_prob1_as0'': {''0'': 2.81e-2, ''1'': 3.86e-1, ''2'': 8.11e-2}, ''gate_duration'': {''sx'': {''0'': 29.3, ''1'': 50.9, ''2'': 45.4}} }, }' + calibrated_at: '2023-09-10T14:00:00Z' responses: '200': description: Device's data updated @@ -131,7 +97,7 @@ paths: security: [] parameters: - in: query - name: deviceId + name: device_id required: true description: Device identifier schema: @@ -143,7 +109,7 @@ paths: schema: $ref: '#/components/schemas/jobs.InternalJobStatus' - in: query - name: maxResults + name: max_results description: Additional search parameter:
Set max number of quantum jobs to return in single request schema: type: integer @@ -179,7 +145,7 @@ paths: $ref: '#/components/schemas/error.InternalServerError' example: detail: Internal server error - /jobs/{jobId}: + /jobs/{job_id}: get: summary: Get a job by ID description: Get a job by ID @@ -189,7 +155,7 @@ paths: - jobs parameters: - in: path - name: jobId + name: job_id required: true description: Job identifier schema: @@ -226,7 +192,7 @@ paths: - jobs parameters: - in: path - name: jobId + name: job_id required: true description: Job identifier schema: @@ -272,7 +238,7 @@ paths: - jobs parameters: - in: query - name: deviceId + name: device_id required: true description: Device identifier schema: @@ -285,7 +251,7 @@ paths: schema: $ref: '#/components/schemas/jobs.InternalFetchableJobStatus' - in: query - name: maxResults + name: max_results description: Additional search parameter:
Set max number of quantum jobs to return in single request schema: type: integer @@ -316,10 +282,10 @@ components: status: type: string enum: - - AVAILABLE - - NOT_AVAILABLE - restartAt: - description: Parameter mandatory and valid for status 'NOT_AVAILABLE' + - available + - unavailable + restart_at: + description: Parameter mandatory and valid for status 'unavailable' type: string format: date-time example: '2023-09-10T14:00:00+09:00' @@ -329,99 +295,19 @@ components: command: type: string example: DevicePendingTasksUpdate - nPendingTasks: + n_pending_tasks: type: integer - CalibrationData: - description: Calibration data available only for 'QPU' devices - type: object - properties: - qubitConnectivity: - type: array - items: - type: string - format: (number, number) - example: - - (1,4) - - (4,5) - - (5,8) - t1: - type: object - additionalProperties: - type: number - format: float - example: - '0': 55.51 - '1': 37.03 - '2': 57.13 - t2: - type: object - additionalProperties: - type: number - format: float - example: - '0': 99.31 - '1': 111.03 - '2': 30.12 - roError: - type: object - additionalProperties: - type: number - format: float - example: - '0': 0.0467 - '1': 0.18 - '2': 0.355 - gateError: - type: object - additionalProperties: - type: object - additionalProperties: - type: number - format: float - example: - sx: - '0': 0.00692 - '1': 0.00296 - '2': 0.072 - measProb0As1: - type: object - additionalProperties: - type: number - format: float - example: - '0': 0.00608 - '1': 0.012 - '2': 0.248 - measProb1As0: - type: object - additionalProperties: - type: number - format: float - example: - '0': 0.0281 - '1': 0.386 - '2': 0.0811 - gateDuration: - type: object - additionalProperties: - type: object - additionalProperties: - type: number - format: float - example: - sx: - '0': 29.3 - '1': 50.9 - '2': 45.4 devices.DeviceCalibrationUpdate: type: object properties: command: type: string example: DeviceCalibrationUpdate - calibrationData: - $ref: '#/components/schemas/CalibrationData' - calibratedAt: + device_info: + description: json format calibration_data and n_nodes etc + type: string + example: '{''n_nodes'': 512, ''calibration_data'': {''qubit_connectivity'': [''(1,4)'', ''(4,5)'', ''(5,8)''], ''t1'': {''0'': 55.51, ''1'': 37.03, ''2'': 57.13}}' + calibrated_at: description: Parameter mandatory and valid if calibrationData not null type: string format: date-time @@ -479,15 +365,15 @@ components: example: submitted jobs.JobInfo: type: string - example: '{''code'': ''{type: string, example: "OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;"}'', ''Operator'': ''X 0 Y 1 Z 5 I 2'', ''result'': {''00'': 5020, ''11'': 4980}, ''transpiledCode'': '''', ''reason'': ''''}' + example: '{''code'': ''{type: string, example: "OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;"}'', ''Operator'': ''X 0 Y 1 Z 5 I 2'', ''result'': {''00'': 5020, ''11'': 4980}, ''transpiled_code'': '''', ''reason'': ''''}' jobs.JobStatusUpdate: type: object properties: status: type: string enum: - - RUNNING - example: RUNNING + - running + example: running required: - status jobs.JobStatusUpdateResponse: @@ -500,9 +386,9 @@ components: jobs.InternalFetchableJobStatus: type: string enum: - - QUEUED - - CANCELLING - example: QUEUED + - queued + - cancelling + example: queued jobs.JobId: type: string format: uuid diff --git a/backend/oas/provider/paths/devices.yaml b/backend/oas/provider/paths/devices.yaml index b532cde..bc849b6 100644 --- a/backend/oas/provider/paths/devices.yaml +++ b/backend/oas/provider/paths/devices.yaml @@ -8,7 +8,7 @@ devices.deviceId: security: [] parameters: - in: path - name: deviceId + name: device_id description: "Device ID" required: true schema: @@ -21,36 +21,38 @@ devices.deviceId: schema: $ref: "../schemas/devices.yaml#/devices.DeviceDataUpdate" examples: - status update (NOT_AVAILABLE): + status update (unavailable): value: { "command": "DeviceStatusUpdate", - "status": "NOT_AVAILABLE", - "restartAt": "2023-09-10T14:00:00Z" + "status": "unavailable", + "restart_at": "2023-09-10T14:00:00Z" } - status update (AVAILABLE): + status update (available): value: { "command": "DeviceStatusUpdate", - "status": "AVAILABLE" + "status": "available" } pending tasks update: value: { "command": "DevicePendingTasksUpdate", - "nPendingTasks": 6 + "n_pending_tasks": 6 } calibrationData update: value: { "command": "DeviceCalibrationUpdate", - "calibrationData": { - "qubitConnectivity": ["(1,4)", "(4,5)", "(5,8)"], - "t1": {"0": 55.51, "1": 37.03, "2": 57.13}, - "t2": {"0": 99.31, "1": 111.03, "2": 30.12}, - "roError": {"0": 4.67e-2, "1": 1.8e-1, "2": 3.55e-1}, - "gateError": {"sx": {"0": 6.92e-3, "1": 2.96e-3, "2": 7.2e-2}}, - "measProb0As1": {"0": 6.08e-3, "1": 1.2e-2, "2": 2.48e-1}, - "measProb1As0": {"0": 2.81e-2, "1": 3.86e-1, "2": 8.11e-2}, - "gateDuration": {"sx": {"0": 29.3, "1": 50.9, "2": 45.4}} - }, - calibratedAt: "2023-09-10T14:00:00Z" + "device_info": "{ + 'calibration_data': { + 'qubit_connectivity': ['(1,4)', '(4,5)', '(5,8)'], + 't1': {'0': 55.51, '1': 37.03, '2': 57.13}, + 't2': {'0': 99.31, '1': 111.03, '2': 30.12}, + 'ro_error': {'0': 4.67e-2, '1': 1.8e-1, '2': 3.55e-1}, + 'gate_error': {'sx': {'0': 6.92e-3, '1': 2.96e-3, '2': 7.2e-2}}, + 'meas_prob0_as1': {'0': 6.08e-3, '1': 1.2e-2, '2': 2.48e-1}, + 'meas_prob1_as0': {'0': 2.81e-2, '1': 3.86e-1, '2': 8.11e-2}, + 'gate_duration': {'sx': {'0': 29.3, '1': 50.9, '2': 45.4}} + }, + }", + calibrated_at: "2023-09-10T14:00:00Z" } responses: '200': diff --git a/backend/oas/provider/paths/jobs.yaml b/backend/oas/provider/paths/jobs.yaml index 42e1093..d8a57aa 100644 --- a/backend/oas/provider/paths/jobs.yaml +++ b/backend/oas/provider/paths/jobs.yaml @@ -8,7 +8,7 @@ jobs: security: [] parameters: - in: query - name: deviceId + name: device_id required: true description: "Device identifier" schema: {type: string, example: "Kawasaki"} @@ -18,7 +18,7 @@ jobs: schema: $ref: "../schemas/jobs.yaml#/jobs.InternalJobStatus" - in: query - name: maxResults + name: max_results description: "Additional search parameter:
Set max number of quantum jobs to return in single request" schema: {type: integer, example: 1} - in: query @@ -61,7 +61,7 @@ jobs.jobId: - jobs parameters: - in: path - name: jobId + name: job_id required: true description: "Job identifier" schema: {type: string} @@ -97,7 +97,7 @@ jobs.jobId: - jobs parameters: - in: path - name: jobId + name: job_id required: true description: "Job identifier" schema: {type: string} @@ -143,7 +143,7 @@ jobs.unfetched: - jobs parameters: - in: query - name: deviceId + name: device_id required: true description: "Device identifier" schema: {type: string, example: "Kawasaki"} @@ -154,7 +154,7 @@ jobs.unfetched: schema: $ref: "../schemas/jobs.yaml#/jobs.InternalFetchableJobStatus" - in: query - name: maxResults + name: max_results description: "Additional search parameter:
Set max number of quantum jobs to return in single request" schema: {type: integer, example: 1} diff --git a/backend/oas/provider/root.yaml b/backend/oas/provider/root.yaml index ce61a3f..3c5c117 100644 --- a/backend/oas/provider/root.yaml +++ b/backend/oas/provider/root.yaml @@ -13,11 +13,11 @@ servers: - url: http://localhost:8888 description: Local server url paths: - /devices/{deviceId}: + /devices/{device_id}: $ref: ./paths/devices.yaml#/devices.deviceId /jobs: $ref: ./paths/jobs.yaml#/jobs - /jobs/{jobId}: + /jobs/{job_id}: $ref: ./paths/jobs.yaml#/jobs.jobId /jobs/unfetched: $ref: ./paths/jobs.yaml#/jobs.unfetched diff --git a/backend/oas/provider/schemas/devices.yaml b/backend/oas/provider/schemas/devices.yaml index 2e97a85..71f0fd5 100644 --- a/backend/oas/provider/schemas/devices.yaml +++ b/backend/oas/provider/schemas/devices.yaml @@ -29,9 +29,9 @@ devices.DeviceStatusUpdate: example: DeviceStatusUpdate status: type: string - enum: ["AVAILABLE", "NOT_AVAILABLE"] - restartAt: - description: "Parameter mandatory and valid for status 'NOT_AVAILABLE'" + enum: ["available", "unavailable"] + restart_at: + description: "Parameter mandatory and valid for status 'unavailable'" type: string format: date-time example: "2023-09-10T14:00:00+09:00" @@ -42,7 +42,7 @@ devices.DevicePendingTasksUpdate: command: type: string example: DevicePendingTasksUpdate - nPendingTasks: + n_pending_tasks: type: integer devices.DeviceCalibrationUpdate: @@ -51,77 +51,12 @@ devices.DeviceCalibrationUpdate: command: type: string example: DeviceCalibrationUpdate - calibrationData: - $ref: "#/components/schemas/CalibrationData" - calibratedAt: + device_info: + description: "json format calibration_data and n_nodes etc" + type: string + example: "{'n_nodes': 512, 'calibration_data': {'qubit_connectivity': ['(1,4)', '(4,5)', '(5,8)'], 't1': {'0': 55.51, '1': 37.03, '2': 57.13}}" + calibrated_at: description: "Parameter mandatory and valid if calibrationData not null" type: string format: date-time example: "2023-09-10T14:00:00+09:00" - -components: - schemas: - CalibrationData: - description: "Calibration data available only for 'QPU' devices" - type: object - properties: - qubitConnectivity: - type: array - items: - type: string - format: "(number, number)" - example: - ["(1,4)", "(4,5)", "(5,8)"] - t1: - type: object - additionalProperties: - type: number - format: float - example: - {"0": 55.51, "1": 37.03, "2": 57.13} - t2: - type: object - additionalProperties: - type: number - format: float - example: - {"0": 99.31, "1": 111.03, "2": 30.12} - roError: - type: object - additionalProperties: - type: number - format: float - example: - {"0": 4.67e-2, "1": 1.8e-1, "2": 3.55e-1} - gateError: - type: object - additionalProperties: - type: object - additionalProperties: - type: number - format: float - example: - {"sx": {"0": 6.92e-3, "1": 2.96e-3, "2": 7.2e-2}} - measProb0As1: - type: object - additionalProperties: - type: number - format: float - example: - {"0": 6.08e-3, "1": 1.2e-2, "2": 2.48e-1} - measProb1As0: - type: object - additionalProperties: - type: number - format: float - example: - {"0": 2.81e-2, "1": 3.86e-1, "2": 8.11e-2} - gateDuration: - type: object - additionalProperties: - type: object - additionalProperties: - type: number - format: float - example: - {"sx": {"0": 29.3, "1": 50.9, "2": 45.4}} diff --git a/backend/oas/provider/schemas/jobs.yaml b/backend/oas/provider/schemas/jobs.yaml index d923e8c..fbb66bf 100644 --- a/backend/oas/provider/schemas/jobs.yaml +++ b/backend/oas/provider/schemas/jobs.yaml @@ -10,24 +10,24 @@ jobs.InternalJobStatus: jobs.JobInfo: type: string - example: "{'code': '{type: string, example: \"OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;\"}', 'Operator': 'X 0 Y 1 Z 5 I 2', 'result': {'00': 5020, '11': 4980}, 'transpiledCode': '', 'reason': ''}" + example: "{'code': '{type: string, example: \"OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;\"}', 'Operator': 'X 0 Y 1 Z 5 I 2', 'result': {'00': 5020, '11': 4980}, 'transpiled_code': '', 'reason': ''}" jobs.TranspilerInfo: type: string - example: "{'qubitAllocation': {'0': 12, '1': 16}, 'skipTranspilation': false, 'seedTranspilation': 873}" + example: "{'qubit_allocation': {'0': 12, '1': 16}, 'skip_transpilation': false, 'seed_transpilation': 873}" jobs.SimulatorInfo: type: string - example: "{'nQubits': 5, 'nNodes': 12, 'nPerNode': 2, 'seedSimulation': 39058567, 'simulationOpt': {'optimizationMethod': 'light', 'optimizationBlockSize': 1, 'optimizationSwapLevel': 1}}" + example: "{'n_qubits': 5, 'n_nodes': 12, 'n_per_node': 2, 'seed_simulation': 39058567, 'simulation_opt': {'optimization_method': 'light', 'optimization_block_size': 1, 'optimization_swap_level': 1}}" jobs.MitigationInfo: type: string - example: "{'roErrorMitigation': 'pseudo_inverse'}" + example: "{'ro_error_mitigation': 'pseudo_inverse'}" jobs.JobDef: type: object properties: - jobId: + job_id: $ref: "#/jobs.JobId" description: type: string @@ -38,44 +38,44 @@ jobs.JobDef: device: type: string example: "Kawasaki" - nShots: + n_shots: type: integer minimum: 1 maximum: 1e7 example: "1000" - jobType: + job_type: type: string example: "'sampling' or 'estimation', 'sse'" - jobInfo: + job_info: $ref: "#/jobs.JobInfo" - transpilerInfo: + transpiler_info: $ref: "#/jobs.TranspilerInfo" - simulatorInfo: + simulator_info: $ref: "#/jobs.SimulatorInfo" - mitigationInfo: + mitigation_info: $ref: "#/jobs.MitigationInfo" status: $ref: "#/jobs.JobStatus" - createdAt: + created_at: type: string format: date-time example: "2022-10-19T11:45:34+09:00" required: [ - device, nShots, status, createdAt + device, n_shots, status, created_at ] example: { - jobId: "7af020f6-2e38-4d70-8cf0-4349650ea08c", + job_id: "7af020f6-2e38-4d70-8cf0-4349650ea08c", description: "Bell State Sampling", note: "Bell State Sampling Example", device: "Kawasaki", - nShots: 1000, - jobInfo: "{'code': '{type: string, example: \"OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;\"}', 'Operator': 'X 0 Y 1 Z 5 I 2'}", - transpilerInfo: "{'qubitAllocation': {'0': 12, '1': 16}, 'skipTranspilation': false, 'seedTranspilation': 873}", - simulatorInfo: "{'nQubits': 5, 'nNodes': 12, 'nPerNode': 2, 'seedSimulation': 39058567, 'simulationOpt': {'optimizationMethod': 'light', 'optimizationBlockSize': 1, 'optimizationSwapLevel': 1}}", - mitigationInfo: "{'roErrorMitigation': 'pseudo_inverse'}", + n_shots: 1000, + job_info: "{'code': '{type: string, example: \"OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;\"}', 'operator': 'X 0 Y 1 Z 5 I 2'}", + transpiler_info: "{'qubit_allocation': {'0': 12, '1': 16}, 'skip_transpilation': false, 'seed_transpilation': 873}", + simulator_info: "{'n_qubits': 5, 'n_nodes': 12, 'n_per_node': 2, 'seed_simulation': 39058567, 'simulation_opt': {'optimization_method': 'light', 'optimization_block_size': 1, 'optimization_swap_level': 1}}", + mitigation_info: "{'ro_error_mitigation': 'pseudo_inverse'}", status: "submitted", - createdAt: "2022-10-19T11:45:34+09:00" + created_at: "2022-10-19T11:45:34+09:00" } jobs.JobStatusUpdate: @@ -83,8 +83,8 @@ jobs.JobStatusUpdate: properties: status: type: string - enum: ["RUNNING"] - example: "RUNNING" + enum: ["running"] + example: "running" required: [ status ] @@ -106,6 +106,6 @@ jobs.UnfetchedJobsResponse: jobs.InternalFetchableJobStatus: type: string - enum: ["QUEUED", "CANCELLING"] - example: "QUEUED" + enum: ["queued", "cancelling"] + example: "queued" diff --git a/backend/oas/user/openapi.yaml b/backend/oas/user/openapi.yaml index 259a8b8..48a33e2 100644 --- a/backend/oas/user/openapi.yaml +++ b/backend/oas/user/openapi.yaml @@ -45,7 +45,7 @@ paths: application/json: schema: $ref: '#/components/schemas/error.InternalServerError' - /devices/{deviceId}: + /devices/{device_id}: get: tags: - device @@ -55,7 +55,7 @@ paths: security: - BearerAuth: [] parameters: - - name: deviceId + - name: device_id in: path description: Device identifier required: true @@ -128,26 +128,26 @@ paths: description: Bell State Sampling note: Bell State Sampling Example device: Kawasaki - nShots: 1000 - jobInfo: '{''code'': ''{type: string, example: "OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;"}'', ''Operator'': ''X 0 Y 1 Z 5 I 2'', ''result'': {''00'': 5020, ''11'': 4980}, ''transpiledCode'': '''', ''reason'': ''''}' - transpilerInfo: '' - simulatorInfo: '{''nQubits'': 5, ''nNodes'': 12, ''nPerNode'': 2, ''seedSimulation'': 39058567, ''simulationOpt'': {''optimizationMethod'': ''light'', ''optimizationBlockSize'': 1, ''optimizationSwapLevel'': 1}}' - mitigationInfo: '' + n_shots: 1000 + job_info: '{''code'': ''{type: string, example: "OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;"}'', ''operator'': ''X 0 Y 1 Z 5 I 2'', ''result'': {''00'': 5020, ''11'': 4980}, ''transpiled_code'': '''', ''reason'': ''''}' + transpiler_info: '' + simulator_info: '{''n_qubits'': 5, ''n_nodes'': 12, ''n_per_node'': 2, ''seed_simulation'': 39058567, ''simulation_opt'': {''optimization_method'': ''light'', ''optimization_block_size'': 1, ''optimization_swap_level'': 1}}' + mitigation_info: '' status: submitted - createdAt: '2022-10-19T11:45:34+09:00' + created_at: '2022-10-19T11:45:34+09:00' qpu: description: QPU example value: description: Bell State Sampling note: Bell State Sampling Example device: Kawasaki - nShots: 1000 - jobInfo: '{''code'': ''{type: string, example: "OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;"}'', ''Operator'': ''X 0 Y 1 Z 5 I 2'', ''result'': {''00'': 5020, ''11'': 4980}, ''transpiledCode'': '''', ''reason'': ''''}' - transpilerInfo: '{''qubitAllocation'': {''0'': 12, ''1'': 16}, ''skipTranspilation'': false, ''seedTranspilation'': 873}' - simulatorInfo: '' - mitigationInfo: '{''roErrorMitigation'': ''pseudo_inverse''}' + n_shots: 1000 + job_info: '{''code'': ''{type: string, example: "OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;"}'', ''operator'': ''X 0 Y 1 Z 5 I 2'', ''result'': {''00'': 5020, ''11'': 4980}, ''transpiled_code'': '''', ''reason'': ''''}' + transpiler_info: '{''qubit_allocation'': {''0'': 12, ''1'': 16}, ''skip_transpilation'': false, ''seed_transpilation'': 873}' + simulator_info: '' + mitigation_info: '{''ro_error_mitigation'': ''pseudo_inverse''}' status: submitted - createdAt: '2022-10-19T11:45:34+09:00' + created_at: '2022-10-19T11:45:34+09:00' responses: '200': description: Job submitted @@ -156,7 +156,7 @@ paths: schema: $ref: '#/components/schemas/jobs.SubmitJobResponse' example: - jobId: 7af020f6-2e38-4d70-8cf0-4349650ea08c + job_id: 7af020f6-2e38-4d70-8cf0-4349650ea08c '400': description: Bad Request content: @@ -173,7 +173,7 @@ paths: $ref: '#/components/schemas/error.UnauthorizedError' example: detail: Unauthorized - /jobs/{jobId}: + /jobs/{job_id}: get: tags: - job @@ -184,7 +184,7 @@ paths: - BearerAuth: [] parameters: - in: path - name: jobId + name: job_id required: true description: Job identifier schema: @@ -230,7 +230,7 @@ paths: - BearerAuth: [] parameters: - in: path - name: jobId + name: job_id required: true description: Job identifier schema: @@ -268,7 +268,7 @@ paths: $ref: '#/components/schemas/error.NotFoundError' example: detail: job not found - /jobs/{jobId}/status: + /jobs/{job_id}/status: get: tags: - job @@ -279,7 +279,7 @@ paths: - BearerAuth: [] parameters: - in: path - name: jobId + name: job_id required: true description: Job identifier schema: @@ -315,7 +315,7 @@ paths: $ref: '#/components/schemas/error.NotFoundError' example: detail: job not found - /jobs/{jobId}/cancel: + /jobs/{job_id}/cancel: post: tags: - job @@ -326,7 +326,7 @@ paths: - BearerAuth: [] parameters: - in: path - name: jobId + name: job_id required: true description: Job identifier schema: @@ -371,95 +371,13 @@ components: scheme: bearer bearerFormat: JWT schemas: - devices.CalibrationData: - description: Calibration data available only for 'QPU' devices - type: object - properties: - qubitConnectivity: - type: array - items: - type: string - format: (number, number) - example: - - (1,4) - - (4,5) - - (5,8) - t1: - type: object - additionalProperties: - type: number - format: float - example: - '0': 55.51 - '1': 37.03 - '2': 57.13 - t2: - type: object - additionalProperties: - type: number - format: float - example: - '0': 99.31 - '1': 111.03 - '2': 30.12 - roError: - type: object - additionalProperties: - type: number - format: float - example: - '0': 0.0467 - '1': 0.18 - '2': 0.355 - gateError: - type: object - additionalProperties: - type: object - additionalProperties: - type: number - format: float - example: - sx: - '0': 0.00692 - '1': 0.00296 - '2': 0.072 - measProb0As1: - type: object - additionalProperties: - type: number - format: float - example: - '0': 0.00608 - '1': 0.012 - '2': 0.248 - measProb1As0: - type: object - additionalProperties: - type: number - format: float - example: - '0': 0.0281 - '1': 0.386 - '2': 0.0811 - gateDuration: - type: object - additionalProperties: - type: object - additionalProperties: - type: number - format: float - example: - sx: - '0': 29.3 - '1': 50.9 - '2': 45.4 devices.DeviceInfo: type: object properties: - deviceId: + device_id: type: string example: SVSim - deviceType: + device_type: type: string enum: - QPU @@ -468,25 +386,21 @@ components: status: type: string enum: - - AVAILABLE - - NOT_AVAILABLE - example: AVAILABLE - restartAt: - description: Parameter mandatory and valid for 'NOT_AVAILABLE' devices + - available + - unavailable + example: available + available_at: + description: Parameter mandatory and valid for 'unavailable' devices type: string format: date-time example: '2022-10-19T11:45:34+09:00' - nPendingTasks: + n_pending_tasks: type: integer example: 8 - nQubits: + n_qubits: type: integer example: 39 - nNodes: - description: Parameter valid only for 'simulator' devices - type: integer - example: 512 - basisGates: + basis_gates: type: array items: type: string @@ -513,7 +427,7 @@ components: - id - sx - sxdg - supportedInstructions: + supported_instructions: type: array items: type: string @@ -521,9 +435,11 @@ components: - measure - barrier - reset - calibrationData: - $ref: '#/components/schemas/devices.CalibrationData' - calibratedAt: + device_info: + description: json format calibration_data and n_nodes etc + type: string + example: '{''n_nodes'': 512, ''calibration_data'': {''qubit_connectivity'': [''(1,4)'', ''(4,5)'', ''(5,8)''], ''t1'': {''0'': 55.51, ''1'': 37.03, ''2'': 57.13}}' + calibrated_at: description: Parameter available only for 'QPU' devices with available calibration data type: string format: date-time @@ -540,13 +456,13 @@ components: - supportedInstructions - description example: - - deviceId: SVSim - deviceType: simulator + - device_id: SVSim + device_type: simulator status: AVAILABLE - nPendingTasks: 8 - nQubits: 39 - nNodes: 512 - basisGates: + n_pending_tasks: 8 + n_qubits: 39 + n_nodes: 512 + basis_gates: - x - 'y' - z @@ -569,10 +485,12 @@ components: - id - sx - sxdg - supportedInstructions: + supported_instructions: - measure - barrier - reset + device_info: '{''n_nodes'': 512, ''calibration_data'': {''qubit_connectivity'': [''(1,4)'', ''(4,5)'', ''(5,8)''], ''t1'': {''0'': 55.51, ''1'': 37.03, ''2'': 57.13}}' + calibrated_at: '2022-10-19T11:45:34+09:00' description: State vector-based quantum circuit simulator error.UnauthorizedError: type: object @@ -624,7 +542,7 @@ components: jobs.JobDef: type: object properties: - jobId: + job_id: $ref: '#/components/schemas/jobs.JobId' description: type: string @@ -635,53 +553,53 @@ components: device: type: string example: Kawasaki - nShots: + n_shots: type: integer minimum: 1 maximum: 10000000 example: '1000' - jobType: + job_type: type: string example: '''sampling'' or ''estimation'', ''sse''' - jobInfo: + job_info: $ref: '#/components/schemas/jobs.JobInfo' - transpilerInfo: + transpiler_info: $ref: '#/components/schemas/jobs.TranspilerInfo' - simulatorInfo: + simulator_info: $ref: '#/components/schemas/jobs.SimulatorInfo' - mitigationInfo: + mitigation_info: $ref: '#/components/schemas/jobs.MitigationInfo' status: $ref: '#/components/schemas/jobs.JobStatus' - createdAt: + created_at: type: string format: date-time example: '2022-10-19T11:45:34+09:00' required: - device - - nShots + - n_shots - status - - createdAt + - created_at example: - jobId: 7af020f6-2e38-4d70-8cf0-4349650ea08c + job_id: 7af020f6-2e38-4d70-8cf0-4349650ea08c description: Bell State Sampling note: Bell State Sampling Example device: Kawasaki - nShots: 1000 - jobInfo: '{''code'': ''{type: string, example: "OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;"}'', ''Operator'': ''X 0 Y 1 Z 5 I 2'', ''result'': {''00'': 5020, ''11'': 4980}, ''transpiledCode'': '''', ''reason'': ''''}' - transpilerInfo: '{''qubitAllocation'': {''0'': 12, ''1'': 16}, ''skipTranspilation'': false, ''seedTranspilation'': 873}' - simulatorInfo: '{''nQubits'': 5, ''nNodes'': 12, ''nPerNode'': 2, ''seedSimulation'': 39058567, ''simulationOpt'': {''optimizationMethod'': ''light'', ''optimizationBlockSize'': 1, ''optimizationSwapLevel'': 1}}' - mitigationInfo: '{''roErrorMitigation'': ''pseudo_inverse''}' + n_shots: 1000 + job_info: '{''code'': ''{type: string, example: "OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;"}'', ''Operator'': ''X 0 Y 1 Z 5 I 2'', ''result'': {''00'': 5020, ''11'': 4980}, ''transpiled_code'': '''', ''reason'': ''''}' + transpiler_info: '{''qubit_allocation'': {''0'': 12, ''1'': 16}, ''skip_transpilation'': false, ''seed_transpilation'': 873}' + simulator_info: '{''n_qubits'': 5, ''n_nodes'': 12, ''n_per_node'': 2, ''seed_simulation'': 39058567, ''simulation_opt'': {''optimization_method'': ''light'', ''optimization_block_size'': 1, ''optimization_swap_level'': 1}}' + mitigation_info: '{''ro_error_mitigation'': ''pseudo_inverse''}' status: submitted - createdAt: '2022-10-19T11:45:34+09:00' + created_at: '2022-10-19T11:45:34+09:00' jobs.SubmitJobResponse: description: submit a job type: object properties: - jobId: + job_id: $ref: '#/components/schemas/jobs.JobId' required: - - jobId + - job_id error.BadRequest: type: object properties: @@ -700,10 +618,10 @@ components: description: job status type: object properties: - jobId: + job_id: $ref: '#/components/schemas/jobs.JobId' status: $ref: '#/components/schemas/jobs.JobStatus' required: - - jobId + - job_id - status diff --git a/backend/oas/user/paths/devices.yaml b/backend/oas/user/paths/devices.yaml index 99e446e..cbc22e6 100644 --- a/backend/oas/user/paths/devices.yaml +++ b/backend/oas/user/paths/devices.yaml @@ -46,7 +46,7 @@ devices.deviceId: security: - BearerAuth: [] parameters: - - name: deviceId + - name: device_id in: path description: "Device identifier" required: true diff --git a/backend/oas/user/paths/jobs.yaml b/backend/oas/user/paths/jobs.yaml index 873f655..bf8c417 100644 --- a/backend/oas/user/paths/jobs.yaml +++ b/backend/oas/user/paths/jobs.yaml @@ -46,13 +46,13 @@ jobs: description: "Bell State Sampling", note: "Bell State Sampling Example", device: "Kawasaki", - nShots: 1000, - jobInfo: "{'code': '{type: string, example: \"OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;\"}', 'Operator': 'X 0 Y 1 Z 5 I 2', 'result': {'00': 5020, '11': 4980}, 'transpiledCode': '', 'reason': ''}", - transpilerInfo: "", - simulatorInfo: "{'nQubits': 5, 'nNodes': 12, 'nPerNode': 2, 'seedSimulation': 39058567, 'simulationOpt': {'optimizationMethod': 'light', 'optimizationBlockSize': 1, 'optimizationSwapLevel': 1}}", - mitigationInfo: "", + n_shots: 1000, + job_info: "{'code': '{type: string, example: \"OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;\"}', 'operator': 'X 0 Y 1 Z 5 I 2', 'result': {'00': 5020, '11': 4980}, 'transpiled_code': '', 'reason': ''}", + transpiler_info: "", + simulator_info: "{'n_qubits': 5, 'n_nodes': 12, 'n_per_node': 2, 'seed_simulation': 39058567, 'simulation_opt': {'optimization_method': 'light', 'optimization_block_size': 1, 'optimization_swap_level': 1}}", + mitigation_info: "", status: "submitted", - createdAt: "2022-10-19T11:45:34+09:00" + created_at: "2022-10-19T11:45:34+09:00" } qpu: description: QPU example @@ -61,13 +61,13 @@ jobs: description: "Bell State Sampling", note: "Bell State Sampling Example", device: "Kawasaki", - nShots: 1000, - jobInfo: "{'code': '{type: string, example: \"OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;\"}', 'Operator': 'X 0 Y 1 Z 5 I 2', 'result': {'00': 5020, '11': 4980}, 'transpiledCode': '', 'reason': ''}", - transpilerInfo: "{'qubitAllocation': {'0': 12, '1': 16}, 'skipTranspilation': false, 'seedTranspilation': 873}", - simulatorInfo: "", - mitigationInfo: "{'roErrorMitigation': 'pseudo_inverse'}", + n_shots: 1000, + job_info: "{'code': '{type: string, example: \"OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;\"}', 'operator': 'X 0 Y 1 Z 5 I 2', 'result': {'00': 5020, '11': 4980}, 'transpiled_code': '', 'reason': ''}", + transpiler_info: "{'qubit_allocation': {'0': 12, '1': 16}, 'skip_transpilation': false, 'seed_transpilation': 873}", + simulator_info: "", + mitigation_info: "{'ro_error_mitigation': 'pseudo_inverse'}", status: "submitted", - createdAt: "2022-10-19T11:45:34+09:00" + created_at: "2022-10-19T11:45:34+09:00" } responses: @@ -78,7 +78,7 @@ jobs: schema: $ref: "../schemas/jobs.yaml#/jobs.SubmitJobResponse" example: - jobId: 7af020f6-2e38-4d70-8cf0-4349650ea08c + job_id: 7af020f6-2e38-4d70-8cf0-4349650ea08c '400': description: Bad Request content: @@ -107,7 +107,7 @@ jobs.jobId: - BearerAuth: [] parameters: - in: path - name: jobId + name: job_id required: true description: "Job identifier" schema: {type: string} @@ -152,7 +152,7 @@ jobs.jobId: - BearerAuth: [] parameters: - in: path - name: jobId + name: job_id required: true description: "Job identifier" schema: {type: string} @@ -201,7 +201,7 @@ jobs.jobId.status: - BearerAuth: [] parameters: - in: path - name: jobId + name: job_id required: true description: "Job identifier" schema: {type: string} @@ -248,7 +248,7 @@ jobs.jobId.cancel: - BearerAuth: [] parameters: - in: path - name: jobId + name: job_id required: true description: "Job identifier" schema: {type: string} diff --git a/backend/oas/user/root.yaml b/backend/oas/user/root.yaml index d04d388..18de7dd 100644 --- a/backend/oas/user/root.yaml +++ b/backend/oas/user/root.yaml @@ -15,15 +15,15 @@ servers: paths: /devices: $ref: ./paths/devices.yaml#/devices - /devices/{deviceId}: + /devices/{device_id}: $ref: ./paths/devices.yaml#/devices.deviceId /jobs: $ref: ./paths/jobs.yaml#/jobs - /jobs/{jobId}: + /jobs/{job_id}: $ref: ./paths/jobs.yaml#/jobs.jobId - /jobs/{jobId}/status: + /jobs/{job_id}/status: $ref: ./paths/jobs.yaml#/jobs.jobId.status - /jobs/{jobId}/cancel: + /jobs/{job_id}/cancel: $ref: ./paths/jobs.yaml#/jobs.jobId.cancel components: diff --git a/backend/oas/user/schemas/devices.yaml b/backend/oas/user/schemas/devices.yaml index d7159f3..eddfa12 100644 --- a/backend/oas/user/schemas/devices.yaml +++ b/backend/oas/user/schemas/devices.yaml @@ -1,10 +1,10 @@ devices.DeviceInfo: type: object properties: - deviceId: + device_id: type: string example: "SVSim" - deviceType: + device_type: type: string enum: ["QPU", "simulator"] example: "simulator" @@ -12,36 +12,34 @@ devices.DeviceInfo: type: string enum: - ["AVAILABLE", "NOT_AVAILABLE"] - example: "AVAILABLE" - restartAt: - description: "Parameter mandatory and valid for 'NOT_AVAILABLE' devices" + ["available", "unavailable"] + example: "available" + available_at: + description: "Parameter mandatory and valid for 'unavailable' devices" type: string format: date-time example: "2022-10-19T11:45:34+09:00" - nPendingTasks: + n_pending_tasks: type: integer example: 8 - nQubits: + n_qubits: type: integer example: 39 - nNodes: - description: "Parameter valid only for 'simulator' devices" - type: integer - example: 512 - basisGates: + basis_gates: type: array items: type: string example: ["x", "y", "z", "h", "s", "sdg", "t", "tdg", "rx", "ry", "rz", "cx", "cz", "swap", "u1", "u2", "u3", "u", "p", "id", "sx", "sxdg"] - supportedInstructions: + supported_instructions: type: array items: type: string example: ["measure", "barrier", "reset"] - calibrationData: - $ref: "#/devices.CalibrationData" - calibratedAt: + device_info: + description: "json format calibration_data and n_nodes etc" + type: string + example: "{'n_nodes': 512, 'calibration_data': {'qubit_connectivity': ['(1,4)', '(4,5)', '(5,8)'], 't1': {'0': 55.51, '1': 37.03, '2': 57.13}}" + calibrated_at: description: "Parameter available only for 'QPU' devices with available calibration data" type: string format: date-time @@ -53,77 +51,14 @@ devices.DeviceInfo: deviceId, deviceType, status, nPendingTasks, basisGates, supportedInstructions, description ] example: - - deviceId: "SVSim" - deviceType: "simulator" + - device_id: "SVSim" + device_type: "simulator" status: "AVAILABLE" - nPendingTasks: 8 - nQubits: 39 - nNodes: 512 - basisGates: ["x", "y", "z", "h", "s", "sdg", "t", "tdg", "rx", "ry", "rz", "cx", "cz", "swap", "u1", "u2", "u3", "u", "p", "id", "sx", "sxdg"] - supportedInstructions: ["measure", "barrier", "reset"] + n_pending_tasks: 8 + n_qubits: 39 + n_nodes: 512 + basis_gates: ["x", "y", "z", "h", "s", "sdg", "t", "tdg", "rx", "ry", "rz", "cx", "cz", "swap", "u1", "u2", "u3", "u", "p", "id", "sx", "sxdg"] + supported_instructions: ["measure", "barrier", "reset"] + device_info: "{'n_nodes': 512, 'calibration_data': {'qubit_connectivity': ['(1,4)', '(4,5)', '(5,8)'], 't1': {'0': 55.51, '1': 37.03, '2': 57.13}}" + calibrated_at: "2022-10-19T11:45:34+09:00" description: "State vector-based quantum circuit simulator" - -devices.CalibrationData: - description: "Calibration data available only for 'QPU' devices" - type: object - properties: - qubitConnectivity: - type: array - items: - type: string - format: "(number, number)" - example: - ["(1,4)", "(4,5)", "(5,8)"] - t1: - type: object - additionalProperties: - type: number - format: float - example: - {"0": 55.51, "1": 37.03, "2": 57.13} - t2: - type: object - additionalProperties: - type: number - format: float - example: - {"0": 99.31, "1": 111.03, "2": 30.12} - roError: - type: object - additionalProperties: - type: number - format: float - example: - {"0": 4.67e-2, "1": 1.8e-1, "2": 3.55e-1} - gateError: - type: object - additionalProperties: - type: object - additionalProperties: - type: number - format: float - example: - {"sx": {"0": 6.92e-3, "1": 2.96e-3, "2": 7.2e-2}} - measProb0As1: - type: object - additionalProperties: - type: number - format: float - example: - {"0": 6.08e-3, "1": 1.2e-2, "2": 2.48e-1} - measProb1As0: - type: object - additionalProperties: - type: number - format: float - example: - {"0": 2.81e-2, "1": 3.86e-1, "2": 8.11e-2} - gateDuration: - type: object - additionalProperties: - type: object - additionalProperties: - type: number - format: float - example: - {"sx": {"0": 29.3, "1": 50.9, "2": 45.4}} diff --git a/backend/oas/user/schemas/jobs.yaml b/backend/oas/user/schemas/jobs.yaml index 3150ee1..96ff527 100644 --- a/backend/oas/user/schemas/jobs.yaml +++ b/backend/oas/user/schemas/jobs.yaml @@ -7,22 +7,22 @@ jobs.GetJobStatusResponse: description: job status type: object properties: - jobId: + job_id: $ref: "#/jobs.JobId" status: $ref: "#/jobs.JobStatus" required: [ - jobId,status + job_id,status ] jobs.SubmitJobResponse: description: submit a job type: object properties: - jobId: + job_id: $ref: '#/jobs.JobId' required: - - jobId + - job_id jobs.JobStatus: type: string @@ -48,7 +48,7 @@ jobs.MitigationInfo: jobs.JobDef: type: object properties: - jobId: + job_id: $ref: "#/jobs.JobId" description: type: string @@ -59,42 +59,42 @@ jobs.JobDef: device: type: string example: "Kawasaki" - nShots: + n_shots: type: integer minimum: 1 maximum: 1e7 example: "1000" - jobType: + job_type: type: string example: "'sampling' or 'estimation', 'sse'" - jobInfo: + job_info: $ref: "#/jobs.JobInfo" - transpilerInfo: + transpiler_info: $ref: "#/jobs.TranspilerInfo" - simulatorInfo: + simulator_info: $ref: "#/jobs.SimulatorInfo" - mitigationInfo: + mitigation_info: $ref: "#/jobs.MitigationInfo" status: $ref: "#/jobs.JobStatus" - createdAt: + created_at: type: string format: date-time example: "2022-10-19T11:45:34+09:00" required: [ - device, nShots, status, createdAt + device, n_shots, status, created_at ] example: { - jobId: "7af020f6-2e38-4d70-8cf0-4349650ea08c", + job_id: "7af020f6-2e38-4d70-8cf0-4349650ea08c", description: "Bell State Sampling", note: "Bell State Sampling Example", device: "Kawasaki", - nShots: 1000, - jobInfo: "{'code': '{type: string, example: \"OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;\"}', 'Operator': 'X 0 Y 1 Z 5 I 2', 'result': {'00': 5020, '11': 4980}, 'transpiledCode': '', 'reason': ''}", - transpilerInfo: "{'qubitAllocation': {'0': 12, '1': 16}, 'skipTranspilation': false, 'seedTranspilation': 873}", - simulatorInfo: "{'nQubits': 5, 'nNodes': 12, 'nPerNode': 2, 'seedSimulation': 39058567, 'simulationOpt': {'optimizationMethod': 'light', 'optimizationBlockSize': 1, 'optimizationSwapLevel': 1}}", - mitigationInfo: "{'roErrorMitigation': 'pseudo_inverse'}", + n_shots: 1000, + job_info: "{'code': '{type: string, example: \"OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;\"}', 'Operator': 'X 0 Y 1 Z 5 I 2', 'result': {'00': 5020, '11': 4980}, 'transpiled_code': '', 'reason': ''}", + transpiler_info: "{'qubit_allocation': {'0': 12, '1': 16}, 'skip_transpilation': false, 'seed_transpilation': 873}", + simulator_info: "{'n_qubits': 5, 'n_nodes': 12, 'n_per_node': 2, 'seed_simulation': 39058567, 'simulation_opt': {'optimization_method': 'light', 'optimization_block_size': 1, 'optimization_swap_level': 1}}", + mitigation_info: "{'ro_error_mitigation': 'pseudo_inverse'}", status: "submitted", - createdAt: "2022-10-19T11:45:34+09:00" + created_at: "2022-10-19T11:45:34+09:00" } diff --git a/backend/oqtopus_cloud/provider/schemas/__init__.py b/backend/oqtopus_cloud/provider/schemas/__init__.py index 1c41958..d2349dd 100644 --- a/backend/oqtopus_cloud/provider/schemas/__init__.py +++ b/backend/oqtopus_cloud/provider/schemas/__init__.py @@ -1,48 +1,4 @@ # generated by datamodel-codegen: # filename: openapi.yaml -# timestamp: 2024-10-10T00:36:24+00:00 +# timestamp: 2024-10-10T01:16:40+00:00 # version: 0.25.9 - -from __future__ import annotations - -from typing import Annotated, Optional - -from pydantic import BaseModel, Field - - -class CalibrationData(BaseModel): - """ - Calibration data available only for 'QPU' devices - """ - - qubitConnectivity: Annotated[ - Optional[list[str]], Field(None, examples=[["(1,4)", "(4,5)", "(5,8)"]]) - ] - t1: Annotated[ - Optional[dict[str, float]], - Field(None, examples=[{"0": 55.51, "1": 37.03, "2": 57.13}]), - ] - t2: Annotated[ - Optional[dict[str, float]], - Field(None, examples=[{"0": 99.31, "1": 111.03, "2": 30.12}]), - ] - roError: Annotated[ - Optional[dict[str, float]], - Field(None, examples=[{"0": 0.0467, "1": 0.18, "2": 0.355}]), - ] - gateError: Annotated[ - Optional[dict[str, dict[str, float]]], - Field(None, examples=[{"sx": {"0": 0.00692, "1": 0.00296, "2": 0.072}}]), - ] - measProb0As1: Annotated[ - Optional[dict[str, float]], - Field(None, examples=[{"0": 0.00608, "1": 0.012, "2": 0.248}]), - ] - measProb1As0: Annotated[ - Optional[dict[str, float]], - Field(None, examples=[{"0": 0.0281, "1": 0.386, "2": 0.0811}]), - ] - gateDuration: Annotated[ - Optional[dict[str, dict[str, float]]], - Field(None, examples=[{"sx": {"0": 29.3, "1": 50.9, "2": 45.4}}]), - ] diff --git a/backend/oqtopus_cloud/provider/schemas/devices.py b/backend/oqtopus_cloud/provider/schemas/devices.py index cba0bd8..da4b003 100644 --- a/backend/oqtopus_cloud/provider/schemas/devices.py +++ b/backend/oqtopus_cloud/provider/schemas/devices.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi.yaml -# timestamp: 2024-10-10T00:36:24+00:00 +# timestamp: 2024-10-10T01:16:40+00:00 # version: 0.25.9 from __future__ import annotations @@ -9,19 +9,17 @@ from pydantic import AwareDatetime, BaseModel, Field, RootModel -from . import CalibrationData - class DeviceStatusUpdate(BaseModel): command: Annotated[ Literal["DeviceStatusUpdate"], Field(examples=["DeviceStatusUpdate"]) ] - status: Optional[Literal["AVAILABLE", "NOT_AVAILABLE"]] = None - restartAt: Annotated[ + status: Optional[Literal["available", "unavailable"]] = None + restart_at: Annotated[ Optional[AwareDatetime], Field(None, examples=["2023-09-10T14:00:00+09:00"]) ] """ - Parameter mandatory and valid for status 'NOT_AVAILABLE' + Parameter mandatory and valid for status 'unavailable' """ @@ -30,15 +28,26 @@ class DevicePendingTasksUpdate(BaseModel): Literal["DevicePendingTasksUpdate"], Field(examples=["DevicePendingTasksUpdate"]), ] - nPendingTasks: Optional[int] = None + n_pending_tasks: Optional[int] = None class DeviceCalibrationUpdate(BaseModel): command: Annotated[ Literal["DeviceCalibrationUpdate"], Field(examples=["DeviceCalibrationUpdate"]) ] - calibrationData: Optional[CalibrationData] = None - calibratedAt: Annotated[ + device_info: Annotated[ + Optional[str], + Field( + None, + examples=[ + "{'n_nodes': 512, 'calibration_data': {'qubit_connectivity': ['(1,4)', '(4,5)', '(5,8)'], 't1': {'0': 55.51, '1': 37.03, '2': 57.13}}" + ], + ), + ] + """ + json format calibration_data and n_nodes etc + """ + calibrated_at: Annotated[ Optional[AwareDatetime], Field(None, examples=["2023-09-10T14:00:00+09:00"]) ] """ diff --git a/backend/oqtopus_cloud/provider/schemas/error.py b/backend/oqtopus_cloud/provider/schemas/error.py index ff64804..364c976 100644 --- a/backend/oqtopus_cloud/provider/schemas/error.py +++ b/backend/oqtopus_cloud/provider/schemas/error.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi.yaml -# timestamp: 2024-10-10T00:36:24+00:00 +# timestamp: 2024-10-10T01:16:40+00:00 # version: 0.25.9 from __future__ import annotations diff --git a/backend/oqtopus_cloud/provider/schemas/jobs.py b/backend/oqtopus_cloud/provider/schemas/jobs.py index 15bf638..3d85218 100644 --- a/backend/oqtopus_cloud/provider/schemas/jobs.py +++ b/backend/oqtopus_cloud/provider/schemas/jobs.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi.yaml -# timestamp: 2024-10-10T00:36:24+00:00 +# timestamp: 2024-10-10T01:16:40+00:00 # version: 0.25.9 from __future__ import annotations @@ -27,22 +27,22 @@ class JobInfo(RootModel[str]): str, Field( examples=[ - "{'code': '{type: string, example: \"OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;\"}', 'Operator': 'X 0 Y 1 Z 5 I 2', 'result': {'00': 5020, '11': 4980}, 'transpiledCode': '', 'reason': ''}" + "{'code': '{type: string, example: \"OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;\"}', 'Operator': 'X 0 Y 1 Z 5 I 2', 'result': {'00': 5020, '11': 4980}, 'transpiled_code': '', 'reason': ''}" ] ), ] class JobStatusUpdate(BaseModel): - status: Annotated[Literal["RUNNING"], Field(examples=["RUNNING"])] + status: Annotated[Literal["running"], Field(examples=["running"])] class JobStatusUpdateResponse(BaseModel): message: str -class InternalFetchableJobStatus(RootModel[Literal["QUEUED", "CANCELLING"]]): - root: Annotated[Literal["QUEUED", "CANCELLING"], Field(examples=["QUEUED"])] +class InternalFetchableJobStatus(RootModel[Literal["queued", "cancelling"]]): + root: Annotated[Literal["queued", "cancelling"], Field(examples=["queued"])] class JobId(RootModel[UUID]): diff --git a/backend/oqtopus_cloud/user/schemas/__init__.py b/backend/oqtopus_cloud/user/schemas/__init__.py index 499ce1b..8fdd883 100644 --- a/backend/oqtopus_cloud/user/schemas/__init__.py +++ b/backend/oqtopus_cloud/user/schemas/__init__.py @@ -1,4 +1,4 @@ # generated by datamodel-codegen: # filename: openapi.yaml -# timestamp: 2024-10-10T00:36:17+00:00 +# timestamp: 2024-10-10T01:16:33+00:00 # version: 0.25.9 diff --git a/backend/oqtopus_cloud/user/schemas/devices.py b/backend/oqtopus_cloud/user/schemas/devices.py index c3fa8c6..38f78d8 100644 --- a/backend/oqtopus_cloud/user/schemas/devices.py +++ b/backend/oqtopus_cloud/user/schemas/devices.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi.yaml -# timestamp: 2024-10-10T00:36:17+00:00 +# timestamp: 2024-10-10T01:16:33+00:00 # version: 0.25.9 from __future__ import annotations @@ -10,65 +10,26 @@ from pydantic import AwareDatetime, BaseModel, Field -class CalibrationData(BaseModel): - """ - Calibration data available only for 'QPU' devices - """ - - qubitConnectivity: Annotated[ - Optional[list[str]], Field(None, examples=[["(1,4)", "(4,5)", "(5,8)"]]) - ] - t1: Annotated[ - Optional[dict[str, float]], - Field(None, examples=[{"0": 55.51, "1": 37.03, "2": 57.13}]), - ] - t2: Annotated[ - Optional[dict[str, float]], - Field(None, examples=[{"0": 99.31, "1": 111.03, "2": 30.12}]), - ] - roError: Annotated[ - Optional[dict[str, float]], - Field(None, examples=[{"0": 0.0467, "1": 0.18, "2": 0.355}]), - ] - gateError: Annotated[ - Optional[dict[str, dict[str, float]]], - Field(None, examples=[{"sx": {"0": 0.00692, "1": 0.00296, "2": 0.072}}]), - ] - measProb0As1: Annotated[ - Optional[dict[str, float]], - Field(None, examples=[{"0": 0.00608, "1": 0.012, "2": 0.248}]), - ] - measProb1As0: Annotated[ - Optional[dict[str, float]], - Field(None, examples=[{"0": 0.0281, "1": 0.386, "2": 0.0811}]), - ] - gateDuration: Annotated[ - Optional[dict[str, dict[str, float]]], - Field(None, examples=[{"sx": {"0": 29.3, "1": 50.9, "2": 45.4}}]), - ] - - class DeviceInfo(BaseModel): - deviceId: Annotated[str, Field(examples=["SVSim"])] - deviceType: Annotated[Literal["QPU", "simulator"], Field(examples=["simulator"])] + device_id: Annotated[Optional[str], Field(None, examples=["SVSim"])] + device_type: Annotated[ + Optional[Literal["QPU", "simulator"]], Field(None, examples=["simulator"]) + ] status: Annotated[ - Literal["AVAILABLE", "NOT_AVAILABLE"], Field(examples=["AVAILABLE"]) + Literal["available", "unavailable"], Field(examples=["available"]) ] - restartAt: Annotated[ + available_at: Annotated[ Optional[AwareDatetime], Field(None, examples=["2022-10-19T11:45:34+09:00"]) ] """ - Parameter mandatory and valid for 'NOT_AVAILABLE' devices + Parameter mandatory and valid for 'unavailable' devices """ - nPendingTasks: Annotated[int, Field(examples=[8])] - nQubits: Annotated[Optional[int], Field(None, examples=[39])] - nNodes: Annotated[Optional[int], Field(None, examples=[512])] - """ - Parameter valid only for 'simulator' devices - """ - basisGates: Annotated[ - list[str], + n_pending_tasks: Annotated[Optional[int], Field(None, examples=[8])] + n_qubits: Annotated[Optional[int], Field(None, examples=[39])] + basis_gates: Annotated[ + Optional[list[str]], Field( + None, examples=[ [ "x", @@ -94,14 +55,25 @@ class DeviceInfo(BaseModel): "sx", "sxdg", ] - ] + ], ), ] - supportedInstructions: Annotated[ - list[str], Field(examples=[["measure", "barrier", "reset"]]) + supported_instructions: Annotated[ + Optional[list[str]], Field(None, examples=[["measure", "barrier", "reset"]]) ] - calibrationData: Optional[CalibrationData] = None - calibratedAt: Annotated[ + device_info: Annotated[ + Optional[str], + Field( + None, + examples=[ + "{'n_nodes': 512, 'calibration_data': {'qubit_connectivity': ['(1,4)', '(4,5)', '(5,8)'], 't1': {'0': 55.51, '1': 37.03, '2': 57.13}}" + ], + ), + ] + """ + json format calibration_data and n_nodes etc + """ + calibrated_at: Annotated[ Optional[AwareDatetime], Field(None, examples=["2022-10-19T11:45:34+09:00"]) ] """ diff --git a/backend/oqtopus_cloud/user/schemas/error.py b/backend/oqtopus_cloud/user/schemas/error.py index 6907fa4..3ebb0da 100644 --- a/backend/oqtopus_cloud/user/schemas/error.py +++ b/backend/oqtopus_cloud/user/schemas/error.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi.yaml -# timestamp: 2024-10-10T00:36:17+00:00 +# timestamp: 2024-10-10T01:16:33+00:00 # version: 0.25.9 from __future__ import annotations diff --git a/backend/oqtopus_cloud/user/schemas/jobs.py b/backend/oqtopus_cloud/user/schemas/jobs.py index 8762bef..9721f2b 100644 --- a/backend/oqtopus_cloud/user/schemas/jobs.py +++ b/backend/oqtopus_cloud/user/schemas/jobs.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi.yaml -# timestamp: 2024-10-10T00:36:17+00:00 +# timestamp: 2024-10-10T01:16:33+00:00 # version: 0.25.9 from __future__ import annotations @@ -64,22 +64,22 @@ class JobStatus( class JobDef(BaseModel): - jobId: Optional[JobId] = None + job_id: Optional[JobId] = None description: Annotated[Optional[str], Field(None, examples=["Bell State Sampling"])] note: Annotated[ Optional[str], Field(None, examples=["Bell State Sampling Example"]) ] device: Annotated[str, Field(examples=["Kawasaki"])] - nShots: Annotated[int, Field(examples=["1000"], ge=1, le=10000000)] - jobType: Annotated[ + n_shots: Annotated[int, Field(examples=["1000"], ge=1, le=10000000)] + job_type: Annotated[ Optional[str], Field(None, examples=["'sampling' or 'estimation', 'sse'"]) ] - jobInfo: Optional[JobInfo] = None - transpilerInfo: Optional[TranspilerInfo] = None - simulatorInfo: Optional[SimulatorInfo] = None - mitigationInfo: Optional[MitigationInfo] = None + job_info: Optional[JobInfo] = None + transpiler_info: Optional[TranspilerInfo] = None + simulator_info: Optional[SimulatorInfo] = None + mitigation_info: Optional[MitigationInfo] = None status: JobStatus - createdAt: Annotated[AwareDatetime, Field(examples=["2022-10-19T11:45:34+09:00"])] + created_at: Annotated[AwareDatetime, Field(examples=["2022-10-19T11:45:34+09:00"])] class SubmitJobResponse(BaseModel): @@ -87,7 +87,7 @@ class SubmitJobResponse(BaseModel): submit a job """ - jobId: JobId + job_id: JobId class GetJobStatusResponse(BaseModel): @@ -95,5 +95,5 @@ class GetJobStatusResponse(BaseModel): job status """ - jobId: JobId + job_id: JobId status: JobStatus diff --git a/backend/oqtopus_cloud/user/schemas/success.py b/backend/oqtopus_cloud/user/schemas/success.py index f4253fb..e46f04c 100644 --- a/backend/oqtopus_cloud/user/schemas/success.py +++ b/backend/oqtopus_cloud/user/schemas/success.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi.yaml -# timestamp: 2024-10-10T00:36:17+00:00 +# timestamp: 2024-10-10T01:16:33+00:00 # version: 0.25.9 from __future__ import annotations diff --git a/runnbooks/provider/tasks/get-task.yaml b/runnbooks/provider/tasks/get-task.yaml index 0fc91dd..a8a26c6 100644 --- a/runnbooks/provider/tasks/get-task.yaml +++ b/runnbooks/provider/tasks/get-task.yaml @@ -15,4 +15,4 @@ steps: # status code is 200 current.res.status == 200 # body is as expected - && compare(current.res.body, {"action":{"nShots":1024,"name":"sampling"},"code":"OPENQASM 2.0;\ninclude \"qelib1.inc\";\nqreg q[2];\nh q[0];\ncx q[0], q[1];\nmeasure q[0] -\u003e c[0];\nmeasure q[1] -\u003e c[1];","createdAt":"2024-03-28T16:50:27+09:00","device":"Kawasaki","nNodes":12,"nPerNode":1,"nQubits":2,"qubitAllocation":null,"roErrorMitigation":"none","seedSimulation":null,"seedTranspilation":null,"simulationOpt":null,"skipTranspilation":false,"status":"QUEUED","taskId":"7af020f6-2e38-4d70-8cf0-4349650ea08c"}) + && compare(current.res.body, {"action":{"n_shots":1024,"name":"sampling"},"code":"OPENQASM 2.0;\ninclude \"qelib1.inc\";\nqreg q[2];\nh q[0];\ncx q[0], q[1];\nmeasure q[0] -\u003e c[0];\nmeasure q[1] -\u003e c[1];","createdAt":"2024-03-28T16:50:27+09:00","device":"Kawasaki","nNodes":12,"nPerNode":1,"nQubits":2,"qubitAllocation":null,"roErrorMitigation":"none","seedSimulation":null,"seedTranspilation":null,"simulationOpt":null,"skipTranspilation":false,"status":"QUEUED","taskId":"7af020f6-2e38-4d70-8cf0-4349650ea08c"}) diff --git a/runnbooks/provider/tasks/get-tasks.yaml b/runnbooks/provider/tasks/get-tasks.yaml index 518449f..f4e5ef2 100644 --- a/runnbooks/provider/tasks/get-tasks.yaml +++ b/runnbooks/provider/tasks/get-tasks.yaml @@ -15,4 +15,4 @@ steps: # status code is 200 current.res.status == 200 # body is as expected - && compare(current.res.body, [{"action":{"nShots":1024,"name":"sampling"},"code":"OPENQASM 2.0;\ninclude \"qelib1.inc\";\nqreg q[2];\nh q[0];\ncx q[0], q[1];\nmeasure q[0] -\u003e c[0];\nmeasure q[1] -\u003e c[1];","createdAt":"2024-03-28T16:50:27+09:00","device":"Kawasaki","nNodes":12,"nPerNode":1,"nQubits":2,"qubitAllocation":null,"roErrorMitigation":"none","seedSimulation":null,"seedTranspilation":null,"simulationOpt":null,"skipTranspilation":false,"status":"QUEUED","taskId":"7af020f6-2e38-4d70-8cf0-4349650ea08c"}]) + && compare(current.res.body, [{"action":{"n_shots":1024,"name":"sampling"},"code":"OPENQASM 2.0;\ninclude \"qelib1.inc\";\nqreg q[2];\nh q[0];\ncx q[0], q[1];\nmeasure q[0] -\u003e c[0];\nmeasure q[1] -\u003e c[1];","createdAt":"2024-03-28T16:50:27+09:00","device":"Kawasaki","nNodes":12,"nPerNode":1,"nQubits":2,"qubitAllocation":null,"roErrorMitigation":"none","seedSimulation":null,"seedTranspilation":null,"simulationOpt":null,"skipTranspilation":false,"status":"QUEUED","taskId":"7af020f6-2e38-4d70-8cf0-4349650ea08c"}])