Skip to content

Commit c27d410

Browse files
Update Generated Sample Notebook to use qdk Instead of Separate Packages (#2770)
1 parent 904ab7f commit c27d410

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

source/vscode/src/azure/workspaceActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export function getPythonCodeForWorkspace(
110110
# should be configured and used for authentication. For more information, see
111111
# https://learn.microsoft.com/en-us/azure/developer/python/sdk/authentication-overview
112112
113-
from azure.quantum import Workspace
113+
from qdk.azure import Workspace
114114
115115
# If using an access key, replace the below with: Workspace.from_connection_string(connection_string)
116116
# Or set the "AZURE_QUANTUM_CONNECTION_STRING" environment variable and just use: Workspace()

source/vscode/src/notebookTemplate.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ export const notebookTemplate: vscode.NotebookData = {
1313
languageId: "markdown",
1414
value: `## Azure Quantum Q# notebook
1515
16-
To use Jupyter Notebooks with Q#, the "qsharp" and "jupyterlab" Python packages should be installed.
16+
To use Jupyter Notebooks with Q#, the "qdk" Python package should be installed with the "jupyter" extra.
1717
1818
To render charts as shown in this notebook, Matplotlib with notebook widgets support should be installed via "ipympl".
1919
20-
To submit to Azure Quantum as shown in this notebook, the "azure-quantum" package needs to be installed.
20+
To submit to Azure Quantum as shown in this notebook, the "azure" extra of the "qdk" package needs to be installed.
2121
2222
You can install all the above packages in your Python environment by running the below in your terminal:
2323
2424
\`\`\`bash
25-
pip install jupyterlab qsharp ipympl azure-quantum
25+
pip install "qdk[jupyter,azure]" ipympl
2626
\`\`\``,
2727
},
2828
{
2929
kind: vscode.NotebookCellKind.Code,
3030
languageId: "python",
3131
value: `# Run this cell first to enable the "%%qsharp" magic command used in later cells
32-
import qsharp
32+
from qdk import qsharp
3333
`,
3434
},
3535
{
@@ -123,20 +123,20 @@ plt.show()
123123
languageId: "markdown",
124124
value: `## Q# widgets
125125
126-
You can also use the \`qsharp_widgets\` package to visualize data. Install with \`pip install qsharp-widgets\``,
126+
You can also use the widgets to visualize data.`,
127127
},
128128
{
129129
kind: vscode.NotebookCellKind.Code,
130130
languageId: "python",
131-
value: `from qsharp_widgets import Histogram
131+
value: `from qdk.widgets import Histogram
132132
133133
Histogram(results)
134134
`,
135135
},
136136
{
137137
kind: vscode.NotebookCellKind.Code,
138138
languageId: "python",
139-
value: `from qsharp_widgets import EstimatesPanel
139+
value: `from qdk.widgets import EstimatesPanel
140140
141141
estimate = qsharp.estimate("RandomBit()", [
142142
{"errorBudget": 0.333, "qubitParams": {"name": "qubit_gate_ns_e3"}},
@@ -154,7 +154,7 @@ EstimatesPanel(estimate)
154154
Different quantum hardware supports different capabilities, but all Azure Quantum providers support the 'base profile'
155155
as defined in the 'Quantum Intermediate Representation' (QIR) specification. (For more details see <https://aka.ms/qdk.qir>)
156156
157-
To develop code using this base profile, reintialize the Q# compiler, connect to your Azure Quantum workspace, and submit the job.
157+
To develop code using this base profile, reinitialize the Q# compiler, connect to your Azure Quantum workspace, and submit the job.
158158
`,
159159
},
160160
{

0 commit comments

Comments
 (0)