Skip to content

Commit

Permalink
change snake_case yaml properties and parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
forest1040 committed Oct 10, 2024
1 parent 7ffe9a9 commit d15bba7
Show file tree
Hide file tree
Showing 23 changed files with 298 additions and 685 deletions.
180 changes: 33 additions & 147 deletions backend/oas/provider/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ servers:
- url: http://localhost:8888
description: Local server url
paths:
/devices/{deviceId}:
/devices/{device_id}:
patch:
tags:
- devices
Expand All @@ -23,7 +23,7 @@ paths:
security: []
parameters:
- in: path
name: deviceId
name: device_id
description: Device ID
required: true
schema:
Expand All @@ -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
Expand Down Expand Up @@ -131,7 +97,7 @@ paths:
security: []
parameters:
- in: query
name: deviceId
name: device_id
required: true
description: Device identifier
schema:
Expand All @@ -143,7 +109,7 @@ paths:
schema:
$ref: '#/components/schemas/jobs.InternalJobStatus'
- in: query
name: maxResults
name: max_results
description: Additional search parameter:<br/> Set max number of quantum jobs to return in single request
schema:
type: integer
Expand Down Expand Up @@ -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
Expand All @@ -189,7 +155,7 @@ paths:
- jobs
parameters:
- in: path
name: jobId
name: job_id
required: true
description: Job identifier
schema:
Expand Down Expand Up @@ -226,7 +192,7 @@ paths:
- jobs
parameters:
- in: path
name: jobId
name: job_id
required: true
description: Job identifier
schema:
Expand Down Expand Up @@ -272,7 +238,7 @@ paths:
- jobs
parameters:
- in: query
name: deviceId
name: device_id
required: true
description: Device identifier
schema:
Expand All @@ -285,7 +251,7 @@ paths:
schema:
$ref: '#/components/schemas/jobs.InternalFetchableJobStatus'
- in: query
name: maxResults
name: max_results
description: Additional search parameter:<br/> Set max number of quantum jobs to return in single request
schema:
type: integer
Expand Down Expand Up @@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -500,9 +386,9 @@ components:
jobs.InternalFetchableJobStatus:
type: string
enum:
- QUEUED
- CANCELLING
example: QUEUED
- queued
- cancelling
example: queued
jobs.JobId:
type: string
format: uuid
Expand Down
38 changes: 20 additions & 18 deletions backend/oas/provider/paths/devices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ devices.deviceId:
security: []
parameters:
- in: path
name: deviceId
name: device_id
description: "Device ID"
required: true
schema:
Expand All @@ -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':
Expand Down
Loading

0 comments on commit d15bba7

Please sign in to comment.