Skip to content

Commit 9259dfd

Browse files
authored
Minor samples cleanup (#2880)
This removes the inadvertantly checked cell outputs for carbon.ipynb, removes a todo from benzene.ipynb, and updates how the chemistry sample loads the chemistry library so that it's more stand-alone.
1 parent 4110a68 commit 9259dfd

7 files changed

Lines changed: 28 additions & 88 deletions

File tree

library/fixed_point/qsharp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"Signed": {
66
"github": {
77
"owner": "Microsoft",
8-
"repo": "qsharp",
8+
"repo": "qdk",
99
"ref": "v1.25.0",
1010
"path": "library/signed"
1111
}

library/signed/qsharp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"Qtest": {
66
"github": {
77
"owner": "Microsoft",
8-
"repo": "qsharp",
8+
"repo": "qdk",
99
"ref": "v1.25.0",
1010
"path": "library/qtest"
1111
}

samples/chemistry/SPSA/qsharp.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
2-
"dependencies": {
3-
"Chemistry": {
4-
"path": "../../../library/chemistry"
2+
"dependencies": {
3+
"Chemistry": {
4+
"github": {
5+
"ref": "v1.25.0",
6+
"owner": "microsoft",
7+
"repo": "qdk",
8+
"path": "library/chemistry"
9+
}
10+
}
511
}
6-
}
712
}

samples/notebooks/benzene_molecule/benzene.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
"from pathlib import Path\n",
131131
"from qdk.widgets import MoleculeViewer\n",
132132
"\n",
133-
"# TODO: This data should come from calling qdk-chemistry Python APIs.\n",
133+
"# Load cached molecule data from file.\n",
134134
"molecule_data = Path(\"benzene_diradical.structure.xyz\").read_text()\n",
135135
"cube_data = {\n",
136136
" \"alpha_18\": Path(\"MO_alpha_18.cube\").read_text(),\n",

samples/notebooks/carbon_error_correction/carbon.ipynb

Lines changed: 6 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -178,26 +178,10 @@
178178
},
179179
{
180180
"cell_type": "code",
181-
"execution_count": 7,
181+
"execution_count": null,
182182
"id": "8e05e0f8",
183183
"metadata": {},
184-
"outputs": [
185-
{
186-
"data": {
187-
"application/vnd.jupyter.widget-view+json": {
188-
"model_id": "4410a84a0ec841a9a5daf7aa1e27c25b",
189-
"version_major": 2,
190-
"version_minor": 1
191-
},
192-
"text/plain": [
193-
"<qsharp_widgets.Histogram object at 0x10e17b450>"
194-
]
195-
},
196-
"execution_count": 7,
197-
"metadata": {},
198-
"output_type": "execute_result"
199-
}
200-
],
184+
"outputs": [],
201185
"source": [
202186
"res = device.simulate(qir, shots=1000, type=\"clifford\")\n",
203187
"corrected_logical_results = decoder.decode_results(res, \"Z\")\n",
@@ -214,39 +198,10 @@
214198
},
215199
{
216200
"cell_type": "code",
217-
"execution_count": 8,
201+
"execution_count": null,
218202
"id": "b0f2063e",
219203
"metadata": {},
220-
"outputs": [
221-
{
222-
"data": {
223-
"application/vnd.jupyter.widget-view+json": {
224-
"model_id": "f41032d29c7c4f31948d7089c786d40e",
225-
"version_major": 2,
226-
"version_minor": 1
227-
},
228-
"text/plain": [
229-
"<qsharp_widgets.Histogram object at 0x108584510>"
230-
]
231-
},
232-
"metadata": {},
233-
"output_type": "display_data"
234-
},
235-
{
236-
"data": {
237-
"application/vnd.jupyter.widget-view+json": {
238-
"model_id": "eca2be5fcf0f468ca6f28458fef98dd3",
239-
"version_major": 2,
240-
"version_minor": 1
241-
},
242-
"text/plain": [
243-
"<qsharp_widgets.Histogram object at 0x10e2a0690>"
244-
]
245-
},
246-
"metadata": {},
247-
"output_type": "display_data"
248-
}
249-
],
204+
"outputs": [],
250205
"source": [
251206
"noise = NoiseConfig()\n",
252207
"\n",
@@ -289,39 +244,10 @@
289244
},
290245
{
291246
"cell_type": "code",
292-
"execution_count": 9,
247+
"execution_count": null,
293248
"id": "35e7dc3c",
294249
"metadata": {},
295-
"outputs": [
296-
{
297-
"data": {
298-
"application/vnd.jupyter.widget-view+json": {
299-
"model_id": "d79a1d1efe2449f08aa22c870acc2def",
300-
"version_major": 2,
301-
"version_minor": 1
302-
},
303-
"text/plain": [
304-
"<qsharp_widgets.Histogram object at 0x10836de90>"
305-
]
306-
},
307-
"metadata": {},
308-
"output_type": "display_data"
309-
},
310-
{
311-
"data": {
312-
"application/vnd.jupyter.widget-view+json": {
313-
"model_id": "af464fa55640435ca6362061162b0e60",
314-
"version_major": 2,
315-
"version_minor": 1
316-
},
317-
"text/plain": [
318-
"<qsharp_widgets.Histogram object at 0x10e134a90>"
319-
]
320-
},
321-
"metadata": {},
322-
"output_type": "display_data"
323-
}
324-
],
250+
"outputs": [],
325251
"source": [
326252
"flattened = [r for res in corrected_logical_results for r in res]\n",
327253
"display(Histogram(map(str, flattened)))\n",

source/samples_test/build.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,15 @@ fn collect_qsharp_project_folders(path: &Path) -> Vec<PathBuf> {
226226
if entry.is_dir() {
227227
projects.append(&mut collect_qsharp_project_folders(entry));
228228
} else if Some("qsharp.json") == entry.file_name().and_then(OsStr::to_str) {
229+
if entry
230+
.parent()
231+
.expect("file should have parent dir")
232+
.ends_with("SPSA")
233+
{
234+
// Skip the SPSA project since it has GitHub-based dependencies that
235+
// can't be resolved with the test filesystem.
236+
continue;
237+
}
229238
projects.push(
230239
path.canonicalize()
231240
.expect("path should resolve to a canonical path"),

source/vscode/resources/chat-instructions/qsharp.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ file might appear as:
7979
"github": {
8080
"ref": "v1.15.0",
8181
"owner": "microsoft",
82-
"repo": "qsharp",
82+
"repo": "qdk",
8383
"path": "library/chemistry"
8484
}
8585
}

0 commit comments

Comments
 (0)