Skip to content

Commit bb4e726

Browse files
LucasSilbernageldoctorperceptronrashidnhm
authored
Add hardware section to metadata (#927)
## Related epic https://app.shortcut.com/xanaduai/epic/45372/users-can-see-example-code-that-demonstrates-how-demos-run-on-real-quantum-hardware-from-aws ## Changes - Updated the demo metadata schema to include an optional hardware section (only to include AWS for the time being, but can accommodate more vendors in future) - Added the hardware metadata to 1 demo for testing purposes - Added AWS logo image asset --------- Co-authored-by: Paul Finlay <[email protected]> Co-authored-by: Rashid N H M <[email protected]>
1 parent 5d617d4 commit bb4e726

File tree

5 files changed

+58
-1
lines changed

5 files changed

+58
-1
lines changed

_static/hardware_logos/aws.png

27.4 KB
Loading

demonstrations/tutorial_qubit_rotation.metadata.json

+7
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,12 @@
3939
"id": "tutorial_state_preparation",
4040
"weight": 1.0
4141
}
42+
],
43+
"hardware": [
44+
{
45+
"id": "aws",
46+
"link": "https://pennylane.ai/qml/demos/tutorial_qubit_rotation",
47+
"logo": "/_static/hardware_logos/aws.png"
48+
}
4249
]
4350
}

demonstrations_metadata.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ Below is given an example of a complete metadata file for a demonstration.
5858
"id": "tutorial_qubit_rotation",
5959
"weight": 1.0
6060
}
61+
],
62+
"hardware": [
63+
{
64+
"id": "aws",
65+
"link": "https://pennylane.ai/qml/demos/tutorial_quantum_transfer_learning",
66+
"logo": "/_static/hardware_logos/aws.png"
67+
}
6168
]
6269
}
6370
```
@@ -84,6 +91,7 @@ The table below gives details about the fields in the metadata JSON file for ver
8491
| `basedOnPapers` | Yes, but can be an empty array | `array` of `string` | An array of the DOIs for the papers this demo is based on. |
8592
| `referencedByPapers` | Yes, but can be an empty array | `array` of `string` | An array of the DOIs of any papers that reference this demo. |
8693
| `relatedContent` | Yes, but can be an empty array | `array` of `object` | An array of objects describing the content related to this demo. See below for the object structure. |
94+
| `hardware` | No. Can be an empty array. | `array` of `object` | An array of objects representing third-party vendors who can run the demo on their hardware. See below for the object structure. |
8795

8896
### Author Object Properties
8997

@@ -125,6 +133,14 @@ The table below gives details about the fields in the metadata JSON file for ver
125133
| `id` | Yes | `string` | The id of the content that this relation refers to. For demos, it's the file name of the demo without the extension - i.e., `tutorial_haar_measure`. |
126134
| `weight` | Yes | `number` | A number between -1.0 and 1.0 indicating both how closely related these two pieces of content are, and which one it is preferable to encounter first. A value of 1.0 indicates that these two pieces of content are *very* closely related, and this one should be read first, and the linked one second. A value of -1.0 indicates again that these two pieces of content are very closely related, but that the linked one should be read first. A value of 0.0 indicates that these two pieces of content have nothing to do with each other. |
127135

136+
### Hardware Object Properties
137+
138+
| Name | Is Required | Value Type | Description |
139+
|---|---|---|---|
140+
| `id` | Yes | `enum` | The ID of the hardware vendor |
141+
| `link` | Yes | `string` | Link to run the demo on the vendor's hardware |
142+
| `logo` | Yes | `string` | The URI of the vendor's logo image, whether it be something hosted locally or on another site. |
143+
128144

129145

130146

@@ -202,7 +218,9 @@ The table below gives details about the fields in the metadata JSON file for ver
202218
"id": "",
203219
"weight": 1.0
204220
}
205-
]
221+
],
222+
"relatedContent": [],
223+
"hardware": []
206224
}
207225
```
208226

metadata_schemas/demo.metadata.schema.0.1.0.json

+7
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@
106106
"items": {
107107
"$ref": "file:./objects/related.content.schema.0.1.0.json"
108108
}
109+
},
110+
"hardware": {
111+
"description": "An array of objects representing third-party vendors who can run the demo on their hardware. An empty array is allowed.",
112+
"type": "array",
113+
"items": {
114+
"$ref": "file:./objects/hardware.schema.0.1.0.json"
115+
}
109116
}
110117
},
111118
"required": [
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "hardware.schema.0.1.0.json",
4+
"title": "Hardware",
5+
"description": "Hardware vendors that can run the demo on their hardware",
6+
"type": "object",
7+
"properties": {
8+
"id": {
9+
"description": "The ID of the hardware vendor",
10+
"enum": ["aws"]
11+
},
12+
"link": {
13+
"description": "Link to run the demo on the vendor's hardware",
14+
"type": "string"
15+
},
16+
"logo": {
17+
"description": "The URI of the vendor's logo image, whether it be something hosted locally or on another site.",
18+
"type": "string",
19+
"format": "uri-reference"
20+
}
21+
},
22+
"required": [
23+
"id", "link", "logo"
24+
]
25+
}

0 commit comments

Comments
 (0)