├── .github ├── actions │ └── status-checker │ │ ├── __tests__ │ │ ├── 3 │ │ │ └── three.md │ │ ├── main.test.ts │ │ ├── file-heading-extractor.test.ts │ │ ├── no-heading.md │ │ └── sample.md │ │ ├── .prettierignore │ │ ├── .gitattributes │ │ ├── src │ │ ├── types │ │ │ ├── Mode.ts │ │ │ ├── NodeOf.ts │ │ │ ├── PageInfo.ts │ │ │ ├── ChangeType.ts │ │ │ ├── PullRequestState.ts │ │ │ ├── PullRequestDetails.ts │ │ │ ├── FileChange.ts │ │ │ ├── Pull.ts │ │ │ └── WorkflowInput.ts │ │ ├── wait.ts │ │ ├── main.ts │ │ ├── file-heading-extractor.ts │ │ └── status-checker.ts │ │ ├── .eslintignore │ │ ├── jest.config.js │ │ ├── tsconfig.json │ │ ├── package.json │ │ ├── README.md │ │ ├── action.yml │ │ ├── .gitignore │ │ └── .eslintrc.json ├── ISSUE_TEMPLATE │ ├── azure-quantum-documentation-issue.md │ └── config.yml ├── workflows │ ├── check-for-build-warnings.yml │ ├── broken-links-quantum-docs.yml │ └── broken-links-MSLearn.yml └── scripts │ └── ignorelinks.txt ├── articles ├── .vscode │ └── settings.json ├── media │ ├── qrng-H.PNG │ ├── find-subs.png │ ├── logo-qci.png │ ├── qft_full.PNG │ ├── qrng-meas.PNG │ ├── aq-diagram.png │ ├── logo-ionq2.png │ ├── logo-pasqal.png │ ├── noisy-1-25.png │ ├── noisy-50-50.png │ ├── pencil-edit.png │ ├── qft_firstH.PNG │ ├── qrng-Bloch.PNG │ ├── 5-qubit-qccc.png │ ├── concepts_bloch.png │ ├── git-workflow.vsdx │ ├── ionq-results.png │ ├── launch-vs-code.png │ ├── logo-rigetti.png │ ├── multi-file-art.png │ ├── noisy-settings.png │ ├── plane-grovers.png │ ├── qft_firstqubit.PNG │ ├── run_or_run_all.png │ ├── starting-state.png │ ├── add-contributors.png │ ├── codelens-circuit.png │ ├── histogram-output.png │ ├── logo-microsoft2.png │ ├── noisy-allocation.png │ ├── upload-notebook.png │ ├── assign-contributors.png │ ├── codelens-histogram.png │ ├── codelens-run-QRNG.png │ ├── codelens-run-debug.png │ ├── grovers-iteration.PNG │ ├── noisy-measurement.png │ ├── portal-quotas-blade.png │ ├── quantinuum-results.png │ ├── reflection-operator.png │ ├── sample-list-vscode.png │ ├── vscode-add-rigetti.png │ ├── vscode-run-rigetti.png │ ├── add-providers-portal.PNG │ ├── azure-portal-job-list.png │ ├── bulk-invite-users-CSV.png │ ├── histogram-vscode-qrng.png │ ├── portal-credits-blade.png │ ├── qdk-agent-tools-list.png │ ├── qsharp-quickstart-run.png │ ├── annotated-sample-circuit.png │ ├── circuit-jupyter-notebook.png │ ├── circuit-vscode-randombit.png │ ├── codelens-estimate-shorRE.png │ ├── codelens-histogram-QRNG.png │ ├── connection-string-copy.png │ ├── connection-string-enable.png │ ├── estimate-dropdown-shorRE.png │ ├── hybrid │ │ └── cost-estimation.png │ ├── qsharp-quickstart-hover.png │ ├── azure-portal-billing-plans.png │ ├── azure-quantum-flow-diagram.png │ ├── circuit-codelens-operation.png │ ├── histogram-vscode-qrng-tab.png │ ├── job-costs │ │ ├── job-cost-details.png │ │ └── job-table-with-costs.png │ ├── quantum-cryptography-qcom.PNG │ ├── qubit-time-diagram-shorRE.png │ ├── azure-portal-sample-gallery.png │ ├── bulk-invite-users-new-group.png │ ├── connection-string-regenerate.png │ ├── histogram-vscode-entanglement.png │ ├── histogram-vscode-random-bit.png │ ├── manage-workspace-access-scope.png │ ├── provider-format-pasqal-array.png │ ├── success-probability-grovers.PNG │ ├── annotated-teleportation-circuit.png │ ├── azure-portal-workspace-overview.png │ ├── bulk-invite-users-download-csv.png │ ├── cost-management-invoice-portal.png │ ├── histogram-vscode-random-bit-tab.png │ ├── provider-format-pasqal-sequence.png │ ├── vscode-estimates-local-diagram.PNG │ ├── azure-quantum-qiskit-hw-result-1.png │ ├── azure-quantum-qiskit-hw-result-2.png │ ├── azure-quantum-qiskit-ionq-result-1.png │ ├── azure-quantum-qiskit-ionq-result-2.png │ ├── bulk-invite-users-add-assignment.png │ ├── bulk-invite-users-add-contributor.png │ ├── bulk-invite-users-download-users.png │ ├── bulk-invite-users-new-group-create.png │ ├── histogram-vscode-entanglement-tab.png │ ├── quantum-workspace-explorer-vscode.png │ ├── resource-estimator-diagram-jupyter.PNG │ ├── resource-estimator-stack-computing.png │ ├── resource-estimator-tfactory-plot.png │ ├── vscode-estimates-local-results-tab.PNG │ ├── vscode-show-azure-quantum-results.png │ ├── circuits-jupyter-notebook-bellstate.png │ ├── Resource-Estimation-component-overview.png │ ├── azure-quantum-qiskit-rigetti-qvm-result.png │ ├── azure-quantum-qiskit-rigetti-result-1.png │ ├── azure-quantum-qiskit-rigetti-result-2.png │ ├── bulk-invite-users-add-group-contributor.png │ ├── bulk-invite-users-upload-csv-successful.png │ ├── multiple-configurations-frontier-shorRE.png │ ├── resource-estimator-space-diagram-qiskit.PNG │ ├── vscode-estimates-local-diagram-shorRE.PNG │ ├── vscode-estimates-local-diagram-space-time.png │ ├── vscode-estimates-local-results-tab-shorRE.PNG │ ├── bulk-invite-users-CSV-user-principal-names.png │ ├── bulk-invite-users-assign-group-contributor.png │ ├── qubit-time-frontier-multiple-config-shorRE.png │ ├── qubit-time-frontier-estimation-jupyter-shorRE.png │ ├── how-to-run-notebooks-workspace │ │ ├── create-new-notebook.png │ │ ├── notebook-context-pane.png │ │ └── new-python-notebook-snippet.png │ ├── how-to-publish-qio-job-as-azurefunction │ │ └── prepare-cloud-env-3.png │ └── logo-quantinuum.svg ├── user-guide │ └── language │ │ ├── toc.yml │ │ ├── Statements │ │ ├── toc.yml │ │ ├── index.md │ │ └── bindingscopes.md │ │ ├── ProgramStructure │ │ ├── toc.yml │ │ ├── typedeclarations.md │ │ ├── comments.md │ │ └── namespaces.md │ │ ├── TypeSystem │ │ ├── toc.yml │ │ ├── singletontupleequivalence.md │ │ ├── immutability.md │ │ ├── typeinference.md │ │ └── quantumdatatypes.md │ │ ├── Expressions │ │ ├── logicalexpressions.md │ │ ├── concatenation.md │ │ ├── bitwiseexpressions.md │ │ ├── toc.yml │ │ ├── arithmeticexpressions.md │ │ ├── conjugations.md │ │ ├── conditionalexpressions.md │ │ ├── iterations.md │ │ ├── comparativeexpressions.md │ │ ├── callstatements.md │ │ ├── conditionalbranching.md │ │ ├── index.md │ │ ├── returnsandtermination.md │ │ ├── conditionalloops.md │ │ ├── copyandupdateexpressions.md │ │ ├── functorapplication.md │ │ ├── contextualexpressions.md │ │ └── itemaccessexpressions.md │ │ └── uid-map.csv ├── breadcrumb │ └── toc.yml ├── includes │ ├── copilot-banner.md │ ├── qiskit-qml-sample.py │ └── quickstart-provider-include-quantinuum.md ├── contributing-overview.md ├── supported-macros.md ├── release-notes.md ├── quickstart-microsoft-qiskit.md ├── how-to-submit-jobs.md ├── qdk-qiskit-cirq-overview.md ├── provider-support-pasqal.md ├── overview-microsoft-quantum-machine.md ├── docfx.json ├── how-to-add-a-provider.md ├── provider-support-rigetti.md ├── zone-pivot-groups.yml ├── how-to-submit-re-jobs.md ├── tutorial-qdk-explore-entanglement.md ├── provider-support-ionq.md ├── qdk-main-overview.md ├── optimization-authenticate-managed-identity.md ├── resource-estimator-quantum-safe-planning.md └── index.yml ├── .acrolinx-config.edn ├── acrolinx-config.edn ├── .devcontainer ├── devcontainer.json └── Dockerfile ├── .vscode ├── extensions.json └── settings.json ├── .gitignore ├── .gitattributes ├── quantum-docs-pr-ci.yml ├── LICENSE-CODE ├── ThirdPartyNotices.md ├── README.md ├── .openpublishing.publish.config.json └── SECURITY.md /.github/actions/status-checker/__tests__/3/three.md: -------------------------------------------------------------------------------- 1 | # THREE 2 | -------------------------------------------------------------------------------- /.github/actions/status-checker/.prettierignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | lib/ 3 | node_modules/ -------------------------------------------------------------------------------- /.github/actions/status-checker/.gitattributes: -------------------------------------------------------------------------------- 1 | dist/** -diff linguist-generated=true -------------------------------------------------------------------------------- /articles/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "qubit" 4 | ] 5 | } -------------------------------------------------------------------------------- /.github/actions/status-checker/src/types/Mode.ts: -------------------------------------------------------------------------------- 1 | export type Mode = "preview" | "warning"; 2 | -------------------------------------------------------------------------------- /.github/actions/status-checker/.eslintignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | lib/ 3 | node_modules/ 4 | jest.config.js 5 | -------------------------------------------------------------------------------- /.acrolinx-config.edn: -------------------------------------------------------------------------------- 1 | {:allowed-branchname-matches ["main"] 2 | :allowed-filename-matches ["articles"]} 3 | -------------------------------------------------------------------------------- /.github/actions/status-checker/src/types/NodeOf.ts: -------------------------------------------------------------------------------- 1 | export type NodeOf = { 2 | readonly node: T; 3 | }; 4 | -------------------------------------------------------------------------------- /articles/media/qrng-H.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/qrng-H.PNG -------------------------------------------------------------------------------- /articles/media/find-subs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/find-subs.png -------------------------------------------------------------------------------- /articles/media/logo-qci.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/logo-qci.png -------------------------------------------------------------------------------- /articles/media/qft_full.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/qft_full.PNG -------------------------------------------------------------------------------- /articles/media/qrng-meas.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/qrng-meas.PNG -------------------------------------------------------------------------------- /articles/media/aq-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/aq-diagram.png -------------------------------------------------------------------------------- /articles/media/logo-ionq2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/logo-ionq2.png -------------------------------------------------------------------------------- /articles/media/logo-pasqal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/logo-pasqal.png -------------------------------------------------------------------------------- /articles/media/noisy-1-25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/noisy-1-25.png -------------------------------------------------------------------------------- /articles/media/noisy-50-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/noisy-50-50.png -------------------------------------------------------------------------------- /articles/media/pencil-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/pencil-edit.png -------------------------------------------------------------------------------- /articles/media/qft_firstH.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/qft_firstH.PNG -------------------------------------------------------------------------------- /articles/media/qrng-Bloch.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/qrng-Bloch.PNG -------------------------------------------------------------------------------- /articles/media/5-qubit-qccc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/5-qubit-qccc.png -------------------------------------------------------------------------------- /articles/media/concepts_bloch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/concepts_bloch.png -------------------------------------------------------------------------------- /articles/media/git-workflow.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/git-workflow.vsdx -------------------------------------------------------------------------------- /articles/media/ionq-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/ionq-results.png -------------------------------------------------------------------------------- /articles/media/launch-vs-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/launch-vs-code.png -------------------------------------------------------------------------------- /articles/media/logo-rigetti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/logo-rigetti.png -------------------------------------------------------------------------------- /articles/media/multi-file-art.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/multi-file-art.png -------------------------------------------------------------------------------- /articles/media/noisy-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/noisy-settings.png -------------------------------------------------------------------------------- /articles/media/plane-grovers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/plane-grovers.png -------------------------------------------------------------------------------- /articles/media/qft_firstqubit.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/qft_firstqubit.PNG -------------------------------------------------------------------------------- /articles/media/run_or_run_all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/run_or_run_all.png -------------------------------------------------------------------------------- /articles/media/starting-state.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/starting-state.png -------------------------------------------------------------------------------- /articles/media/add-contributors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/add-contributors.png -------------------------------------------------------------------------------- /articles/media/codelens-circuit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/codelens-circuit.png -------------------------------------------------------------------------------- /articles/media/histogram-output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/histogram-output.png -------------------------------------------------------------------------------- /articles/media/logo-microsoft2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/logo-microsoft2.png -------------------------------------------------------------------------------- /articles/media/noisy-allocation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/noisy-allocation.png -------------------------------------------------------------------------------- /articles/media/upload-notebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/upload-notebook.png -------------------------------------------------------------------------------- /articles/media/assign-contributors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/assign-contributors.png -------------------------------------------------------------------------------- /articles/media/codelens-histogram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/codelens-histogram.png -------------------------------------------------------------------------------- /articles/media/codelens-run-QRNG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/codelens-run-QRNG.png -------------------------------------------------------------------------------- /articles/media/codelens-run-debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/codelens-run-debug.png -------------------------------------------------------------------------------- /articles/media/grovers-iteration.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/grovers-iteration.PNG -------------------------------------------------------------------------------- /articles/media/noisy-measurement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/noisy-measurement.png -------------------------------------------------------------------------------- /articles/media/portal-quotas-blade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/portal-quotas-blade.png -------------------------------------------------------------------------------- /articles/media/quantinuum-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/quantinuum-results.png -------------------------------------------------------------------------------- /articles/media/reflection-operator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/reflection-operator.png -------------------------------------------------------------------------------- /articles/media/sample-list-vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/sample-list-vscode.png -------------------------------------------------------------------------------- /articles/media/vscode-add-rigetti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/vscode-add-rigetti.png -------------------------------------------------------------------------------- /articles/media/vscode-run-rigetti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/vscode-run-rigetti.png -------------------------------------------------------------------------------- /.github/actions/status-checker/src/types/PageInfo.ts: -------------------------------------------------------------------------------- 1 | export type PageInfo = { 2 | hasNextPage: boolean; 3 | endCursor: string; 4 | }; 5 | -------------------------------------------------------------------------------- /articles/media/add-providers-portal.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/add-providers-portal.PNG -------------------------------------------------------------------------------- /articles/media/azure-portal-job-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/azure-portal-job-list.png -------------------------------------------------------------------------------- /articles/media/bulk-invite-users-CSV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/bulk-invite-users-CSV.png -------------------------------------------------------------------------------- /articles/media/histogram-vscode-qrng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/histogram-vscode-qrng.png -------------------------------------------------------------------------------- /articles/media/portal-credits-blade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/portal-credits-blade.png -------------------------------------------------------------------------------- /articles/media/qdk-agent-tools-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/qdk-agent-tools-list.png -------------------------------------------------------------------------------- /articles/media/qsharp-quickstart-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/qsharp-quickstart-run.png -------------------------------------------------------------------------------- /articles/media/annotated-sample-circuit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/annotated-sample-circuit.png -------------------------------------------------------------------------------- /articles/media/circuit-jupyter-notebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/circuit-jupyter-notebook.png -------------------------------------------------------------------------------- /articles/media/circuit-vscode-randombit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/circuit-vscode-randombit.png -------------------------------------------------------------------------------- /articles/media/codelens-estimate-shorRE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/codelens-estimate-shorRE.png -------------------------------------------------------------------------------- /articles/media/codelens-histogram-QRNG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/codelens-histogram-QRNG.png -------------------------------------------------------------------------------- /articles/media/connection-string-copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/connection-string-copy.png -------------------------------------------------------------------------------- /articles/media/connection-string-enable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/connection-string-enable.png -------------------------------------------------------------------------------- /articles/media/estimate-dropdown-shorRE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/estimate-dropdown-shorRE.png -------------------------------------------------------------------------------- /articles/media/hybrid/cost-estimation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/hybrid/cost-estimation.png -------------------------------------------------------------------------------- /articles/media/qsharp-quickstart-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/qsharp-quickstart-hover.png -------------------------------------------------------------------------------- /acrolinx-config.edn: -------------------------------------------------------------------------------- 1 | {:allowed-branchname-matches ["^master$" "^release..*"] 2 | :allowed-filename-matches ["articles" "includes" "azure-quantum"]} 3 | -------------------------------------------------------------------------------- /articles/media/azure-portal-billing-plans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/azure-portal-billing-plans.png -------------------------------------------------------------------------------- /articles/media/azure-quantum-flow-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/azure-quantum-flow-diagram.png -------------------------------------------------------------------------------- /articles/media/circuit-codelens-operation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/circuit-codelens-operation.png -------------------------------------------------------------------------------- /articles/media/histogram-vscode-qrng-tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/histogram-vscode-qrng-tab.png -------------------------------------------------------------------------------- /articles/media/job-costs/job-cost-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/job-costs/job-cost-details.png -------------------------------------------------------------------------------- /articles/media/quantum-cryptography-qcom.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/quantum-cryptography-qcom.PNG -------------------------------------------------------------------------------- /articles/media/qubit-time-diagram-shorRE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/qubit-time-diagram-shorRE.png -------------------------------------------------------------------------------- /articles/media/azure-portal-sample-gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/azure-portal-sample-gallery.png -------------------------------------------------------------------------------- /articles/media/bulk-invite-users-new-group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/bulk-invite-users-new-group.png -------------------------------------------------------------------------------- /articles/media/connection-string-regenerate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/connection-string-regenerate.png -------------------------------------------------------------------------------- /articles/media/histogram-vscode-entanglement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/histogram-vscode-entanglement.png -------------------------------------------------------------------------------- /articles/media/histogram-vscode-random-bit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/histogram-vscode-random-bit.png -------------------------------------------------------------------------------- /articles/media/manage-workspace-access-scope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/manage-workspace-access-scope.png -------------------------------------------------------------------------------- /articles/media/provider-format-pasqal-array.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/provider-format-pasqal-array.png -------------------------------------------------------------------------------- /articles/media/success-probability-grovers.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/success-probability-grovers.PNG -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "dockerFile": "./Dockerfile", 3 | "extensions": [ 4 | "docsmsft.docs-authoring-pack" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /articles/media/annotated-teleportation-circuit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/annotated-teleportation-circuit.png -------------------------------------------------------------------------------- /articles/media/azure-portal-workspace-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/azure-portal-workspace-overview.png -------------------------------------------------------------------------------- /articles/media/bulk-invite-users-download-csv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/bulk-invite-users-download-csv.png -------------------------------------------------------------------------------- /articles/media/cost-management-invoice-portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/cost-management-invoice-portal.png -------------------------------------------------------------------------------- /articles/media/histogram-vscode-random-bit-tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/histogram-vscode-random-bit-tab.png -------------------------------------------------------------------------------- /articles/media/job-costs/job-table-with-costs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/job-costs/job-table-with-costs.png -------------------------------------------------------------------------------- /articles/media/provider-format-pasqal-sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/provider-format-pasqal-sequence.png -------------------------------------------------------------------------------- /articles/media/vscode-estimates-local-diagram.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/vscode-estimates-local-diagram.PNG -------------------------------------------------------------------------------- /articles/media/azure-quantum-qiskit-hw-result-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/azure-quantum-qiskit-hw-result-1.png -------------------------------------------------------------------------------- /articles/media/azure-quantum-qiskit-hw-result-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/azure-quantum-qiskit-hw-result-2.png -------------------------------------------------------------------------------- /articles/media/azure-quantum-qiskit-ionq-result-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/azure-quantum-qiskit-ionq-result-1.png -------------------------------------------------------------------------------- /articles/media/azure-quantum-qiskit-ionq-result-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/azure-quantum-qiskit-ionq-result-2.png -------------------------------------------------------------------------------- /articles/media/bulk-invite-users-add-assignment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/bulk-invite-users-add-assignment.png -------------------------------------------------------------------------------- /articles/media/bulk-invite-users-add-contributor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/bulk-invite-users-add-contributor.png -------------------------------------------------------------------------------- /articles/media/bulk-invite-users-download-users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/bulk-invite-users-download-users.png -------------------------------------------------------------------------------- /articles/media/bulk-invite-users-new-group-create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/bulk-invite-users-new-group-create.png -------------------------------------------------------------------------------- /articles/media/histogram-vscode-entanglement-tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/histogram-vscode-entanglement-tab.png -------------------------------------------------------------------------------- /articles/media/quantum-workspace-explorer-vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/quantum-workspace-explorer-vscode.png -------------------------------------------------------------------------------- /articles/media/resource-estimator-diagram-jupyter.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/resource-estimator-diagram-jupyter.PNG -------------------------------------------------------------------------------- /articles/media/resource-estimator-stack-computing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/resource-estimator-stack-computing.png -------------------------------------------------------------------------------- /articles/media/resource-estimator-tfactory-plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/resource-estimator-tfactory-plot.png -------------------------------------------------------------------------------- /articles/media/vscode-estimates-local-results-tab.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/vscode-estimates-local-results-tab.PNG -------------------------------------------------------------------------------- /articles/media/vscode-show-azure-quantum-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/vscode-show-azure-quantum-results.png -------------------------------------------------------------------------------- /articles/media/circuits-jupyter-notebook-bellstate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/circuits-jupyter-notebook-bellstate.png -------------------------------------------------------------------------------- /articles/media/Resource-Estimation-component-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/Resource-Estimation-component-overview.png -------------------------------------------------------------------------------- /articles/media/azure-quantum-qiskit-rigetti-qvm-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/azure-quantum-qiskit-rigetti-qvm-result.png -------------------------------------------------------------------------------- /articles/media/azure-quantum-qiskit-rigetti-result-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/azure-quantum-qiskit-rigetti-result-1.png -------------------------------------------------------------------------------- /articles/media/azure-quantum-qiskit-rigetti-result-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/azure-quantum-qiskit-rigetti-result-2.png -------------------------------------------------------------------------------- /articles/media/bulk-invite-users-add-group-contributor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/bulk-invite-users-add-group-contributor.png -------------------------------------------------------------------------------- /articles/media/bulk-invite-users-upload-csv-successful.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/bulk-invite-users-upload-csv-successful.png -------------------------------------------------------------------------------- /articles/media/multiple-configurations-frontier-shorRE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/multiple-configurations-frontier-shorRE.png -------------------------------------------------------------------------------- /articles/media/resource-estimator-space-diagram-qiskit.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/resource-estimator-space-diagram-qiskit.PNG -------------------------------------------------------------------------------- /articles/media/vscode-estimates-local-diagram-shorRE.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/vscode-estimates-local-diagram-shorRE.PNG -------------------------------------------------------------------------------- /articles/media/vscode-estimates-local-diagram-space-time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/vscode-estimates-local-diagram-space-time.png -------------------------------------------------------------------------------- /articles/media/vscode-estimates-local-results-tab-shorRE.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/vscode-estimates-local-results-tab-shorRE.PNG -------------------------------------------------------------------------------- /articles/media/bulk-invite-users-CSV-user-principal-names.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/bulk-invite-users-CSV-user-principal-names.png -------------------------------------------------------------------------------- /articles/media/bulk-invite-users-assign-group-contributor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/bulk-invite-users-assign-group-contributor.png -------------------------------------------------------------------------------- /articles/media/qubit-time-frontier-multiple-config-shorRE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/qubit-time-frontier-multiple-config-shorRE.png -------------------------------------------------------------------------------- /.github/actions/status-checker/src/types/ChangeType.ts: -------------------------------------------------------------------------------- 1 | export type ChangeType = 2 | | "ADDED" 3 | | "CHANGED" 4 | | "COPIED" 5 | | "DELETED" 6 | | "MODIFIED" 7 | | "RENAMED"; 8 | -------------------------------------------------------------------------------- /articles/media/qubit-time-frontier-estimation-jupyter-shorRE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/qubit-time-frontier-estimation-jupyter-shorRE.png -------------------------------------------------------------------------------- /articles/media/how-to-run-notebooks-workspace/create-new-notebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/how-to-run-notebooks-workspace/create-new-notebook.png -------------------------------------------------------------------------------- /articles/media/how-to-run-notebooks-workspace/notebook-context-pane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/how-to-run-notebooks-workspace/notebook-context-pane.png -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/powershell:lts-debian-buster-slim 2 | 3 | RUN apt-get -y update && \ 4 | apt-get -y install git && \ 5 | apt-get clean && rm -rf /var/lib/apt/lists/ 6 | -------------------------------------------------------------------------------- /.github/actions/status-checker/src/types/PullRequestState.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * See https://docs.github.com/graphql/reference/enums#pullrequeststate 3 | */ 4 | export type PullRequestState = "CLOSED" | "MERGED" | "OPEN"; 5 | -------------------------------------------------------------------------------- /articles/media/how-to-publish-qio-job-as-azurefunction/prepare-cloud-env-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/how-to-publish-qio-job-as-azurefunction/prepare-cloud-env-3.png -------------------------------------------------------------------------------- /articles/media/how-to-run-notebooks-workspace/new-python-notebook-snippet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/quantum-docs/HEAD/articles/media/how-to-run-notebooks-workspace/new-python-notebook-snippet.png -------------------------------------------------------------------------------- /.github/actions/status-checker/src/types/PullRequestDetails.ts: -------------------------------------------------------------------------------- 1 | import { Pull } from "./Pull"; 2 | 3 | export type PullRequestDetails = { 4 | readonly repository: { 5 | readonly pullRequest: Pull; 6 | }; 7 | }; 8 | -------------------------------------------------------------------------------- /articles/user-guide/language/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Program structure 2 | href: programstructure/toc.yml 3 | - name: Statements 4 | href: statements/toc.yml 5 | - name: Expressions 6 | href: expressions/toc.yml 7 | - name: Type system 8 | href: typesystem/toc.yml 9 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | // Suggest that users have the MS Docs Authoring Pack, which provides 4 | // a number of tools for working with DocFX-based documentation repos. 5 | "docsmsft.docs-authoring-pack" 6 | ] 7 | } -------------------------------------------------------------------------------- /.github/actions/status-checker/src/types/FileChange.ts: -------------------------------------------------------------------------------- 1 | import { ChangeType } from "./ChangeType"; 2 | 3 | export type FileChange = { 4 | readonly additions: number; 5 | readonly changeType: ChangeType; 6 | readonly deletions: number; 7 | readonly path: string; 8 | }; 9 | -------------------------------------------------------------------------------- /articles/breadcrumb/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Azure 2 | tocHref: /azure/ 3 | topicHref: /azure/index 4 | items: 5 | - name: Quantum 6 | tocHref: /azure/quantum/ 7 | topicHref: /azure/quantum/index 8 | - name: Quantum 9 | tocHref: /azure/architecture/ 10 | topicHref: /quantum/index 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | log/ 2 | obj/ 3 | _site/ 4 | .optemp/ 5 | _themes*/ 6 | _repo.*/ 7 | 8 | tex2pdf.*/ 9 | 10 | .openpublishing.buildcore.ps1 11 | 12 | *.orig 13 | .vs/ 14 | .DS_Store 15 | azure-quantum/samples/shipping-sample/.ipynb_checkpoints/* 16 | azure-quantum/samples/job-shop-sample/.ipynb_checkpoints/* 17 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | *.sh text eol=lf 6 | *.sh.v.template text eol=lf 7 | 8 | -------------------------------------------------------------------------------- /.github/actions/status-checker/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | clearMocks: true, 3 | moduleFileExtensions: ['js', 'ts'], 4 | testEnvironment: 'node', 5 | testMatch: ['**/*.test.ts'], 6 | testRunner: 'jest-circus/runner', 7 | transform: { 8 | '^.+\\.ts$': 'ts-jest' 9 | }, 10 | verbose: true 11 | } -------------------------------------------------------------------------------- /articles/user-guide/language/Statements/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Statements in Q# 2 | href: index.md 3 | - name: Binding scopes 4 | href: bindingscopes.md 5 | - name: Variable declaration and reassignment 6 | href: variabledeclarationsandreassignments.md 7 | - name: Quantum memory management 8 | href: quantummemorymanagement.md 9 | -------------------------------------------------------------------------------- /.github/actions/status-checker/src/wait.ts: -------------------------------------------------------------------------------- 1 | export async function wait(milliseconds: number): Promise { 2 | return new Promise((resolve) => { 3 | if (isNaN(milliseconds)) { 4 | throw new Error("milliseconds not a number"); 5 | } 6 | 7 | setTimeout(() => resolve("done!"), milliseconds); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/azure-quantum-documentation-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Azure Quantum documentation issue 3 | about: Use this template to report Azure Quantum documentation issues and suggestions 4 | title: Enter a descriptive title for your issue or suggestion 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | We appreciate your feedback, thank you! 11 | Describe your issue or suggestion here. 12 | -------------------------------------------------------------------------------- /articles/user-guide/language/ProgramStructure/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Program implementation 2 | href: index.md 3 | - name: Namespaces 4 | href: namespaces.md 5 | - name: Type declarations 6 | href: typedeclarations.md 7 | - name: Callable declarations 8 | href: callabledeclarations.md 9 | - name: Specialization declarations 10 | href: specializationdeclarations.md 11 | - name: Comments 12 | href: comments.md 13 | -------------------------------------------------------------------------------- /.github/actions/status-checker/src/types/Pull.ts: -------------------------------------------------------------------------------- 1 | import { FileChange } from "./FileChange"; 2 | import { NodeOf } from "./NodeOf"; 3 | import { PageInfo } from "./PageInfo"; 4 | import { PullRequestState } from "./PullRequestState"; 5 | 6 | export type Pull = { 7 | readonly body: string; 8 | readonly checksUrl: string; 9 | readonly changedFiles: number; 10 | readonly state: PullRequestState; 11 | readonly files: { 12 | readonly pageInfo: PageInfo; 13 | readonly edges: NodeOf[]; 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /.github/workflows/check-for-build-warnings.yml: -------------------------------------------------------------------------------- 1 | name: Check for build warnings 2 | on: [pull_request_target] 3 | jobs: 4 | status_checker_job: 5 | runs-on: ubuntu-latest 6 | name: Checks the OpenPublishing.Build status check for build warnings 7 | 8 | steps: 9 | - name: Harden Runner 10 | uses: step-security/harden-runner@main 11 | with: 12 | egress-policy: audit 13 | - uses: MicrosoftDocs/quantum-docs-private/.github/actions/status-checker@main 14 | with: 15 | repo_token: ${{ secrets.GITHUB_TOKEN }} 16 | -------------------------------------------------------------------------------- /articles/user-guide/language/TypeSystem/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Type system in Q# 2 | href: index.md 3 | - name: Quantum data types 4 | href: quantumdatatypes.md 5 | - name: Immutability 6 | href: immutability.md 7 | - name: Operations and functions 8 | href: operationsandfunctions.md 9 | - name: Singleton tuple equivalence 10 | href: singletontupleequivalence.md 11 | - name: Subtyping and variance 12 | href: subtypingandvariance.md 13 | - name: Type parameterizations 14 | href: typeparameterizations.md 15 | - name: Type inference 16 | href: typeinference.md 17 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "markdownlint.config": { 3 | "default": true, 4 | // Use #-style section headings without the ending # marks, as that can 5 | // cause problems working with the Samples Browser. 6 | "MD003": {"style": "atx"}, 7 | "MD013": false 8 | }, 9 | "cSpell.words": [ 10 | "CNOT", 11 | "Hadamard", 12 | "kraus", 13 | "mathrel", 14 | "matplotlib", 15 | "numpy", 16 | "pyplot", 17 | "qsharp", 18 | "qubit", 19 | "qubits", 20 | "Quickstart", 21 | "qutip" 22 | ], 23 | "npm.fetchOnlinePackageInfo": true 24 | } -------------------------------------------------------------------------------- /.github/workflows/broken-links-quantum-docs.yml: -------------------------------------------------------------------------------- 1 | name: Broken links scan of quantum-docs 2 | on: 3 | push: 4 | branches: 5 | - live 6 | workflow_dispatch: 7 | 8 | jobs: 9 | build: 10 | 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Run broken link scanner 16 | run: | 17 | $urls = (Get-ChildItem -include *.md, *.yml -Attributes !Directory -Path ./ -Recurse | ? { $_.FullName -inotmatch 'language' }) 18 | .\.github\scripts\Verify-Links.ps1 -urls $urls -recursive $false -rootUrl https://learn.microsoft.com -ignoreLinksFile .\.github\scripts\ignorelinks.txt 19 | 20 | shell: pwsh 21 | -------------------------------------------------------------------------------- /.github/actions/status-checker/__tests__/main.test.ts: -------------------------------------------------------------------------------- 1 | import { wait } from "../src/wait"; 2 | import { describe, expect, it } from "@jest/globals"; 3 | 4 | describe("status-checker", () => { 5 | it("throws invalid number when given 'foo' string", async () => { 6 | const input = parseInt("foo", 10); 7 | await expect(wait(input)).rejects.toThrow("milliseconds not a number"); 8 | }); 9 | 10 | it("call to 'wait' actually waits 500 ms", async () => { 11 | const start = new Date(); 12 | await wait(500); 13 | const end = new Date(); 14 | var delta = Math.abs(end.getTime() - start.getTime()); 15 | expect(delta).toBeGreaterThan(450); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /articles/includes/copilot-banner.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | ms.author: quantumdocwriters 4 | ms.service: azure-quantum 5 | ms.subservice: core 6 | ms.topic: include 7 | ms.date: 09/10/2024 8 | --- 9 | 10 | > [!TIP] 11 | > If you want to accelerate your quantum computing journey, check out [Code with Azure Quantum](https://quantum.microsoft.com/tools/quantum-coding), a unique feature of the [Microsoft Quantum website](https://quantum.microsoft.com/). Here, you can run built-in Q# samples or your own Q# programs, generate new Q# code from your prompts, open and run your code in [VS Code for the Web](https://vscode.dev/quantum) with one click, and ask Copilot questions about quantum computing. 12 | -------------------------------------------------------------------------------- /.github/actions/status-checker/__tests__/file-heading-extractor.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, it } from "@jest/globals"; 2 | import { getHeadingTextFrom } from "../src/file-heading-extractor"; 3 | 4 | beforeAll(() => { 5 | process.env["GITHUB_REPOSITORY"] = "dotnet/docs"; 6 | }); 7 | 8 | describe("file-heading-extractor", () => { 9 | it("when calling getHeadingTextFrom correctly returns H1 value.", async () => { 10 | const path = "__tests__/sample.md"; 11 | const actual = await getHeadingTextFrom(path); 12 | expect(actual).toBe("The heading `System.Console` class"); 13 | }); 14 | 15 | it("when calling getHeadingTextFrom correctly returns title value.", async () => { 16 | const path = "__tests__/no-heading.md"; 17 | const actual = await getHeadingTextFrom(path); 18 | expect(actual).toBe("Phew, that worked!"); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /.github/workflows/broken-links-MSLearn.yml: -------------------------------------------------------------------------------- 1 | name: Broken links scan of MS Learn quantum 2 | on: 3 | schedule: 4 | - cron: '23 6 * * 1,3,5' 5 | workflow_dispatch: 6 | 7 | jobs: 8 | build: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout local repo 14 | uses: actions/checkout@v2 15 | with: 16 | path: main 17 | - name: Checkout learn repo 18 | uses: actions/checkout@v2 19 | with: 20 | repository: MicrosoftDocs/learn-pr 21 | token: ${{ secrets.ACCESS_TOKEN }} 22 | path: learn-pr 23 | - name: Run broken link scanner 24 | run: | 25 | $urls = (Get-ChildItem -include *.md, *.yml -Attributes !Directory -Path ./learn-pr/learn-pr/quantum -Recurse) 26 | .\main\.github\scripts\Verify-Links.ps1 -urls $urls -rootUrl https://learn.microsoft.com -recursive $false -ignoreLinksFile .\main\.github\scripts\ignorelinks.txt 27 | 28 | shell: pwsh 29 | -------------------------------------------------------------------------------- /articles/contributing-overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn how to contribute to the Quantum Development Kit (QDK) and the quantum development community. 4 | ms.author: quantumdocwriters 5 | ms.date: 09/16/2024 6 | ms.service: azure-quantum 7 | ms.subservice: qdk 8 | ms.topic: concept-article 9 | no-loc: ['Q#', '$$v'] 10 | title: Contributing to the Quantum Development Kit 11 | uid: microsoft.quantum.contributing-qdk.overview 12 | --- 13 | 14 | # Contributing to the Azure Quantum Development Kit 15 | 16 | Thanks for being a part of the Azure Quantum community, we're excited for your contributions! 17 | 18 | - If you'd like to contribute code to the Azure Quantum Development Kit or report a bug, see [Contributing to Q#](https://github.com/microsoft/qdk/blob/main/CONTRIBUTING.md). 19 | - If you'd like to contribute documentation to the Azure Quantum Development Kit, see [How to contribute documentation](/contribute/content/how-to-write-overview). 20 | -------------------------------------------------------------------------------- /.github/scripts/ignorelinks.txt: -------------------------------------------------------------------------------- 1 | https://ionq.com/best-practices 2 | https://github.com/MicrosoftDocs/azure-reference-other-pr/blob/master/.openpublishing.redirection.json 3 | https://github.com/MicrosoftDocs/quantum-docs-private/tree/main/articles/user-guide/language 4 | https://github.com/MicrosoftDocs/quantum-docs-private/blob/quantum-docs-scan/.github/scripts/Verify-Links.ps1 5 | https://github.com/MicrosoftDocs/quantum-docs-private/blob/quantum-docs-scan/.github/workflows/broken-links-quantum-docs.yml 6 | https://github.com/MicrosoftDocs/quantum-docs-private/blob/main/.github/workflows/broken-links-MSLearn.yml 7 | https://github.com/MicrosoftDocs/quantum-docs-private/blob/quantum-docs-scan/.github/scripts/ignorelinks.txt 8 | https://docs.microsoft.com/azure/quantum/old-article 9 | https://docs.microsoft.com/azure/quantum/new-article 10 | https://learn.microsoft.com/azure/quantum/old-article 11 | https://learn.microsoft.com/azure/quantum/new-article 12 | https://msft-quant-edu-prod.azurewebsites.net/& -------------------------------------------------------------------------------- /.github/actions/status-checker/src/main.ts: -------------------------------------------------------------------------------- 1 | import { wait } from "./wait"; 2 | import { isSuccessStatus } from "./status-checker"; 3 | import { setFailed } from "@actions/core"; 4 | import { tryUpdatePullRequestBody } from "./pull-updater"; 5 | import { workflowInput } from "./types/WorkflowInput"; 6 | 7 | async function run(): Promise { 8 | try { 9 | const token: string = workflowInput.repoToken; 10 | 11 | // Wait 60 seconds before checking status check result. 12 | await wait(60000); 13 | console.log("Waited 60 seconds."); 14 | 15 | // When the status is passed, try to update the PR body. 16 | const isSuccess = await isSuccessStatus(token); 17 | if (isSuccess) { 18 | console.log("✅ Build status is good..."); 19 | } else { 20 | console.log("❌ Build status has warnings or errors!"); 21 | } 22 | if (workflowInput.mode === "preview") { 23 | await tryUpdatePullRequestBody(token); 24 | } 25 | } catch (error: unknown) { 26 | const e = error as Error; 27 | setFailed(e.message); 28 | } 29 | } 30 | 31 | run(); 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Azure Quantum technical support issues 4 | url: https://ms.portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/newsupportrequest 5 | about: Request technical support for Azure Quantum issues here. 6 | - name: Azure Quantum technical Q&A 7 | url: https://learn.microsoft.com/answers/topics/azure-quantum.html 8 | about: Post a technical question to the Azure Quantum community. 9 | - name: Azure Quantum feature requests 10 | url: https://feedback.azure.com/d365community/forum/8616edd6-9f3b-ec11-8c62-00224825a012 11 | about: Use the feedback forum to request new features for Azure Quantum 12 | - name: Q# programming language issues 13 | url: https://github.com/microsoft/qsharp-language/issues/new/choose 14 | about: Post an issue about the Q# programming language here. 15 | - name: Quantum Development Kit (QDK) issues 16 | url: https://github.com/microsoft/qsharp-runtime/issues/new/choose 17 | about: Post an issue about the QDK runtime library here. 18 | -------------------------------------------------------------------------------- /quantum-docs-pr-ci.yml: -------------------------------------------------------------------------------- 1 | schedules: 2 | - cron: "0 17 * * 1-5" 3 | displayName: "Scheduled run at 10 AM PT on weekdays" 4 | branches: 5 | include: 6 | - main 7 | always: false # This ensures the pipeline only runs if there have been changes since the last successful run. 8 | 9 | - cron: "0 22 * * 1-5" 10 | displayName: "Afternoon run at 3:00 PM PT M-F" 11 | branches: 12 | include: 13 | - main 14 | always: false 15 | 16 | trigger: 17 | - main 18 | 19 | jobs: 20 | - job: MergeMainToLive 21 | pool: 22 | vmImage: 'ubuntu-latest' 23 | steps: 24 | - checkout: self 25 | persistCredentials: true 26 | - script: | 27 | git config --global user.name "Ted Hudek" 28 | git config --global user.email "tedhudek@users.noreply.github.com" 29 | git checkout main 30 | git checkout live 31 | git merge main --no-ff --no-commit 32 | if [ $? -eq 0 ]; then 33 | git commit -m "Merged main into live" 34 | git push origin live 35 | else 36 | echo "Error merging main to live" 37 | exit 1 38 | fi 39 | displayName: 'Merge main to live if main has changed' -------------------------------------------------------------------------------- /.github/actions/status-checker/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ 4 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ 5 | "outDir": "./lib", /* Redirect output structure to the directory. */ 6 | "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 7 | "strict": true, /* Enable all strict type-checking options. */ 8 | "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 9 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 10 | }, 11 | "exclude": ["node_modules", "**/*.test.ts"] 12 | } 13 | -------------------------------------------------------------------------------- /LICENSE-CODE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) Microsoft Corporation 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 5 | associated documentation files (the "Software"), to deal in the Software without restriction, 6 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all copies or substantial 11 | portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 14 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /articles/user-guide/language/TypeSystem/singletontupleequivalence.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about singleton tuple equivalence in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/01/2021 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Singleton tuple equivalence in Q# 11 | uid: microsoft.quantum.qsharp.singletontupleequivalence 12 | --- 13 | 14 | # Singleton tuple equivalence 15 | 16 | To avoid any ambiguity between tuples and parentheses that group sub-expressions, a tuple with a single element is considered to be equivalent to the contained item, including its type. For example, the types `Int`, `(Int)`, and `((Int))` are treated as being identical. The same holds true for the values `5`, `(5)` and `(((5)))`, or for `(5, (6))` and `(5, 6)`. This equivalence applies for all purposes, including assignment. Since there is no dynamic dispatch or reflection in Q# and all types in Q# are resolvable at compile-time, singleton tuple equivalence can be readily implemented during compilation. 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/logicalexpressions.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about logical operators in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/01/2021 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Logical operators in Q# 11 | uid: microsoft.quantum.qsharp.logicalexpressions 12 | --- 13 | 14 | # Logical expressions 15 | 16 | Logical operators are expressed as keywords. 17 | Q# supports the standard logical operators *AND* (`and`), *OR* (`or`), and *NOT* (`not`). Currently, there is not an operator for a logical *XOR*. All of these operators act on operands of type `Bool`, and result in an expression of type `Bool`. 18 | As is common in most languages, the evaluation of *AND* and *OR* short-circuits, meaning if the first expression of *OR* evaluates to `true`, the second expression is not evaluated, and the same holds if the first expression of *AND* evaluates to `false`. The behavior of conditional expressions in a sense is similar, in that only ever the condition and one of the two expressions is evaluated. 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /.github/actions/status-checker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-action", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "TypeScript template action", 6 | "main": "lib/main.js", 7 | "scripts": { 8 | "build": "tsc", 9 | "format": "prettier --write **/*.ts", 10 | "format-check": "prettier --check **/*.ts", 11 | "package": "ncc build --source-map --license licenses.txt", 12 | "test": "jest --detectOpenHandles", 13 | "all": "npm run build && npm run format && npm run package && npm test" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/actions/typescript-action.git" 18 | }, 19 | "keywords": [ 20 | "actions", 21 | "node", 22 | "setup" 23 | ], 24 | "author": "", 25 | "license": "MIT", 26 | "dependencies": { 27 | "@actions/core": "^1.10.0", 28 | "@actions/github": "^5.1.1" 29 | }, 30 | "devDependencies": { 31 | "@types/jest": "^29.2.6", 32 | "@types/node": "^18.11.18", 33 | "@vercel/ncc": "^0.36.0", 34 | "jest": "^29.3.1", 35 | "jest-circus": "^29.3.1", 36 | "js-yaml": "^4.1.0", 37 | "prettier": "^2.8.3", 38 | "ts-jest": "^29.0.5", 39 | "typescript": "^4.9.4" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/concatenation.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about concatenation expressions in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/18/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Concatenation expressions in Q# 11 | uid: microsoft.quantum.qsharp.concatenationexpressions 12 | --- 13 | 14 | # Concatenation 15 | 16 | Concatenations are supported for values of type `String` and arrays. In both cases, they're expressed via the operator `+`. For instance, `"Hello " + "world!"` evaluates to `"Hello world!"`, and `[1, 2, 3] + [4, 5, 6]` evaluates to `[1, 2, 3, 4, 5, 6]`. 17 | 18 | Concatenating two arrays requires that both arrays be of the same type. This requirement differs from constructing an [array literal](xref:microsoft.quantum.qsharp.valueliterals#array-literals) where the compiler determines a common base type for all array items. This difference is because arrays are treated as [invariant](xref:microsoft.quantum.qsharp.subtypingandvariance#subtyping-and-variance). The type of the entire expression matches the type of the operands. 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ThirdPartyNotices.md: -------------------------------------------------------------------------------- 1 | ## Legal Notices 2 | Microsoft and any contributors grant you a license to the Microsoft documentation and other content 3 | in this repository under the [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/legalcode), 4 | see the [LICENSE](LICENSE) file, and grant you a license to any code in the repository under the [MIT License](https://opensource.org/licenses/MIT), see the 5 | [LICENSE-CODE](LICENSE-CODE) file. 6 | 7 | Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation 8 | may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. 9 | The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. 10 | You can find Microsoft general trademark guidelines at [Microsoft Trademark and Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks). 11 | 12 | For privacy information, see [privacy at Microsoft](https://privacy.microsoft.com/en-us/). 13 | 14 | Microsoft and any contributors reserve all others rights, whether under their respective copyrights, patents, 15 | or trademarks, whether by implication, estoppel or otherwise. 16 | -------------------------------------------------------------------------------- /articles/supported-macros.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Supported LaTeX macros for authoring 3 | description: List of all supported LaTeX macros for formulas used in the Microsoft Quantum Development Kit documentation. 4 | author: azure-quantum-content 5 | ms.author: quantumdocwriters 6 | ms.date: 03/18/2025 7 | ms.topic: concept-article 8 | uid: microsoft.quantum.contribute.macros 9 | no-loc: ['Q#', '$$v', Quantum Development Kit] 10 | --- 11 | 12 | # Supported Macros 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
Macro NameSyntaxResults
ket\ket{\psi}$\ket{\psi}$
bra\bra{\phi}$\bra{\phi}$
braket\braket{\phi|\psi}$\braket{\phi|\psi}$
id\id$\id$
boldone\boldone$\mathbf{1}$
expect\expect$\expect$
variance\variance (x)$\variance (x)$
24 | 25 | - [All](xref:Qdk.Std.Arrays.All) function (API) 26 | - [Math](xref:Qdk.Std.Arithmetic.ApplyIfEqualL) new API 27 | - [Workspace](xref:azure.quantum.Workspace) Python class (azure-quantum) 28 | - [Pauli](xref:qsharp.Pauli) Python function (qsharp) 29 | -------------------------------------------------------------------------------- /articles/includes/qiskit-qml-sample.py: -------------------------------------------------------------------------------- 1 | from qiskit.algorithms.optimizers import COBYLA 2 | from qiskit.circuit.library import TwoLocal, ZZFeatureMap 3 | from qiskit.utils import algorithm_globals 4 | 5 | from qiskit_machine_learning.algorithms import VQC 6 | from qiskit_machine_learning.datasets import ad_hoc_data 7 | 8 | seed = 1376 9 | algorithm_globals.random_seed = seed 10 | 11 | # Use ad hoc data set for training and test data 12 | feature_dim = 2 # dimension of each data point 13 | training_size = 20 14 | test_size = 10 15 | 16 | # training features, training labels, test features, test labels as np.ndarray, 17 | # one hot encoding for labels 18 | training_features, training_labels, test_features, test_labels = ad_hoc_data( 19 | training_size=training_size, test_size=test_size, n=feature_dim, gap=0.3 20 | ) 21 | 22 | feature_map = ZZFeatureMap(feature_dimension=feature_dim, reps=2, entanglement="linear") 23 | ansatz = TwoLocal(feature_map.num_qubits, ["ry", "rz"], "cz", reps=3) 24 | vqc = VQC( 25 | feature_map=feature_map, 26 | ansatz=ansatz, 27 | optimizer=COBYLA(maxiter=100), 28 | quantum_instance=QuantumInstance(backend), 29 | ) 30 | vqc.fit(training_features, training_labels) 31 | 32 | score = vqc.score(test_features, test_labels) 33 | print(f"Testing accuracy: {score:0.2f}") -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/bitwiseexpressions.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about bitwise expressions and operators in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/14/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Bitwise expressions in Q# 11 | uid: microsoft.quantum.qsharp.bitwiseexpressions 12 | --- 13 | # Bitwise expressions 14 | 15 | Bitwise operators are expressed as three non-letter characters. In addition to bitwise versions for *AND* (`&&&`), *OR* (`|||`), and *NOT* (`~~~`), a bitwise *XOR* (`^^^`) exists as well. They expect operands of type `Int` or `BigInt`, and for binary operators, the type of both operands has to match. The type of the entire expression equals the type of the operands. 16 | 17 | Additionally, left- and right-shift operators (`<<<` and `>>>` respectively) exist, multiplying or dividing the given left-hand-side (lhs) expression by powers of two. The expression `lhs <<< 3` shifts the bit representation of `lhs` by three, meaning `lhs` is multiplied by `2^3`, provided that is still within the valid range for the data type of `lhs`. The lhs may be of type `Int` or `BigInt`. The right-hand-side expression always has to be of type `Int`. The resulting expression is of the same type as the lhs operand. 18 | 19 | 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Azure Quantum documentation 2 | 3 | Welcome to Azure Quantum! This is the repository for the Azure Quantum documentation. 4 | 5 | This repository contains open-source documentation articles. The main folder is **[articles/](./articles)** and contains the Markdown articles and YAML files that constitute the source of the [Azure Quantum documentation](https://learn.microsoft.com/azure/quantum/). 6 | 7 | > :pencil: If your changes are only editorial, without association to the API, this is the right place to do it. You can directly edit 8 | > the `*.md` files here. You can also submit minor changes directly through the documentation page. For more information, see [Minor changes to documentation](https://learn.microsoft.com/contribute/content/how-to-write-overview#minor-changes-to-documentation)). 9 | 10 | ## Getting started 11 | If you are new to the Azure Quantum documentation and want to learn how to contribute, you can follow our [Contributors Guide](https://learn.microsoft.com/azure/quantum/contributing-overview). 12 | 13 | ## Microsoft Open Source Code of Conduct 14 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 15 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 16 | -------------------------------------------------------------------------------- /articles/release-notes.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Release notes for QDK and Azure Quantum - latest version 3 | description: Learn about the latest updates to the Microsoft Quantum Development Kit (QDK) and Azure Quantum. 4 | ms.date: 09/13/2024 5 | author: azure-quantum-content 6 | ms.author: quantumdocwriters 7 | ms.service: azure-quantum 8 | ms.subservice: qdk 9 | ms.topic: release-notes 10 | no-loc: ['Q#', '$$v', Quantum Development Kit, Quantum machine learning, Quantum Intermediate Representation, Basic measurement feedback, target, targets] 11 | uid: microsoft.quantum.relnotes 12 | --- 13 | 14 | # Release notes for the Quantum Development Kit (QDK) and Azure Quantum 15 | 16 | The release notes outline updates to the [Quantum Development Kit (QDK)](xref:microsoft.quantum.install-qdk.overview) and the [Azure Quantum service](xref:microsoft.quantum.azure-quantum-overview). 17 | 18 | For 'getting started' instructions, see [Set up Azure Quantum](xref:microsoft.quantum.install-qdk.overview). For instructions on how to update your QDK to the latest version, see [Update the Quantum Development Kit (QDK) to the latest version](xref:microsoft.quantum.update-qdk). 19 | 20 | - For the latest QDK and Azure Quantum release notes, see the [GitHub qsharp repository](https://github.com/microsoft/qdk/releases). 21 | - For the latest azure-quantum Python package release notes, see the [GitHub azure-quantum-python repository](https://github.com/microsoft/azure-quantum-python/releases). 22 | -------------------------------------------------------------------------------- /.github/actions/status-checker/README.md: -------------------------------------------------------------------------------- 1 | # Status checker GitHub Action 2 | 3 | This action checks for Open Publishing Build system build warnings.:rocket: 4 | 5 | Whether or not there are build warnings, you'll see a status check for this action in your pull request. If it passes, it means it ran without error and there are not build warnings or errors. If it fails, it means there are build warnings or errors, or there's a bug in this action. 6 | 7 | ## Usage 8 | 9 | Add a new YAML file to your repo in the *.github/workflows* folder. The only required input is the GitHub OAuth token. 10 | 11 | For example, the following YAML example calls this status-checker Action. 12 | 13 | ```yml 14 | on: [pull_request_target] 15 | 16 | jobs: 17 | status_checker_job: 18 | runs-on: ubuntu-latest 19 | name: Checks the OpenPublishing.Build status check for build warnings 20 | steps: 21 | - uses: dotnet/samples/.github/actions/status-checker@main 22 | with: 23 | repo-token: ${{ secrets.GITHUB_TOKEN }} 24 | ``` 25 | 26 | Note: Use the `pull_request_target` event instead of the `pull_request` event as the trigger. The `pull_request_target` event runs against the workflow and code from the *base* of the pull request instead of from the merge commit. For more information, see [Improvements for public repository forks](https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/#improvements-for-public-repository-forks). 27 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Expressions in Q# 2 | href: index.md 3 | - name: Precedence and associativity 4 | href: precedenceandassociativity.md 5 | - name: Operators 6 | items: 7 | - name: Copy-and-update expressions 8 | href: copyandupdateexpressions.md 9 | - name: Conditional expressions 10 | href: conditionalexpressions.md 11 | - name: Comparative expressions 12 | href: comparativeexpressions.md 13 | - name: Logical expressions 14 | href: logicalexpressions.md 15 | - name: Bitwise expressions 16 | href: bitwiseexpressions.md 17 | - name: Arithmetic expressions 18 | href: arithmeticexpressions.md 19 | - name: Concatenations 20 | href: concatenation.md 21 | - name: Modifiers and combinators 22 | items: 23 | - name: Functor application 24 | href: functorapplication.md 25 | - name: Item access expressions 26 | href: itemaccessexpressions.md 27 | - name: Call expressions 28 | href: callstatements.md 29 | - name: Returns and termination 30 | href: returnsandtermination.md 31 | - name: Iterations 32 | href: iterations.md 33 | - name: Conditional loops 34 | href: conditionalloops.md 35 | - name: Conditional branching 36 | href: conditionalbranching.md 37 | - name: Conjugations 38 | href: conjugations.md 39 | - name: Closures 40 | href: closures.md 41 | - name: Contextual expressions 42 | href: contextualexpressions.md 43 | - name: Value literals and default values 44 | href: valueliterals.md 45 | -------------------------------------------------------------------------------- /.github/actions/status-checker/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Status check checker' 2 | description: "Checks the OpenPublishing.Build's status check's description to see if there are build warnings, and adds a new status check with a state of failure if build warnings are present." 3 | author: 'Genevieve Warren' 4 | inputs: 5 | repo_token: 6 | description: 'The GITHUB_TOKEN secret. Requires the following permissions: statuses: write, issues: write, pull-requests: write.' 7 | required: true 8 | mode: 9 | description: 'The mode to run the action in. Use "preview" to create a status check with a preview table of the changes. Use "warnings" will fail on warnings.' 10 | default: 'preview' 11 | docs_path: 12 | description: 'The path to the docs folder, such as; "docs" for the .NET docs repo.' 13 | default: 'docs' 14 | url_base_path: 15 | description: 'The URL base path for the docs repo, for example; "dotnet" for the .NET docs repo.' 16 | default: 'dotnet' 17 | collapsible_after: 18 | description: 'The number at which the automated preview table defaults as collapsed but expandable, using the HTML summary and details elements.' 19 | default: '10' 20 | max_row_count: 21 | description: 'The maximum number of rows to display in the automated preview table.' 22 | default: '30' 23 | opaque_leading_url_segments: 24 | description: 'A (comma separated) string array of leading URL segments to exclude when creating preview links.' 25 | runs: 26 | using: 'node16' 27 | main: 'dist/index.js' 28 | -------------------------------------------------------------------------------- /articles/quickstart-microsoft-qiskit.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn how to submit Qiskit quantum circuits to the Azure Quantum service. 4 | ms.author: quantumdocwriters 5 | ms.date: 10/17/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qdk 8 | ms.topic: how-to 9 | no-loc: ['Python', '$$v', target, targets] 10 | title: Submit Qiskit quantum circuits to Azure Quantum 11 | zone_pivot_groups: ide-local-simulator 12 | uid: microsoft.quantum.quickstarts.computing.qiskit 13 | --- 14 | 15 | # How to submit a circuit with Qiskit to Azure Quantum 16 | 17 | Learn how to submit a Qiskit quantum circuit using the `azure-quantum` Python package. You can submit Qiskit circuits to Azure Quantum using the Azure Quantum Development Kit (QDK) and Jupyter Notebook in Visual Studio Code (VS Code). You can also test your circuits using the local sparse simulator. 18 | 19 | For more information, see [Quantum circuits](xref:microsoft.quantum.concepts.circuits). 20 | 21 | ::: zone pivot="platform-local" 22 | 23 | [!INCLUDE [local-procedure](includes/quickstart-qiskit-include-local.md)] 24 | 25 | ::: zone-end 26 | 27 | ::: zone pivot="platform-simulator" 28 | 29 | [!INCLUDE [local-simulator-procedure](includes/quickstart-qiskit-include-simulator.md)] 30 | 31 | ::: zone-end 32 | 33 | ## Next steps 34 | 35 | - [Quickstart: Submit a circuit with Cirq to Azure Quantum](xref:microsoft.quantum.quickstarts.computing.cirq). 36 | - [Quickstart: Submit a circuit with a provider-specific format to Azure Quantum](xref:microsoft.quantum.quickstarts.computing.provider). 37 | -------------------------------------------------------------------------------- /.github/actions/status-checker/src/types/WorkflowInput.ts: -------------------------------------------------------------------------------- 1 | import { getInput } from "@actions/core"; 2 | import { Mode } from "./Mode"; 3 | 4 | export class WorkflowInput { 5 | get collapsibleAfter(): number { 6 | const val = parseInt( 7 | getInput("collapsible_after", { required: false }) || "10" 8 | ); 9 | return val || 10; 10 | } 11 | 12 | get docsPath(): string { 13 | const val = getInput("docs_path", { required: true }); 14 | return val || "docs"; 15 | } 16 | 17 | get urlBasePath(): string { 18 | const val = getInput("url_base_path", { required: true }); 19 | return val || "dotnet"; 20 | } 21 | 22 | get repoToken(): string { 23 | const val = getInput("repo_token", { required: true }); 24 | return val; 25 | } 26 | 27 | get maxRowCount(): number { 28 | const val = getInput("max_row_count"); 29 | return parseInt(val || "30"); 30 | } 31 | 32 | get mode(): Mode { 33 | const val = getInput("mode"); 34 | return val === "warning" ? "warning" : "preview"; 35 | } 36 | 37 | get opaqueLeadingUrlSegments(): Map { 38 | const val = getInput("opaque_leading_url_segments"); 39 | if (val) { 40 | const map = new Map(); 41 | const pairs = val.split(","); 42 | pairs.forEach((pair) => { 43 | const [key, value] = pair.split(":"); 44 | map.set(key.trim(), value.trim()); 45 | }); 46 | return map; 47 | } 48 | return new Map(); 49 | } 50 | 51 | constructor() { } 52 | } 53 | 54 | export const workflowInput: WorkflowInput = new WorkflowInput(); 55 | -------------------------------------------------------------------------------- /articles/how-to-submit-jobs.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: This document provides a basic guide to submit and run Azure Quantum using the Azure portal, Python, Jupyter Notebooks, or the Azure CLI. 4 | ms.author: quantumdocwriters 5 | ms.date: 01/17/2025 6 | ms.service: azure-quantum 7 | ms.subservice: core 8 | ms.custom: devx-track-azurecli 9 | ms.topic: how-to 10 | title: Submit Q# Programs with VS Code 11 | no-loc: ["Quantum Development Kit", "QDK", "Visual Studio Code", "VS Code", "Azure Quantum", "Azure", "Q#", "Python", "Jupyter Notebook", "Jupyter", "target", "targets"] 12 | uid: microsoft.quantum.submit-jobs 13 | zone_pivot_groups: azurequantum-quantumcomputing-ide 14 | --- 15 | 16 | # How to submit Q# programs with Visual Studio Code 17 | 18 | Learn how to use Visual Studio Code (VS Code) to create and submit Q# programs to real quantum hardware. You can submit quantum computing jobs to Azure Quantum as a standalone Q# program, combine Q# with Python in a Q# project, and run a Jupyter Notebook. 19 | 20 | ::: zone pivot="ide-qsharp" 21 | 22 | [!INCLUDE [qsharp-procedure](includes/how-to-submit-quantum-include-qsharp.md)] 23 | 24 | ::: zone-end 25 | 26 | ::: zone pivot="ide-jupyter" 27 | 28 | [!INCLUDE [jupyter-procedure](includes/how-to-submit-quantum-include-jupyter.md)] 29 | 30 | ::: zone-end 31 | 32 | ::: zone pivot="ide-python" 33 | 34 | [!INCLUDE [python-procedure](includes/how-to-submit-quantum-include-python.md)] 35 | 36 | ::: zone-end 37 | 38 | ## Related content 39 | 40 | - [Work with Azure Quantum jobs](xref:microsoft.quantum.work-with-jobs) 41 | - [Quantum computing providers](xref:microsoft.quantum.reference.qc-target-list) 42 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/arithmeticexpressions.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about arithmetic expressions in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/01/2021 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Arithmetic expressions in Q# 11 | uid: microsoft.quantum.qsharp.arithmeticexpressions 12 | --- 13 | 14 | # Arithmetic expressions 15 | 16 | Arithmetic operators are addition (`+`), subtraction (`-`), multiplication (`*`), division (`/`), negation (`-`), and exponentiation (`^`). They can be applied to operands of type `Int`, `BigInt`, or `Double`. Additionally, for integral types (`Int` and `BigInt`), an operator computing the modulus (`%`) is available. 17 | 18 | For binary operators, the type of both operands must match, except for exponentiation; an exponent for a value of type `BigInt` must be of type `Int`. The type of the entire expression matches the type of the left operand. For exponentiation of `Int` and `BitInt`, the behavior is undefined if the exponent is negative or requires more than 32 bits to represent (that is, if it is larger than 2147483647). 19 | 20 | Division and modulus for values of type `Int` and `BigInt` follow the following behavior for 21 | negative numbers: 22 | 23 | `A` | `B` | `A / B` | `A % B` 24 | ---------|----------|---------|--------- 25 | 5 | 2 | 2 | 1 26 | 5 | -2 | -2 | 1 27 | -5 | 2 | -2 | -1 28 | -5 | -2 | 2 | -1 29 | 30 | That is, `a % b` always has the same sign as `a`, and `b * (a / b) + a % b` always equals `a`. 31 | 32 | Q# does not support automatic conversions between arithmetic data types or any other data types for that matter. This is of importance especially for the `Result` data type and facilitates restricting how runtime information can propagate. It has the benefit of avoiding accidental errors, such as ones related to precision loss. 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /.github/actions/status-checker/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependency directory 2 | node_modules 3 | 4 | # Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | lerna-debug.log* 12 | 13 | # Diagnostic reports (https://nodejs.org/api/report.html) 14 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 15 | 16 | # Runtime data 17 | pids 18 | *.pid 19 | *.seed 20 | *.pid.lock 21 | 22 | # Directory for instrumented libs generated by jscoverage/JSCover 23 | lib-cov 24 | 25 | # Coverage directory used by tools like istanbul 26 | coverage 27 | *.lcov 28 | 29 | # nyc test coverage 30 | .nyc_output 31 | 32 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 33 | .grunt 34 | 35 | # Bower dependency directory (https://bower.io/) 36 | bower_components 37 | 38 | # node-waf configuration 39 | .lock-wscript 40 | 41 | # Compiled binary addons (https://nodejs.org/api/addons.html) 42 | build/Release 43 | 44 | # Dependency directories 45 | jspm_packages/ 46 | 47 | # TypeScript v1 declaration files 48 | typings/ 49 | 50 | # TypeScript cache 51 | *.tsbuildinfo 52 | 53 | # Optional npm cache directory 54 | .npm 55 | 56 | # Optional eslint cache 57 | .eslintcache 58 | 59 | # Optional REPL history 60 | .node_repl_history 61 | 62 | # Output of 'npm pack' 63 | *.tgz 64 | 65 | # Yarn Integrity file 66 | .yarn-integrity 67 | 68 | # dotenv environment variables file 69 | .env 70 | .env.test 71 | 72 | # parcel-bundler cache (https://parceljs.org/) 73 | .cache 74 | 75 | # next.js build output 76 | .next 77 | 78 | # nuxt.js build output 79 | .nuxt 80 | 81 | # vuepress build output 82 | .vuepress/dist 83 | 84 | # Serverless directories 85 | .serverless/ 86 | 87 | # FuseBox cache 88 | .fusebox/ 89 | 90 | # DynamoDB Local files 91 | .dynamodb/ 92 | 93 | # OS metadata 94 | .DS_Store 95 | Thumbs.db 96 | 97 | # Ignore built ts files 98 | __tests__/runner/* 99 | lib/**/* -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/conjugations.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about using conjugations in Q# to manage memory in quantum programs. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/18/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Conjugations in Q# 11 | uid: microsoft.quantum.qsharp.conjugations 12 | --- 13 | 14 | # Conjugations 15 | 16 | Conjugations are common in quantum computations. In mathematical terms, they are patterns of the form *U†VU* for two unitary transformations *U* and *V*. That pattern is relevant due to the particularities of quantum memory: computations build up quantum correlations, or *entanglement*, to use the unique assets of quantum. However, that also means that once a subroutine no longer needs its qubits, those qubits cannot easily be reset and released since observing their state would impact the rest of the system. For that reason, the effect of a previous computation usually needs to be reversed before releasing and reusing quantum memory. 17 | 18 | Q# hence has a dedicated construct for expressing computations that require such a cleanup. The expressions consist of two code blocks, one containing the implementation of *U* and one containing the implementation of *V*. The *uncomputation* (that is, the application of *U†*) is done automatically as part of the expression. 19 | 20 | The expression takes the form 21 | 22 | ```qsharp 23 | within { 24 | 25 | } 26 | apply { 27 | 28 | } 29 | ``` 30 | 31 | where `` is replaced with any number of statements defining the implementation of *U* and *V* respectively. 32 | Both blocks may contain arbitrary classical computations, aside from the usual restrictions for automatically generating adjoint versions that apply to the `within` block. Mutably bound variables used as part of the `within` block may not be reassigned as part of the `apply` block. 33 | -------------------------------------------------------------------------------- /articles/qdk-qiskit-cirq-overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Use the Qiskit and Cirq Python libraries in the Quantum Development Kit 3 | description: This document gives an overview of the Qiskit and Cirq Python libraries, and how the QDK supports these features. 4 | author: azure-quantum-content 5 | ms.author: quantumdocwriters 6 | ms.service: azure-quantum 7 | ms.subservice: qdk 8 | ms.topic: overview 9 | ms.date: 10/02/2025 10 | no-loc: ["Azure Quantum Development Kit", "Quantum Development Kit", "QDK", "Visual Studio Code", "VS Code", "IntelliSense", "CodeLens", "Jupyter Notebook", "AI", "Copilot", "Microsoft's", "Q#", "OpenQASM", "Qiskit", "Cirq", "Python", "Circuit Editor", "IBM", "Google", "SDK", "azure-quantum", "QDK's"] 11 | uid: microsoft.quantum.overview.qdk-qiskit-cirq 12 | 13 | #Customer intent: As a developer, I want to learn about how the QDK supports other quantum programming frameworks, like Qiskit and Cirq. 14 | --- 15 | 16 | # Qiskit and Cirq interoperability with the Quantum Development Kit 17 | 18 | The Azure Quantum Development Kit (QDK) supports development in several quantum programming frameworks, including Qiskit and Cirq. 19 | 20 | Qiskit and Cirq are Python libraries that offer tools to create and visualize quantum circuits and write quantum programs. The QDK supports some interoperability with both Qiskit and Cirq. You can write your quantum programs in these frameworks and then run your programs on the local simulator or submit them as jobs to Azure Quantum with the QDK. 21 | 22 | ## Get started with Qiskit and Cirq in the QDK 23 | 24 | Install the Qiskit and Cirq libraries, and run Qiskit and Cirq circuits on Azure Quantum, through the `azure-quantum` Python SDK. You can also run Qiskit circuits on the QDK's local simulator. 25 | 26 | To get started with Qiskit, see [How to submit a circuit with Qiskit to Azure Quantum](xref:microsoft.quantum.quickstarts.computing.qiskit). 27 | 28 | To get started with Cirq, see [How to submit a circuit with Cirq to Azure Quantum](xref:microsoft.quantum.quickstarts.computing.cirq). 29 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/conditionalexpressions.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about conditional expressions in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/01/2021 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Conditional expressions in Q# 11 | uid: microsoft.quantum.qsharp.conditionalexpressions 12 | --- 13 | 14 | # Conditional expressions 15 | 16 | Conditional expressions consist of three sub-expressions, where the left-most sub-expression is of type `Bool` and determines which one of the two other sub-expressions is evaluated. They are of the form 17 | 18 | ```qsharp 19 | cond ? ifTrue | ifFalse 20 | ``` 21 | 22 | Specifically, if `cond` evaluates to `true`, then the conditional expression evaluates to the `ifTrue` expression; otherwise, it evaluates to the `ifFalse` expression. The other expression (the `ifFalse` and `ifTrue` expression, respectively) is never evaluated, much like the branches in an `if` statement. 23 | For instance, in an expression `a == b ? C(qs) | D(qs)`, if `a` equals `b`, then the callable `C` is invoked. Otherwise, `D` is invoked. 24 | 25 | The types of the `ifTrue` and the `ifFalse` expression have to have a [common base type](xref:microsoft.quantum.qsharp.subtypingandvariance#subtyping-and-variance). Independent of which one ultimately yields the value to which the expression evaluates, its type always matches the determined base type. 26 | 27 | For example, if 28 | 29 | - `Op1` is of type `Qubit[] => Unit is Adj` 30 | - `Op2` is of type `Qubit[] => Unit is Ctl` 31 | - `Op3` is of type `Qubit[] => Unit is Adj + Ctl` 32 | 33 | then 34 | 35 | - `cond ? Op1 | Op2` is of type `Qubit[] => Unit` 36 | - `cond ? Op1 | Op3` is of type `Qubit[] => Unit is Adj` 37 | - `cond ? Op2 | Op3` is of type `Qubit[] => Unit is Ctl` 38 | 39 | For more details, see [subtyping](xref:microsoft.quantum.qsharp.subtypingandvariance#subtyping-and-variance). 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /.github/actions/status-checker/src/file-heading-extractor.ts: -------------------------------------------------------------------------------- 1 | import { readFile } from "fs/promises"; 2 | 3 | const h1RegExp = /^# (?

.*$)/gim; 4 | const titleRegExp = /^title:\s*(?.*)$/gim; 5 | 6 | export async function getHeadingTextFrom(path: string): Promise<string | null> { 7 | try { 8 | const content = await readFile(path, "utf-8"); 9 | if (!content) { 10 | console.log(`Unable to read content for '${path}'.`); 11 | return null; 12 | } 13 | 14 | let result: string | null = 15 | tryGetRegExpMatch(h1RegExp, "h1", content) ?? 16 | tryGetRegExpMatch(titleRegExp, "title", content); 17 | 18 | console.log(`Found ${result} from '${path}' contents.`); 19 | 20 | if (result && result.indexOf("<xref:") > -1) { 21 | result = normalizeHeadingOrTitleText(result); 22 | console.log(` normalized as ${result}`); 23 | } 24 | 25 | return result; 26 | } catch (error) { 27 | if (error) { 28 | console.log(error.toString()); 29 | } else { 30 | console.log(`Unknown error reading content for '${path}'.`); 31 | } 32 | } 33 | 34 | return null; 35 | } 36 | 37 | const xrefRegExp = /<xref:([^>]+)>/gim; 38 | 39 | function normalizeHeadingOrTitleText(headingText: string): string { 40 | // If contains xref markdown, extract only the text from it. 41 | // Example: "<xref:System.Globalization.CompareInfo> class" 42 | // or "<xref:System.Globalization.CompareInfo /> class" 43 | // Result: "`System.Globalization.CompareInfo` class" 44 | const xrefMatch = xrefRegExp.exec(headingText); 45 | 46 | if (xrefMatch && xrefMatch[1]) { 47 | headingText = headingText.replace(xrefRegExp, `\`${xrefMatch[1]}\``); 48 | } 49 | 50 | return headingText; 51 | } 52 | 53 | function tryGetRegExpMatch( 54 | expression: RegExp, 55 | groupName: string, 56 | content: string 57 | ): string | null { 58 | let result: string | null = null; 59 | 60 | const match = expression.exec(content); 61 | if (match && match.groups) { 62 | result = match.groups?.[groupName] || null; 63 | } 64 | 65 | return result; 66 | } 67 | -------------------------------------------------------------------------------- /articles/user-guide/language/Statements/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about the different types of statements in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/01/2021 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Statements in Q# 11 | uid: microsoft.quantum.qsharp.statements-overview 12 | --- 13 | 14 | # Statements 15 | 16 | Q# distinguishes between statements and expressions. Q# programs consist of a mixture of classical and quantum computations, and the implementation looks much like any other classical programming language. Some statements, such as the `let` and `mutable` bindings, are well-known from classical languages, while others, such qubit allocations, are unique to the quantum domain. 17 | 18 | The following statements are currently available in Q#: 19 | 20 | * **Expression statement** 21 | Contains a Q# expression to be run, such as a call to an operation. If the last statement in a block is an expression statement, it may have its trailing semicolon omitted to give the block the evaluated value of the contained expression. 22 | 23 | * **Variable declaration** 24 | Defines one or more local variables that are valid for the remainder of the current scope, and binds them to the specified values. Variables can be permanently bound or declared to be reassignable later on. See [Variable declarations and reassignments](xref:microsoft.quantum.qsharp.variabledeclarationsandreassignments#variable-declarations-and-reassignments) for more details. 25 | 26 | * **Qubit allocation** 27 | Instantiates and initializes qubits, or arrays of qubits, and binds them to the declared variables. The statement can optionally be used with a specified block of code, in which the qubit allocations are valid. Otherwise the allocations are valid for the enclosing scope. Qubits are automatically released at the end of the appropriate scope. 28 | See [Quantum memory management](xref:microsoft.quantum.qsharp.quantummemorymanagement#quantum-memory-management) for more details. 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /articles/provider-support-pasqal.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | ms.author: quantumdocwriters 4 | description: This document provides details on the support policy for the PASQAL quantum provider in Azure Quantum. 5 | ms.date: 03/10/2025 6 | ms.service: azure-quantum 7 | ms.subservice: computing 8 | ms.topic: troubleshooting-general 9 | title: Support Policy for PASQAL in Azure Quantum 10 | uid: microsoft.quantum.providers.pasqal.support 11 | --- 12 | 13 | # Support policy for PASQAL in Azure Quantum 14 | 15 | This article describes the Microsoft support policy that applies when you use the PASQAL provider in Azure Quantum. The article applies to any of the [targets](xref:microsoft.quantum.providers.pasqal) offered by PASQAL. 16 | 17 | ## Azure support 18 | 19 | In general, problems using PASQAL on Microsoft Azure Quantum are best addressed with the Azure Quantum support team directly by [creating an Azure support case](/azure/azure-portal/supportability/how-to-create-azure-support-request). This team has all the necessary details to isolate the issue you're experiencing and direct the report to the right point of contact. The Azure support team also has the means to reach PASQAL support outside of business hours for the most urgent issues. 20 | 21 | 22 | ## Pasqal support 23 | 24 | In some situations, the Azure Support team will need to redirect you to PASQAL's support team. You may receive a quicker response by reaching out to [PASQAL directly](mailto:help@pasqal.com). 25 | 26 | ## Support timeline 27 | 28 | Pasqal will always attempt to resolve issues with the Microsoft Azure integration as quickly as practical. Some issues will take longer to address than others, but the tables below indicate the time you may expect for an initial response from Pasqal after an issue is reported. 29 | 30 | | Severity | Definition | Response SLA | 31 | |----------|-------------|-----------------------| 32 | | High | Failure in connectivity, complete performance degradation | One business day | 33 | | Medium | Performance degradation | Two business days | 34 | | Low | Application related concerns and questions | Three business days | 35 | 36 | -------------------------------------------------------------------------------- /articles/overview-microsoft-quantum-machine.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: View Jupyter Notebooks with the device data from Microsoft's research into a scaled quantum machines using topological qubits. 4 | ms.date: 11/22/2024 5 | ms.author: quantumdocwriters 6 | ms.service: azure-quantum 7 | ms.subservice: qdk 8 | ms.topic: overview 9 | no-loc: ['Q#', '$$v', Quantum Development Kit] 10 | title: Microsoft's quantum machine 11 | uid: microsoft.quantum.overview.ms-machine 12 | --- 13 | 14 | # Microsoft's quantum machine 15 | 16 | Microsoft is on the path to deliver a quantum machine as part of the Azure Quantum service. You can read more about this journey on [this blog](https://cloudblogs.microsoft.com/quantum/2022/11/17/microsofts-quantum-machine-new-data-available-today/). This is part of a comprehensive plan to empower innovators with quantum solutions for breakthrough impact. 17 | 18 | In 2022, Microsoft had a major scientific breakthrough that cleared a significant hurdle toward building a scaled quantum machine with topological qubits. While engineering challenges remain, this new discovery demonstrates a fundamental building block for its approach to scaled quantum computing. For more information about this scientific discovery, read the [blog](https://www.microsoft.com/research/blog/microsoft-has-demonstrated-the-underlying-physics-required-to-create-a-new-kind-of-qubit/), watch a [video](https://www.youtube.com/watch?v=Q8CHms4ixYc), or read the [preprint](https://arxiv.org/abs/2207.02472) of the paper. 19 | 20 | ## View a Jupyter Notebook of the results 21 | 22 | The Azure Quantum team has created a set of Jupyter Notebooks on the [azure-quantum-tgp GitHub site](https://github.com/microsoft/azure-quantum-tgp) which display all the analysis and plots that appear in the paper. From the GitHub page, you can also view the executed notebook results with nbviewer. 23 | 24 | ## Next Steps 25 | 26 | - [What is Azure Quantum?](xref:microsoft.quantum.azure-quantum-overview) 27 | - [Introduction to Q#](xref:microsoft.quantum.qsharp-overview) 28 | - [Quickstart: Submit a circuit with Qiskit](xref:microsoft.quantum.quickstarts.computing.qiskit) 29 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/iterations.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about using 'for' loops in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/18/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Iterations and loops in Q# 11 | uid: microsoft.quantum.qsharp.iterations 12 | --- 13 | 14 | # Iterations 15 | 16 | Loops that iterate over a sequence of values are expressed as `for` loops in Q#. A `for` loop in Q# doesn't break based on a condition but instead corresponds to an iteration, or what is often expressed as `foreach` or `iter` in other languages. There are currently two data types in Q# that support iteration: arrays and ranges. 17 | 18 | The expression consists of the keyword `for`, followed by a symbol or symbol tuple, the keyword `in`, an expression of array or `Range` type, and a statement block. 19 | 20 | The statement block (the body of the loop) is run repeatedly, with one or more loop variables bound to each value in the range or array. The same deconstruction rules apply to the defined loop variables as to any other variable assignment, such as bindings in `let`, `mutable`, `use`, and `borrow` statements. The loop variables themselves are immutably bound, can't be reassigned within the body of the loop, and go out of scope when the loop terminates. 21 | The expression over which the loop iterates is evaluated before entering the loop and doesn't change while the loop is running. 22 | 23 | This scenario is illustrated in the following example. Suppose `qubits` is a value of type `Qubit[]`, then 24 | 25 | ```qsharp 26 | for qubit in qubits { 27 | H(qubit); 28 | } 29 | 30 | mutable results : (Int, Result)[] = []; 31 | for index in 0 .. Length(qubits) - 1 { 32 | results += [(index, M(qubits[index]))]; 33 | } 34 | 35 | mutable accumulated = 0; 36 | for (index, measured) in results { 37 | if measured == One { 38 | accumulated += 1 <<< index; 39 | } 40 | } 41 | ``` 42 | 43 | ## Target-specific restrictions 44 | 45 | Because there are no `break` or `continue` primitives in Q#, the length of the loop is known as soon as the iteration value is known. As such, `for` loops can be run on all quantum hardware. 46 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/comparativeexpressions.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about equality comparison expressions in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/18/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Comparative expressions in Q# 11 | uid: microsoft.quantum.qsharp.comparativeexpressions 12 | --- 13 | 14 | # Comparative expressions 15 | 16 | ## Equality comparisons 17 | 18 | *Equality comparisons* (`==`) and *inequality comparisons* (`!=`) are currently limited to the following data types: `Int`, `BigInt`, `Double`, `String`, `Bool`, `Result`, `Pauli`, and `Qubit`. Equality comparisons of `struct` types and callables aren't currently supported. 19 | 20 | Equality comparison for values of type `Qubit` evaluates whether the two expressions identify the same qubit. There's no notion of a quantum state in Q#; equality comparison, in particular, does *not* access, measure, or modify the quantum state of the qubits. 21 | 22 | Equality comparisons for `Double` values may be misleading due to rounding effects. 23 | For instance, the following comparison evaluates to `false` due to rounding errors: `49.0 * (1.0/49.0) == 1.0`. 24 | 25 | Equality comparison of arrays, and tuples are supported by comparisons of their items, and are only supported if all of their nested types support equality comparison. 26 | 27 | Equality comparison of close-ended ranges is supported, and two ranges are considered equal if they produce the same sequence of integers. For example, the following two ranges 28 | 29 | ```qsharp 30 | let r1 = 0..2..5; // generates the sequence 0,2,4 31 | let r2 = 0..2..4; // generates the sequence 0,2,4 32 | ``` 33 | 34 | are considered equal. Equality comparison of open-ended ranges isn't supported. 35 | 36 | ## Quantitative comparison 37 | 38 | The operators *less-than* (`<`), *less-than-or-equal* (`<=`), *greater-than* (`>`), and *greater-than-or-equal* (`>=`) define quantitative comparisons. They can only be applied to data types that support such comparisons, that is, the same data types that can also support [arithmetic expressions](xref:microsoft.quantum.qsharp.arithmeticexpressions#arithmetic-expressions). 39 | 40 | -------------------------------------------------------------------------------- /articles/user-guide/language/TypeSystem/immutability.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about immutability and Q# types. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/21/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Immutability in Q# 11 | uid: microsoft.quantum.qsharp.immutability 12 | --- 13 | 14 | # Immutability 15 | 16 | All types in Q# are *value types*. Q# doesn't have a concept of a reference or pointer. Instead, it allows you to reassign a new value to a previously declared variable via an assignment expression. For example, there's no distinction in behavior between reassignments for variables of type `Int` or variables of type `Int[]`. Consider the following sequence of statements: 17 | 18 | ```qsharp 19 | mutable arr1 = new Int[3]; 20 | let arr2 = arr1; 21 | arr1 w/= 0 <- 3; 22 | ``` 23 | 24 | The first statement instantiates a new array of integers `[0,0,0]` and assigns it to `arr1`. 25 | The next statement assigns that value to a variable with name `arr2`. The last statement creates a new array instance based on `arr1` with the same values except for the value at index 0 which is set to 3. The newly created array is then assigned to the variable `arr1`. The last line makes use of the abbreviated syntax for [evaluate-and-reassign statements](xref:microsoft.quantum.qsharp.variabledeclarationsandreassignments#evaluate-and-reassign-statements), and could equivalently have been written as `arr1 = arr1 w/ 0 <- 1;`. 26 | After running the three statements, `arr1` will contain the value `[3,0,0]` while `arr2` remains unchanged and contains the value `[0,0,0]`. 27 | 28 | Q# clearly thus distinguishes the mutability of a handle and the behavior of a type. 29 | Mutability within Q# is a concept that applies to a *symbol* rather than a type or value; 30 | it applies to the handle that allows you to access a value rather than to the value itself. It is *not* represented in the type system, implicitly or explicitly. 31 | 32 | Of course, this is merely a description of the formally defined behavior; under the hood, the actual implementation uses a reference counting scheme to avoid copying memory as much as possible. 33 | The modification is specifically done in place as long as there's only one currently valid handle that accesses a certain value. 34 | -------------------------------------------------------------------------------- /articles/docfx.json: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "content": [ 4 | { 5 | "files": ["breadcrumb/toc.yml"] 6 | }, 7 | { 8 | "files": [ 9 | "**/*.md", 10 | "**/*.yml" 11 | ], 12 | "src": ".", 13 | "dest": "", 14 | "exclude": [ 15 | "**/obj/**", 16 | "**/includes/**", 17 | "README.md", 18 | "LICENSE", 19 | "LICENSE-CODE", 20 | "ThirdPartyNotices", 21 | "quantum/**" 22 | ] 23 | } 24 | ], 25 | "resource": [ 26 | { 27 | "files": [ 28 | "**/*.png", 29 | "**/*.jpg", 30 | "**/*.gif", 31 | "**/*.svg" 32 | ], 33 | "exclude": [ 34 | "**/obj/**", 35 | "**/includes/**" 36 | ] 37 | } 38 | ], 39 | "overwrite": [], 40 | "externalReference": [], 41 | "globalMetadata": { 42 | "show_latex": true, 43 | "ms.service": "azure-quantum", 44 | "ms.devlang": "qsharp", 45 | "ms.topic": "concept-article", 46 | "searchScope": ["q#", "qsharp", "Quantum"], 47 | "feedback_system": "Standard", 48 | "feedback_product_url": "https://feedback.azure.com/d365community/forum/8616edd6-9f3b-ec11-8c62-00224825a012", 49 | "feedback_help_link_url": "https://learn.microsoft.com/answers/tags/3/azure-quantum", 50 | "feedback_help_link_type": "get-help-at-qna", 51 | "titleSuffix": "Azure Quantum ", 52 | "brand": "azure", 53 | "uhfHeaderId": "azure", 54 | "breadcrumb_path": "/azure/quantum/breadcrumb/toc.json", 55 | "extendBreadcrumb": true, 56 | "zone_pivot_group_filename": "/quantum/zone-pivot-groups.json", 57 | "no-loc": "Quantum Approximate Optimization Algorithm" 58 | }, 59 | "fileMetadata": { 60 | "latex_macros": { 61 | "**/**.md": { 62 | "ket": ["\\left| #1\\right\\rangle", 1], 63 | "bra": ["\\left\\langle #1\\right|", 1], 64 | "braket": [ "\\left\\langle #1 \\right\\rangle", 1 ], 65 | "id": "\\mathbb{1}", 66 | "boldone": "\\mathbf{1}", 67 | "expect": "\\mathbb{E}", 68 | "variance": "\\operatorname{Var}", 69 | "defeq": "\\mathrel{:=}", 70 | "dd": "\\mathrm{d}" 71 | } 72 | } 73 | }, 74 | "template": [], 75 | "dest": "quantum-docs" 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /articles/user-guide/language/TypeSystem/typeinference.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about type inference in Q#. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/21/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Type inference in Q# 11 | uid: microsoft.quantum.qsharp.typeinference 12 | --- 13 | 14 | # Type inference 15 | 16 | Q#'s type inference algorithm is based on inference algorithms designed for the Hindley-Milner type system. 17 | While top-level callables must be declared with explicit type annotations, most types used within a callable can be inferred. 18 | For example, given these callables: 19 | 20 | ```qsharp 21 | function Length<'a>(xs : 'a[]) : Int 22 | function Mapped<'a, 'b>(f : 'a -> 'b, xs : 'a[]) : 'b[] 23 | ``` 24 | 25 | and this expression: 26 | 27 | ```qsharp 28 | Mapped(Length, [[], ["a"], ["b", "c"]]) 29 | ``` 30 | 31 | then the type argument to `Length` is inferred as `Length<String[]>`, and the type arguments to `Mapped` are inferred as `Mapped<String[], Int>`. 32 | It isn't required to write these types explicitly. 33 | 34 | ## Ambiguous types 35 | 36 | Sometimes there isn't a single principal type that can be inferred for a type variable. 37 | In these cases, type inference fails with an error referring to an ambiguous type. 38 | For example, change the previous example slightly: 39 | 40 | ```qsharp 41 | Mapped(Length, [[]]) 42 | ``` 43 | 44 | What is the type of `[[]]`? 45 | In some type systems, it's possible to give it the type `∀a. a[][]`, but this isn't supported in Q#. 46 | A concrete type is required, but there are an infinite number of types that work: `String[][]`, `(Int, Int)[][]`, `Double[][][]`, and so on. 47 | You must explicitly say which type you meant. 48 | 49 | There are multiple ways to do this, depending on the situation. 50 | For example: 51 | 52 | 1. Call `Length` with a type argument. 53 | 54 | ```qsharp 55 | Mapped(Length<String>, [[]]) 56 | ``` 57 | 58 | 2. Call `Mapped` with its first type argument. 59 | (The `_` for its second type argument means that it should still be inferred.) 60 | 61 | ```qsharp 62 | Mapped<String[], _>(Length, [[]]) 63 | ``` 64 | 65 | 3. Replace the empty array literal with an explicitly-typed call to a library function. 66 | 67 | ```qsharp 68 | Mapped<String[], _>(Length, [EmptyArray<String>()]) 69 | ``` 70 | 71 | --- 72 | 73 | -------------------------------------------------------------------------------- /articles/how-to-add-a-provider.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Add or remove a provider in an existing Azure Quantum workspace 4 | ms.author: quantumdocwriters 5 | ms.date: 11/22/2024 6 | ms.service: azure-quantum 7 | ms.subservice: core 8 | ms.topic: how-to 9 | title: Add or remove a provider 10 | uid: microsoft.quantum.add-provider 11 | --- 12 | 13 | # Add or remove a provider 14 | 15 | Providers are usually added to an Azure Quantum workspace when the workspace is created. However, additional providers can be added (or existing providers removed) anytime after that. If you submit a quantum job to a provider that is not yet in your workspace, you will receive an error message prompting you to install the necessary provider. 16 | 17 | To add a provider to an existing workspace: 18 | 19 | 1. Sign in to the [Azure portal](https://portal.azure.com), using the credentials for your Azure subscription. 20 | 2. Select **Home** and navigate to your Azure Quantum workspace. 21 | 3. Select **Providers**. All your current providers are listed. 22 | 4. Select **Add a Provider**. All the available providers are displayed in **Add additional providers**, along with pricing information. 23 | 24 | :::image type="content" source="media/add-providers-portal.png" alt-text="Screen shot showing how to select a provider to add to an Azure Quantum workspace."::: 25 | 26 | > [!NOTE] 27 | > If the provider you want to add is not in the list of available providers, then your billing account may be located in a country/region that is not supported by that provider. For more information, see [Global availability of Azure Quantum providers](xref:microsoft.quantum.provider-availability). 28 | 29 | 5. Select **+Add** next to the desired provider, select a pricing option, and then click **Add**. 30 | 6. Once the provider is deployed, it appears in your provider list. To ensure that the deployment is complete, wait until the **Status** for the provider displays a green checkmark. 31 | 7. If the deployment fails, review the notification or check the Activity log. 32 | 33 | To remove a provider from a workspace: 34 | 35 | 1. Sign in to the [Azure portal](https://portal.azure.com), using the credentials for your Azure subscription. 36 | 2. Select **Home** and navigate to your Azure Quantum workspace. 37 | 3. Select **Providers**. 38 | 4. In the displayed list of providers, select **Remove** for the desired provider. 39 | 1. Select **Yes** to remove the provider. 40 | -------------------------------------------------------------------------------- /articles/provider-support-rigetti.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | ms.author: quantumdocwriters 4 | description: This document provides details on the support policy for the Rigetti provider in Azure Quantum 5 | ms.date: 09/16/2024 6 | ms.service: azure-quantum 7 | ms.subservice: computing 8 | ms.topic: troubleshooting-general 9 | no-loc: [target, targets] 10 | title: Support Policy for Rigetti in Azure Quantum 11 | uid: microsoft.quantum.providers.rigetti.support 12 | --- 13 | 14 | # Support policy for Rigetti in Azure Quantum 15 | 16 | This article describes the Microsoft support policy that applies when you use the Rigetti provider in Azure Quantum. The article applies to any of the [targets](xref:microsoft.quantum.providers.rigetti#targets) offered by the Rigetti provider. 17 | 18 | ## Support points of contact 19 | 20 | ### Azure support 21 | 22 | In general, problems using the Rigetti provider on Microsoft Azure Quantum are best addressed with the Azure Quantum support team directly by [creating an Azure support case](/azure/azure-portal/supportability/how-to-create-azure-support-request). This team has all the necessary details to isolate the issue you're experiencing and direct the report to the right point of contact. The Azure support team also has the means to reach Rigetti support outside of business hours for the most urgent issues. 23 | 24 | ### Rigetti support 25 | 26 | In some situations, the Azure Support team will need to redirect you to Rigetti's support team. You may receive a quicker response by reaching out to Rigetti directly at [https://rigetti.zendesk.com/hc/](https://rigetti.zendesk.com/hc/). 27 | 28 | ## Support timeline 29 | 30 | Rigetti will always attempt to resolve issues with the Microsoft Azure integration as quickly as practical. Some issues will take longer to address than others, but the tables below indicate the time you may expect for an initial response from Rigetti after an issue report. 31 | 32 | | Severity | Definition | Response SLA | 33 | |------------|-------------------|---------------------| 34 | | High | Failure in connectivity; complete performance degradation | 1 business day | 35 | | Medium | Performance degradation | 2 business days | 36 | | Low | Application-related concerns and questions | 5 business days | 37 | 38 | *Business days* are defined as Monday through Friday, not counting US holidays. For example, if a medium-severity incident is reported on a Tuesday, a response will be returned by the end of the business day on Thursday, if the intervening days are also business days. 39 | -------------------------------------------------------------------------------- /articles/zone-pivot-groups.yml: -------------------------------------------------------------------------------- 1 | # YamlMime:ZonePivotGroups 2 | groups: 3 | - id: quantum-computing-platforms 4 | title: Provider platforms 5 | prompt: Choose a provider platform 6 | pivots: 7 | - id: platform-ionq 8 | title: IonQ 9 | - id: platform-quantinuum 10 | title: Quantinuum 11 | - id: ide-local-simulator 12 | title: Local development environments 13 | prompt: Select your preferred development environment 14 | pivots: 15 | - id: platform-local 16 | title: Local computer 17 | - id: platform-simulator 18 | title: Local simulator 19 | - id: azurequantum-ide 20 | title: IDE for submitting jobs to AQ 21 | prompt: Select the option for your development environment 22 | pivots: 23 | - id: ide-portal 24 | title: Azure portal 25 | - id: ide-jupyter 26 | title: Jupyter Notebooks 27 | - id: ide-python 28 | title: Python 29 | - id: azurequantum-quantumcomputing-ide 30 | title: IDE for submitting quantum computing jobs to AQ 31 | prompt: Select the type of program you are submitting 32 | pivots: 33 | - id: ide-qsharp 34 | title: Q# programs 35 | - id: ide-jupyter 36 | title: Jupyter Notebooks 37 | - id: ide-python 38 | title: Python programs 39 | - id: ide-platforms 40 | title: Local or online development environments 41 | prompt: Select your preferred development environment 42 | pivots: 43 | - id: ide-azure-portal 44 | title: Azure Quantum portal 45 | - id: ide-azure-copilot 46 | title: Copilot for Azure Quantum 47 | - id: ide-local 48 | title: Local computer 49 | - id: ide-platforms-copilot-vscode 50 | title: Local or online development environments 51 | prompt: Select your preferred development environment 52 | pivots: 53 | - id: ide-azure-copilot 54 | title: Copilot for Azure Quantum 55 | - id: ide-local 56 | title: Local computer 57 | - id: ide-local-portal-jupyter 58 | title: Local or online development environments 59 | prompt: Select your preferred development environment 60 | pivots: 61 | - id: platform-local 62 | title: Q# in VS Code 63 | - id: platform-local-jupyter 64 | title: Q# in Jupyter Notebook 65 | - id: platform-portal-qiskit 66 | title: Qiskit in Azure portal 67 | - id: ide-local-jupyter-qiskit 68 | title: Quantum programming languages 69 | prompt: Select your quantum programming language 70 | pivots: 71 | - id: platform-local 72 | title: Q# in VS Code 73 | - id: platform-local-jupyter 74 | title: Q# in Jupyter Notebook (Advanced) 75 | - id: platform-qiskit 76 | title: Qiskit in VS Code 77 | -------------------------------------------------------------------------------- /.github/actions/status-checker/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["jest", "@typescript-eslint"], 3 | "extends": ["plugin:github/recommended"], 4 | "parser": "@typescript-eslint/parser", 5 | "parserOptions": { 6 | "ecmaVersion": 9, 7 | "sourceType": "module", 8 | "project": "./tsconfig.json" 9 | }, 10 | "rules": { 11 | "eslint-comments/no-use": "off", 12 | "import/no-namespace": "off", 13 | "no-unused-vars": "off", 14 | "@typescript-eslint/no-unused-vars": "error", 15 | "@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}], 16 | "@typescript-eslint/no-require-imports": "error", 17 | "@typescript-eslint/array-type": "error", 18 | "@typescript-eslint/await-thenable": "error", 19 | "@typescript-eslint/ban-ts-comment": "error", 20 | "camelcase": "off", 21 | "@typescript-eslint/consistent-type-assertions": "error", 22 | "@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}], 23 | "@typescript-eslint/func-call-spacing": ["error", "never"], 24 | "@typescript-eslint/no-array-constructor": "error", 25 | "@typescript-eslint/no-empty-interface": "error", 26 | "@typescript-eslint/no-explicit-any": "error", 27 | "@typescript-eslint/no-extraneous-class": "error", 28 | "@typescript-eslint/no-for-in-array": "error", 29 | "@typescript-eslint/no-inferrable-types": "error", 30 | "@typescript-eslint/no-misused-new": "error", 31 | "@typescript-eslint/no-namespace": "error", 32 | "@typescript-eslint/no-non-null-assertion": "warn", 33 | "@typescript-eslint/no-unnecessary-qualifier": "error", 34 | "@typescript-eslint/no-unnecessary-type-assertion": "error", 35 | "@typescript-eslint/no-useless-constructor": "error", 36 | "@typescript-eslint/no-var-requires": "error", 37 | "@typescript-eslint/prefer-for-of": "warn", 38 | "@typescript-eslint/prefer-function-type": "warn", 39 | "@typescript-eslint/prefer-includes": "error", 40 | "@typescript-eslint/prefer-string-starts-ends-with": "error", 41 | "@typescript-eslint/promise-function-async": "error", 42 | "@typescript-eslint/require-array-sort-compare": "error", 43 | "@typescript-eslint/restrict-plus-operands": "error", 44 | "semi": "off", 45 | "@typescript-eslint/semi": ["error", "never"], 46 | "@typescript-eslint/type-annotation-spacing": "error", 47 | "@typescript-eslint/unbound-method": "error" 48 | }, 49 | "env": { 50 | "node": true, 51 | "es6": true, 52 | "jest/globals": true 53 | } 54 | } -------------------------------------------------------------------------------- /articles/media/logo-quantinuum.svg: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> 3 | <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" 4 | viewBox="0 0 204.13 37.91" style="enable-background:new 0 0 204.13 37.91;" xml:space="preserve"> 5 | <style type="text/css"> 6 | .st0{fill:#D9D9D6;} 7 | .st1{fill:#FFFFFF;} 8 | .st2{fill:#698197;} 9 | .st3{fill:#010101;} 10 | </style> 11 | <g> 12 | <g> 13 | <g> 14 | <g> 15 | <path class="st2" d="M35.06,18.99c0,2.06-0.37,4.06-1.1,5.95h-2.32c0.6-13.14-16.42-18.87-23.92-8.11 16 | C6.5,12.76,7.83,8.17,10.96,5.38c0,0,0,0,0,0c1.14-1.04,2.5-1.84,3.95-2.33C24.93,0.12,35.22,8.73,35.06,18.99z"/> 17 | </g> 18 | <g> 19 | <path class="st2" d="M35.06,26.83v8.7H18.52c-0.21,0-0.4,0-0.59-0.02c-4.29-0.15-8.3-1.94-11.29-5.03 20 | c-6.48-6.3-5.98-17.92,0.71-23.67C5,10.54,4.75,15.46,6.69,19.4c2.15,4.47,6.82,7.43,11.83,7.42 21 | C18.52,26.83,35.06,26.83,35.06,26.83z"/> 22 | </g> 23 | </g> 24 | </g> 25 | <g> 26 | <g> 27 | <path class="st2" d="M114.52,16.51h4.97v8.5h1.96v-8.5h4.97v-1.96h-11.9V16.51z M108.88,22.64l-8.21-8.08h-2.25v10.46h1.96v-8.03 28 | l7.92,8.03l2.55,0V14.55h-1.96V22.64z M86.78,14.55l-5.34,10.46h2.19l0.79-1.57h7.34l0.79,1.57h2.2l-5.34-10.46H86.78z 29 | M85.42,21.49l2.67-5.21l2.67,5.21H85.42z M61.7,23.44h2.15l0.04-0.12c0.53-1.46,0.54-2.96,0.02-4.46 30 | c-0.78-2.3-2.81-4.05-5.18-4.47c-0.4-0.07-0.81-0.11-1.23-0.11c-1.81,0-3.51,0.7-4.79,1.98c-1.28,1.28-1.98,2.98-1.98,4.8 31 | c0,3.67,2.98,6.7,6.65,6.77l0.3,0.01l6.43,0h0.17v-1.96h-6.8c-1.95,0-3.72-1.16-4.41-2.88c-0.64-1.59-0.49-3.28,0.44-4.64 32 | c0.9-1.33,2.39-2.13,3.99-2.13c0.35,0,0.7,0.04,1.07,0.11c1.76,0.38,3.18,1.77,3.62,3.55c0.28,1.13,0.15,2.27-0.36,3.28 33 | L61.7,23.44z M77.22,19.61c0,2.03-1.65,3.68-3.68,3.68c-2.03,0-3.68-1.65-3.68-3.68v-5.06h-1.96v5.06c0,3.11,2.53,5.64,5.63,5.64 34 | c3.11,0,5.63-2.53,5.63-5.64v-5.06h-1.96V19.61z M198.54,14.55l-4.91,8.94l-4.96-8.94h-3.03v10.46h1.96v-8.36l4.63,8.36h2.8 35 | l4.57-8.32v8.32h1.96V14.55H198.54z M179.41,19.61c0,2.03-1.65,3.68-3.68,3.68c-2.03,0-3.68-1.65-3.68-3.68v-5.06h-1.96v5.06 36 | c0,3.11,2.53,5.64,5.64,5.64c3.11,0,5.63-2.53,5.63-5.64v-5.06h-1.96V19.61z M148.25,22.64l-8.21-8.08h-2.25v10.46h1.96v-8.03 37 | l7.92,8.03l2.55,0V14.55h-1.96V22.64z M163.9,19.61c0,2.03-1.65,3.68-3.68,3.68c-2.03,0-3.68-1.65-3.68-3.68v-5.06h-1.96v5.06 38 | c0,3.11,2.53,5.64,5.63,5.64c3.11,0,5.64-2.53,5.64-5.64v-5.06h-1.96V19.61z M130.63,25.01h1.96V14.55h-1.96V25.01z"/> 39 | </g> 40 | </g> 41 | </g> 42 | </svg> 43 | -------------------------------------------------------------------------------- /articles/how-to-submit-re-jobs.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: This document provides a basic guide to run resource estimates both locally and online using different SDKs and IDEs. 4 | ms.author: quantumdocwriters 5 | ms.date: 12/18/2024 6 | ms.service: azure-quantum 7 | ms.custom: 8 | ms.topic: how-to 9 | title: Run the Resource Estimator 10 | uid: microsoft.quantum.submit-resource-estimation-jobs 11 | no-loc: ["Quantum Development Kit", "QDK", "Visual Studio Code", "VS Code", "Azure Quantum", "Azure", "Q#", "Python", "Jupyter Notebook", "Jupyter", "target", "targets"] 12 | zone_pivot_groups: ide-local-jupyter-qiskit 13 | --- 14 | 15 | # Different ways to run the Resource Estimator 16 | 17 | In this article, you learn how to work with the [Azure Quantum Resource Estimator](xref:microsoft.quantum.overview.intro-resource-estimator). The Resource Estimator helps you estimate the resources required to run a quantum program on a quantum computer. You can use the Resource Estimator to estimate the number of qubits, the number of gates, and the depth of the circuit required to run a quantum program. 18 | 19 | The Resource Estimator is available in Visual Studio Code (VS Code) as part of the Azure Quantum Development Kit (QDK) extension. For more information, see [Install the Quantum Development Kit](xref:microsoft.quantum.install-qdk.overview). 20 | 21 | ::: zone pivot="platform-local" 22 | 23 | [!INCLUDE [local-procedure](includes/how-to-submit-resources-estimation-include-qsharp-local.md)] 24 | 25 | ::: zone-end 26 | 27 | ::: zone pivot="platform-local-jupyter" 28 | 29 | [!INCLUDE [local-jupyter-procedure](includes/how-to-submit-resources-estimation-include-jupyter-local.md)] 30 | 31 | ::: zone-end 32 | 33 | ::: zone pivot="platform-qiskit" 34 | 35 | [!INCLUDE [portal-qiskit-procedure](includes/how-to-submit-resources-estimation-include-qiskit.md)] 36 | 37 | ::: zone-end 38 | 39 | > [!NOTE] 40 | > If you experience issues when you work with the Resource Estimator, then see the [Troubleshooting page](xref:microsoft.quantum.azure.common-issues#azure-quantum-resource-estimator), or contact [AzureQuantumInfo@microsoft.com](mailto:AzureQuantumInfo@microsoft.com). 41 | 42 | ## Next steps 43 | 44 | - [Understand the results of the Resource Estimator](xref:microsoft.quantum.overview.resources-estimator-output.data) 45 | - [Customize resource estimates to machine characteristics](xref:microsoft.quantum.overview.resources-estimator) 46 | - [Handle large programs with the Resource Estimator](xref:microsoft.quantum.resource-estimator-caching) 47 | - [Tutorial: Estimate the resources of a quantum chemistry problem](xref:microsoft.quantum.tutorial.resource-estimator.chemistry) 48 | -------------------------------------------------------------------------------- /.openpublishing.publish.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "docsets_to_publish": [ 3 | { 4 | "docset_name": "azure-quantum", 5 | "build_source_folder": "articles", 6 | "build_output_subfolder": "azure-quantum", 7 | "locale": "en-us", 8 | "monikers": [], 9 | "moniker_ranges": [], 10 | "xref_query_tags": [ 11 | "/qsharp", 12 | "/dotnet", 13 | "/python" 14 | ], 15 | "enable_xrefmap_share": true, 16 | "open_to_public_contributors": true, 17 | "type_mapping": { 18 | "Conceptual": "Content", 19 | "ManagedReference": "Content", 20 | "Odata": "Content", 21 | "ZonePivotGroups": "Toc" 22 | }, 23 | "build_entry_point": "docs", 24 | "template_folder": "_themes" 25 | } 26 | ], 27 | "notification_subscribers": [], 28 | "sync_notification_subscribers": [ 29 | "quantumdocwriters@microsoft.com", 30 | "tedhudek@microsoft.com" 31 | ], 32 | "branches_to_filter": [], 33 | "git_repository_url_open_to_public_contributors": "https://github.com/MicrosoftDocs/quantum-docs", 34 | "git_repository_branch_open_to_public_contributors": "main", 35 | "need_preview_pull_request": true, 36 | "dependent_repositories": [ 37 | { 38 | "path_to_root": "_themes", 39 | "url": "https://github.com/Microsoft/templates.docs.msft", 40 | "branch": "main", 41 | "branch_mapping": {} 42 | }, 43 | { 44 | "path_to_root": "articles/quantum", 45 | "url": "https://github.com/microsoft/quantum", 46 | "branch": "main", 47 | "branch_mapping": {} 48 | }, 49 | { 50 | "path_to_root": "_themes.pdf", 51 | "url": "https://github.com/Microsoft/templates.docs.msft.pdf", 52 | "branch": "main", 53 | "branch_mapping": {} 54 | } 55 | ], 56 | "branch_target_mapping": { 57 | "live": [ 58 | "Publish", 59 | "Pdf" 60 | ] 61 | }, 62 | "targets": { 63 | "pdf": { 64 | "template_folder": "_themes.pdf" 65 | } 66 | }, 67 | "docs_build_engine": {}, 68 | "skip_source_output_uploading": false, 69 | "need_generate_pdf_url_template": true, 70 | "need_generate_pdf": false, 71 | "contribution_branch_mappings": {}, 72 | "JoinTOCPlugin": [ 73 | { 74 | "ConceptualTOC": "articles/TOC.yml", 75 | "ReferenceTOCUrl": "/qsharp/api/toc.json" 76 | } 77 | ], 78 | "dependent_packages": [ 79 | { 80 | "id": "Microsoft.OpenPublishing.CommonPlugins", 81 | "nuget_feed": "https://www.myget.org/F/op/api/v2", 82 | "path_to_root": "_dependentPackages/CommonPlugins", 83 | "target_framework": "net45", 84 | "version": "latest" 85 | } 86 | ] 87 | } 88 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/callstatements.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about different ways to call operators and functions in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/01/2021 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Call statements in Q# 11 | uid: microsoft.quantum.qsharp.callstatements 12 | --- 13 | 14 | # Call expressions 15 | 16 | Call expressions are an important part of any programming language. Operation and function calls, much like [partial applications](xref:microsoft.quantum.qsharp.closures#partial-application), can be used as an expression anywhere as long as the returned value is of a suitable type. 17 | 18 | The usefulness of calling operations in this form primarily lies in debugging, and such operation calls are one of the most common constructs in any Q# program. At the same time, operations can only be called from within other operations and not from within functions. For more information, see also [Qubits](xref:microsoft.quantum.qsharp.quantumdatatypes#qubits). 19 | 20 | With callables being first-class values, call expressions are a generic way of supporting patterns that aren't common enough to merit their own dedicated language construct, or dedicated syntax has not (yet) been introduced for other reasons. Some examples of library methods that serve that purpose are `ApplyIf`, which invokes an operation conditional on a classical bit being set; `ApplyToEach`, which applies a given operation to each element in an array; and `ApplyWithInputTransformation`, as shown in the following sample. 21 | 22 | ```qsharp 23 | operation ApplyWithInputTransformation<'TArg, 'TIn>( 24 | fn : 'TIn -> 'TArg, 25 | op : 'TArg => Unit, 26 | input : 'TIn 27 | ) : Unit { 28 | 29 | op(fn(input)); 30 | } 31 | ``` 32 | 33 | `ApplyWithInputTransformation` takes a function `fn`, an operation `op`, and an `input` value as arguments and then applies the given function to the input before invoking the given operation with the value returned from the function. 34 | 35 | For the compiler to auto-generate the specializations to support particular [functors](xref:microsoft.quantum.qsharp.functorapplication#functor-application), it usually requires that the called operations support those functors as well. The two exceptions are calls in outer blocks of [conjugations](xref:microsoft.quantum.qsharp.conjugations#conjugations), which always need to support the `Adjoint` functor but never need to support the `Controlled` functor, and self-adjoint operations, which support the `Adjoint` functor without imposing any additional requirements on the individual calls. 36 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/conditionalbranching.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about conditional branching and the 'if' statement in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/01/2021 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Conditional branching in Q# 11 | uid: microsoft.quantum.qsharp.conditionalbranching 12 | --- 13 | 14 | # Conditional branching 15 | 16 | Conditional branching is expressed in the form of `if` expressions. An `if` expression consists of an `if` clause, followed by zero or more `elif` clauses and optionally an else-block. Each clause follows the pattern 17 | 18 | ```qsharp 19 | keyword condition { 20 | <statements> 21 | } 22 | ``` 23 | 24 | where `keyword` is replaced with `if` or `elif` respectively, `condition` is an expression of type `Bool`, and `<statements>` is to be replaced with zero or more statements. The optional `else`-block consists of the keyword `else` followed by zero or more statements enclosed in braces, `{` `}`. 25 | 26 | The first block for which the `condition` evaluates to `true` will run. The `else` block, if present, runs if none of the conditions evaluate to `true`. The block is executed in its own scope, meaning any bindings made as part of the block are not visible after the block ends. 27 | 28 | For example, suppose `qubits` is value of type `Qubit[]` and `r1` and `r2` are of type `Result`, 29 | 30 | ```qsharp 31 | if r1 == One { 32 | let q = qubits[0]; 33 | H(q); 34 | } 35 | elif r2 == One { 36 | let q = qubits[1]; 37 | H(q); 38 | } 39 | else { 40 | H(qubits[2]); 41 | } 42 | ``` 43 | 44 | You can also express simple branching in the form of a [conditional expression](xref:microsoft.quantum.qsharp.conditionalexpressions#conditional-expressions). 45 | 46 | ## Target-specific restrictions 47 | 48 | The tight integration between control-flow constructs and quantum computations poses a challenge for current quantum hardware. Certain quantum processors do not support branching based on measurement outcomes. As such, comparison for values of type `Result` will always result in a compilation error for Q# programs that are targeted to run on such hardware. 49 | 50 | Other quantum processors support specific kinds of branching based on measurement outcomes. The more general `if` expressions supported in Q# are compiled into suitable instructions that can be run on such processors. The imposed restrictions are that values of type `Result` may only be compared as part of the condition within `if` expressions in operations. Furthermore, the conditionally run blocks cannot contain any `return` expressions or update mutable variables that are declared outside that block. 51 | 52 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about the different types of expressions in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/18/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Expressions in Q# - operators, combinators, & modifiers 11 | uid: microsoft.quantum.qsharp.expressions-overview 12 | --- 13 | 14 | # Expressions 15 | 16 | At the core, Q# expressions are either [value literals](xref:microsoft.quantum.qsharp.valueliterals) or [identifiers](xref:microsoft.quantum.qsharp.expressions-overview#identifiers), where identifiers can refer to either locally declared variables or to globally declared callables (there are currently no global constants in Q#). 17 | Operators, combinators, and modifiers can be used to combine these identifiers into a wider variety of expressions. 18 | 19 | - *Operators* in a sense are nothing but dedicated syntax for particular callables. 20 | >Even though Q# is not yet expressive enough to formally capture the capabilities of each operator in the form of a backing callable declaration, that should be remedied in the future. 21 | 22 | - *Modifiers* can only be applied to certain expressions. One or more modifiers can be applied to expressions that are either 23 | - identifiers 24 | - array item access expressions 25 | - named item access expressions 26 | - an expression within parenthesis which is the same as a single item tuple. For more information, see [singleton tuple equivalence](xref:microsoft.quantum.qsharp.singletontupleequivalence#singleton-tuple-equivalence)). 27 | They can either precede (prefix) the expression or follow (postfix) the expression. They are thus special unary operators that bind tighter than function or operation calls, but less tight than any kind of item access. 28 | Concretely, [functors](xref:microsoft.quantum.qsharp.functorapplication#functor-application) are prefix modifiers, whereas the [unwrap operator](xref:microsoft.quantum.qsharp.itemaccessexpression#item-access-for-user-defined-types) is a postfix modifier. 29 | 30 | - Function, operation, and item access calls can be seen as a special type of operator, similar to modifiers. The're all subject to the same restrictions regarding where they can be applied; we refer to them as *combinators*. 31 | 32 | The section on [precedence and associativity](xref:microsoft.quantum.qsharp.precedenceandassociativity) contains a complete [list of all operators](xref:microsoft.quantum.qsharp.precedenceandassociativity#operators) as well as a complete [list of all modifiers and combinators](xref:microsoft.quantum.qsharp.precedenceandassociativity#modifiers-and-combinators). 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /articles/user-guide/language/ProgramStructure/typedeclarations.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about how struct types are declared in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/18/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Type declarations in Q# 11 | uid: microsoft.quantum.qsharp.typedeclarations 12 | --- 13 | 14 | # Type Declarations 15 | 16 | Q# supports user-defined `struct` types. `struct` types are similar to record types in F#; they're immutable but support a [copy-and-update](xref:microsoft.quantum.qsharp.copyandupdateexpressions) construct. 17 | 18 | ## Struct types 19 | 20 | `struct` types can only contain named items and don't support anonymous items. Any combination of named items is supported, although items can't be nested. 21 | 22 | The following declaration, for example, defines a struct `Complex` which has two named items `Real` and `Imaginary`, both of type `Double`: 23 | 24 | ```qsharp 25 | struct Complex { 26 | Real : Double, 27 | Imaginary : Double, 28 | } 29 | ``` 30 | 31 | You can access the contained items via their name or by *deconstruction* (for more information, see [item access](xref:microsoft.quantum.qsharp.itemaccessexpression#item-access-for-struct-types)). 32 | You can also access a tuple of all items where the shape matches the one defined in the declaration via the [unwrap operator](xref:microsoft.quantum.qsharp.itemaccessexpression#item-access-for-struct-types). 33 | 34 | `struct` types are useful for two reasons. First, as long as the libraries and programs that use the defined types access items via their name rather than by deconstruction, the type can be extended to contain additional items later on without breaking any library code. Because of this, accessing items via deconstruction is discouraged. 35 | 36 | Second, Q# allows you to convey the intent and expectations for a specific data type since there's no automatic conversion between values of two `struct` types, even if their item types are identical. 37 | 38 | ## Struct constructors 39 | 40 | The compiler automatically generates constructors for new `struct` types when it reads a `struct` definition. For the `Complex` struct in the previous example, you can create an instance with 41 | 42 | ```qsharp 43 | let complexPair = Complex(1.4, 2.1); 44 | ``` 45 | 46 | You can also define instances with the `new` keyword, for example 47 | 48 | ```qsharp 49 | let complexPair = new Complex { Real = 1.4, Imaginary = 2.1 }; 50 | ``` 51 | 52 | You can copy an existing struct with the `...` syntax 53 | 54 | ```qsharp 55 | let copyPair = new Complex { ...complexPair }; 56 | ``` 57 | 58 | When copying, you can specify individual fields to change 59 | 60 | ```qsharp 61 | let updatedPair = new Complex { ...complexPair, Real = 3.5 }; 62 | ``` 63 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | <!-- BEGIN MICROSOFT SECURITY.MD V0.0.8 BLOCK --> 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). 40 | 41 | <!-- END MICROSOFT SECURITY.MD BLOCK --> 42 | -------------------------------------------------------------------------------- /articles/tutorial-qdk-explore-entanglement.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: In this tutorial, write a quantum program in Q# that demonstrates the superposition and entanglement of qubits. 4 | ms.author: quantumdocwriters 5 | ms.date: 12/03/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qdk 8 | ms.topic: tutorial 9 | no-loc: ["Q#", "$$v"] 10 | title: 'Tutorial: Quantum Entanglement with Q#' 11 | uid: microsoft.quantum.tutorial-qdk.entanglement 12 | zone_pivot_groups: ide-platforms-copilot-vscode 13 | #customer intent: As a quantum programmer, 14 | --- 15 | 16 | # Tutorial: Explore quantum entanglement with Q\# 17 | 18 | In this tutorial, you write a Q# program that prepares two qubits in a specific quantum state, operates on the qubits to entangle them with each other, and performs measurements to demonstrate the effects of superposition and entanglement. You build your Q# program piece-by-piece to introduce qubit states, quantum operations, and measurements. 19 | 20 | Before you begin, review the following quantum computing concepts: 21 | 22 | - Classical bits hold a single binary value such as a 0 or 1, but qubits can be in a superposition of the two states, 0 and 1. Each possible qubit state is described by a set of probability amplitudes. 23 | - When you measure a qubit's state, you always get either 0 or 1. The probability of each result is determined by the probability amplitudes that define the superposition state when you make a measurement. 24 | - Multiple qubits can be entangled such that you can't describe them independently from each other. When you measure one qubit in an entangled pair, you also get information about the other qubit without measuring it. 25 | 26 | In this tutorial, you learn how to: 27 | 28 | > [!div class="checklist"] 29 | > 30 | > - Create Q# operations to initialize a qubit to a desired state. 31 | > - Put a qubit into a superposition state. 32 | > - Entangle a pair of qubits. 33 | > - Measure a qubit and observe the results. 34 | 35 | [!INCLUDE [Copilot in Azure Quantum banner](includes/copilot-banner.md)] 36 | 37 | ::: zone pivot="ide-azure-copilot" 38 | 39 | [!INCLUDE [copilot-procedure](includes/tutorial-entanglement-copilot-include.md)] 40 | 41 | ::: zone-end 42 | 43 | ::: zone pivot="ide-local" 44 | 45 | [!INCLUDE [local-procedure](includes/tutorial-entanglement-local-include.md)] 46 | 47 | ::: zone-end 48 | 49 | ## Related content 50 | 51 | Explore other Q# tutorials: 52 | 53 | - [Grover's search algorithm](xref:microsoft.quantum.tutorial-qdk.grovers) shows how to write a Q# program that uses Grover's search algorithm. 54 | - [Quantum Fourier Transform](xref:microsoft.quantum.tutorial-qdk.circuit) explores how to write a Q# program that directly addresses specific qubits. 55 | - The [Quantum Katas](https://quantum.microsoft.com/tools/quantum-katas) are self-paced tutorials and programming exercises that teach the elements of quantum computing and Q# programming at the same time. 56 | -------------------------------------------------------------------------------- /articles/user-guide/language/Statements/bindingscopes.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about visibility of local variables in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/18/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Binding scopes in Q# 11 | uid: microsoft.quantum.qsharp.bindingscopes 12 | --- 13 | 14 | # Visibility of Local Variables 15 | 16 | In general, symbol bindings in Q# become inoperative at the end of the statement block they occur in. However, there are some exceptions to this rule. 17 | 18 | ## Visibility of local variables 19 | 20 | | Scope | Visibility | 21 | |------|-----| 22 | | Loop variables |Bindings of loop variables in a [`for`](xref:microsoft.quantum.qsharp.iterations#iterations) loop are defined only for the body of the loop. They're inoperative outside of the loop. | 23 | | [`use`](xref:microsoft.quantum.qsharp.quantummemorymanagement#quantum-memory-management) and [`borrow`](xref:microsoft.quantum.qsharp.quantummemorymanagement#quantum-memory-management) statements |Bindings of allocated qubits in `use` and `borrow` statements are defined for the body of the allocation, and are inoperative after the statement terminates. This action only applies to `use` and `borrow` statements that have an associated statement block.| 24 | | [`repeat`](xref:microsoft.quantum.qsharp.conditionalloops#conditional-loops) expressions |For `repeat` expressions, both the blocks and the condition are treated as a single scope, that is, symbols that are bound in the body are accessible in both the condition and in the `fixup` block. | 25 | | Loops |Each iteration of a loop runs in its own scope, and all defined variables are bound anew for each iteration. | 26 | 27 | Bindings in outer blocks are visible and defined in inner blocks. 28 | A symbol may only be bound multiple times per block in which case the last binding in scope is the one used for logic. This scenario is known as "shadowing." 29 | 30 | The following sequences are valid: 31 | 32 | ```qsharp 33 | if a == b { 34 | ... 35 | let n = 5; 36 | ... // n is 5 37 | } 38 | let n = 8; 39 | ... // n is 8 40 | ``` 41 | 42 | and 43 | 44 | ```qsharp 45 | if a == b { 46 | ... 47 | let n = 5; 48 | ... // n is 5 49 | } else { 50 | ... 51 | let n = 8; 52 | ... // n is 8 53 | } 54 | ... // n is not bound to a value 55 | ``` 56 | 57 | ```qsharp 58 | let n = 5; 59 | ... // n is 5 60 | let n = 8; 61 | ... // n is 8 62 | ``` 63 | 64 | and 65 | 66 | ```qsharp 67 | let n = 8; 68 | if a == b { 69 | ... // n is 8 70 | let n = 5; 71 | ... // n is 5 72 | } 73 | ... // n is 8 again 74 | ``` 75 | 76 | For more information, see [Variable Declarations and Reassignments](xref:microsoft.quantum.qsharp.variabledeclarationsandreassignments#variable-declarations-and-reassignments). 77 | 78 | 79 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/returnsandtermination.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about using the 'return' and 'fail' statements in Q# to end a subroutine or program. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/18/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: The return and fail statements in Q# 11 | uid: microsoft.quantum.qsharp.returnsandtermination 12 | --- 13 | 14 | # Returns and termination 15 | 16 | There are two expressions available that conclude the execution of the current subroutine or the program; the `return` and the `fail` expressions. Generally, callables may end their execution before executing all of their statements with a `return` or `fail` expression. A `return` expression just ends the execution of the current callable, while a `fail` ends the execution of the whole program and result in a runtime error. 17 | 18 | ## Return expression 19 | 20 | The `return` expression exits from the current callable and returns control to the callee. It changes the context of the execution by popping a stack frame. 21 | 22 | The expression always returns a value to the context of the callee; it consists of the keyword `return`, followed by an expression of the appropriate type. The return value is evaluated before any terminating actions are performed and control is returned. Terminating actions include, for example, cleaning up and releasing qubits that are allocated within the context of the callable. When running on a simulator or validator, terminating actions often also include checks related to the state of those qubits. For example, they may check whether they are properly disentangled from all qubits that remain live. 23 | 24 | The `return` expression at the end of a callable that returns a `Unit` value may be omitted. In that case, control is returned automatically when all statements complete and all terminating actions performed. Callables may contain multiple `return` expressions, albeit the adjoint implementation for operations containing multiple `return` expressions can't be automatically generated. 25 | 26 | For example, 27 | 28 | ```qsharp 29 | return 1; 30 | ``` 31 | 32 | or 33 | 34 | ```qsharp 35 | return (); 36 | ``` 37 | 38 | ## Fail expression 39 | 40 | The `fail` expression ends the computation entirely. It corresponds to a fatal error that aborts the program. 41 | 42 | It consists of the keyword `fail`, followed by an expression of type `String`. 43 | The `String` should provide information about the encountered failure. 44 | 45 | For example, 46 | 47 | ```qsharp 48 | fail "Impossible state reached"; 49 | ``` 50 | 51 | or, using an [interpolated string](xref:microsoft.quantum.qsharp.valueliterals#string-literals), 52 | 53 | ```qsharp 54 | fail $"Syndrome {syn} is incorrect"; 55 | ``` 56 | 57 | In addition to the given `String`, a `fail` expression ideally collects and permits the retrieval of information about the program state. This facilitates diagnosing and remedying the source of the error, and requires support from the executing runtime and firmware, which may vary across different targets. 58 | 59 | -------------------------------------------------------------------------------- /articles/provider-support-ionq.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: This document provides details on the support policy for the IonQ provider in Azure Quantum 4 | ms.author: quantumdocwriters 5 | ms.date: 09/18/2025 6 | ms.service: azure-quantum 7 | ms.subservice: computing 8 | ms.topic: troubleshooting-general 9 | no-loc: [target, targets] 10 | title: Support policy for IonQ in Azure Quantum 11 | uid: microsoft.quantum.providers.computing.ionq.support 12 | --- 13 | 14 | # Support policy for IonQ in Azure Quantum 15 | 16 | This article describes the Microsoft support policy that applies when you use the IonQ provider in Azure Quantum. The article applies to any of the targets under this provider. 17 | 18 | If you're using the IonQ provider and hit any unexpected issues that you can't troubleshoot yourself, you can contact the Azure Support team for help by [creating an Azure support case](/azure/azure-portal/supportability/how-to-create-azure-support-request). 19 | 20 | However, there are however some situations where the Azure Support team will need to redirect you to IonQ's support team. Or, you may receive a quicker response by reaching out to IonQ directly at the [IonQ Support website](http://support.ionq.com/). 21 | 22 | ## Frequently asked questions 23 | 24 | ### Q: What is the support policy for using IonQ offerings through Azure Quantum? 25 | 26 | Microsoft will provide support for the Azure platform and the Azure Quantum service only. Support for IonQ hardware, simulators, and other products and targets will be provided directly by IonQ. For more information about Azure support, see [Azure support plans](https://azure.microsoft.com/support/plans/). 27 | For information about IonQ support, please see the [IonQ Support website](http://support.ionq.com/). 28 | 29 | ### Q: What happens if I raise a support issue with the Azure support team and it turns out that a third party provider (like IonQ) needs to troubleshoot the issue further? 30 | 31 | The support engineer will create a redirection package for you. This is a PDF document that contains information about your case which you can provide to the IonQ support team. 32 | The support engineer will also give you advice and guidance on how to reach out to IonQ to continue troubleshooting. For more information, see [IonQ status page](https://status.ionq.co/). 33 | 34 | ### Q: What happens if I raise a support issue with the IonQ team and it turns out that there is an issue with the Azure Quantum service? 35 | 36 | The IonQ support team will help you reach out to Microsoft and provide you with a redirection package. This package is a PDF document that you can use when continuing your support inquiry with the Azure support team. 37 | 38 | ## Third-party information disclaimer 39 | 40 | The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products. 41 | 42 | ## Third-party contact disclaimer 43 | 44 | Microsoft provides third-party contact information to help you find additional information about this topic. This contact information may change without notice. Microsoft doesn't guarantee the accuracy of third-party contact information. 45 | -------------------------------------------------------------------------------- /articles/qdk-main-overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Build Quantum Solutions with the Azure Quantum Development Kit 3 | description: This document is the main landing page for the Quantum Development Kit (QDK), which gives a high level overview of the QDK and links to documentation on all the features in the QDK. 4 | author: azure-quantum-content 5 | ms.author: quantumdocwriters 6 | ms.service: azure-quantum 7 | ms.subservice: qdk 8 | ms.topic: overview 9 | ms.date: 10/14/2025 10 | no-loc: ["Azure Quantum Development Kit", "Quantum Development Kit", "QDK", "Visual Studio Code", "VS Code", "IntelliSense", "CodeLens", "Jupyter Notebook", "AI", "Copilot", "Microsoft's", "Q#", "OpenQASM", "Qiskit", "Cirq", "Python", "Circuit Editor"] 11 | uid: microsoft.quantum.overview.qdk-landing-page 12 | 13 | #Customer intent: As a developer, I want to learn about what the QDK has to offer and how to use the QDK. 14 | --- 15 | 16 | # Build quantum solutions with the Azure Quantum Development Kit 17 | 18 | The Azure Quantum Development Kit (QDK) is a free open-source software development kit designed specifically for quantum program development. The QDK includes an extension for Microsoft's Visual Studio Code (VS Code) and a set of Python libraries. Install the QDK to get started with state-of-the-art quantum development tools. 19 | 20 | ## Overview of the QDK 21 | 22 | The QDK offers a rich set of tools and features to help you excel in quantum development, such as: 23 | 24 | - Support for several quantum programming languages, including Q#, Qiskit, and OpenQASM. 25 | - Quantum code samples for various languages and development scenarios. 26 | - Support for development in Jupyter Notebook. 27 | - Visualization tools for quantum circuits and output from your quantum programs. 28 | - Full integration with Azure Quantum to submit jobs that run on real quantum hardware. 29 | - Local simulators to test and run quantum programs on your local device. 30 | 31 | In addition to a robust set of quantum-specific features, the QDK offers standard VS Code development tools such as syntax highlighting, code suggestions with IntelliSense, CodeLens shortcuts, error checking and debugging, and code references. 32 | 33 | The QDK also includes a fully integrated AI agent experience with Copilot in VS Code. The VS Code agent can write code for you, explain what the code does, help you submit jobs to Azure Quantum, and even teach you about theoretical concepts in quantum computing. 34 | 35 | ### Get started with the QDK 36 | 37 | To install the QDK, see [Set up the QDK extension](xref:microsoft.quantum.install-qdk.overview). 38 | 39 | To update the QDK, see [Update the QDK to the latest version](xref:microsoft.quantum.update-qdk). 40 | 41 | ## Features of the QDK 42 | 43 | Explore the following documentation to learn more about the main features of the QDK: 44 | 45 | - [Microsoft's Q# programming language](xref:microsoft.quantum.qsharp-overview) 46 | - [The OpenQASM programming language](xref:microsoft.quantum.how-to.openqasm-development-qdk) 47 | - [Qiskit and Cirq Python libraries](xref:microsoft.quantum.overview.qdk-qiskit-cirq) 48 | - [Build circuits with the Circuit Editor](xref:microsoft.quantum.how-to.qdk-circuit-editor) 49 | - [Copilot integration in VS Code](xref:microsoft.quantum.how-to.qdk-vscode-agent-setup) 50 | -------------------------------------------------------------------------------- /articles/optimization-authenticate-managed-identity.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: This document provides instructions on how to authenticate in your Azure Quantum workspace using a managed identity. 4 | ms.author: quantumdocwriters 5 | ms.date: 06/18/2024 6 | ms.service: azure-quantum 7 | ms.subservice: core 8 | ms.topic: how-to 9 | title: Authenticate Using a Managed Identity 10 | uid: microsoft.quantum.optimization.authenticate-managed-identity 11 | ms.custom: sfi-image-nochange 12 | 13 | #customer intent: As a quantum developer, I want to understand how to authenticate using a managed identity to submit jobs to Azure Quantum. 14 | --- 15 | 16 | # Authenticate in your workspace using a managed identity 17 | 18 | There are several scenarios where it is unsuitable to use interactive authentication or to authenticate 19 | as a user account. For example, you may want to submit jobs from a virtual machine (VM), or from a Function App. One option is to [authenticate using a service principal](xref:microsoft.quantum.optimization.authenticate-service-principal), another option is to configure a managed identity, which this article will explain. 20 | 21 | ## Configure a managed identity 22 | 23 | A managed identity allows an application to access other Azure resources (such as your Azure Quantum workspace) and authenticate with these resources. 24 | 25 | To configure a managed identity: 26 | 27 | 1. Via the Azure portal, locate the resource that you wish to give access to. This resource may be a VM, a Function App, or other application. 28 | 2. Select the resource, and view the overview page. 29 | 3. Under **Settings**, select **Identity**. 30 | 4. Configure the **Status** setting to **On**. 31 | 5. Select **Save** to persist your configuration and confirm the opening dialog with **Yes**. 32 | 33 | ## Grant access to your Azure Quantum workspace 34 | 35 | In order to allow the resource to access your Azure Quantum workspace: 36 | 37 | 1. Navigate to your Azure Quantum workspace and select **Access control (IAM)** from the left-side menu. 38 | 1. Select **Add** and **Add role assignment**. 39 | 40 | :::image type="content" source="media/how-to-publish-qio-job-as-azurefunction/prepare-cloud-env-3.png" alt-text="Screenshot showing how to create a new role assignment on your Azure Quantum workspace."::: 41 | 42 | 1. On the **Add role assignment** page, select **Contributor** and select **Next**. 43 | 1. On the **Members** tab, in **Assign access to**, select **Managed Identity**, and then select **+ Select members**. 44 | 1. In the **Select managed identities** popup, select a category from the **Managed identity** dropdown. 45 | 1. Select the desired resource from the list and click **Select**. 46 | 1. Select **Next** and then select **Review and assign**. 47 | 48 | ## Logging in to your Azure Quantum workspace 49 | 50 | You should now be able to use your quantum workspace from your chosen resource. For example when using your workspace from within a VM, you will no longer need to authenticate each time. 51 | 52 | In some cases, you may also want to specify explicitly within the code to use a Managed Identity Credential: 53 | 54 | ```python 55 | 56 | from azure.identity import ManagedIdentityCredential 57 | 58 | from azure.quantum import Workspace 59 | workspace = Workspace ( 60 | resource_id = "", 61 | location = "" , 62 | credential=ManagedIdentityCredential() 63 | ) 64 | 65 | ``` -------------------------------------------------------------------------------- /articles/user-guide/language/TypeSystem/quantumdatatypes.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about quantum data types in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/21/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Quantum data types in Q# 11 | uid: microsoft.quantum.qsharp.quantumdatatypes 12 | --- 13 | 14 | # Quantum-specific data types 15 | 16 | This topic describes the `Qubit` type, along with two other types that are somewhat specific to the quantum domain: `Pauli` and `Result`. 17 | 18 | ## Qubit 19 | 20 | Q# treats qubits as opaque items that can be passed to both functions and operations, but can only be interacted with by passing them to instructions that are native to the targeted quantum processor. Such instructions are always defined in the form of operations, since their intent is to modify the quantum state. 21 | The restriction that functions can't modify the quantum state, despite the fact that qubits can be passed as input arguments, is enforced by the requiring that functions can only call other functions, and can't call operations. 22 | 23 | The Q# libraries are compiled against a standard set of intrinsic operations, meaning operations which have no definition for their implementation within the language. 24 | Upon targeting, the implementations that express them in terms of the instructions that are native to the execution target are linked in by the compiler. 25 | A Q# program thus combines these operations as defined by a target machine to create new, 26 | higher-level operations to express quantum computation. 27 | In this way, Q# makes it very easy to express the logic underlying quantum and hybrid quantum-classical 28 | algorithms, while also being very general with respect to the structure of a target machine and its 29 | realization of quantum state. 30 | 31 | Within Q# itself, there is no type or construct in Q# that represents the quantum state. 32 | Instead, a qubit represents the smallest addressable physical unit in a quantum computer. 33 | As such, a qubit is a long-lived item, so Q# has no need for linear types. 34 | Hence, we don't explicitly refer to the state within Q#, 35 | but rather describe how the state is transformed by the program, for example, via the application of operations such as `X` and `H`. 36 | Similar to how a graphics shader program accumulates a description of transformations to each vertex, a quantum program in Q# accumulates transformations to quantum states, 37 | represented as entirely opaque references to the internal structure of a target machine. 38 | 39 | A Q# program has no ability to introspect into the state of a qubit, 40 | and thus is entirely agnostic about what a quantum state is or on how it is realized. 41 | Rather, a program can call operations such as `Measure` to learn information about the quantum state of the computation. 42 | 43 | ## Pauli 44 | 45 | Values of type `Pauli` specify a single-qubit Pauli operator; the possibilities are `PauliI`, `PauliX`, `PauliY`, and `PauliZ`. `Pauli` values are used primarily to specify the basis for a quantum measurement. 46 | 47 | ## Result 48 | 49 | The `Result` type specifies the result of a quantum measurement. Q# mirrors most quantum hardware by providing measurements in products of single-qubit Pauli operators; a `Result` of `Zero` indicates that the +1 eigenvalue was measured, and a `Result` of `One` indicates that the -1 eigenvalue was measured. That is, Q# represents eigenvalues by the power to which -1 is raised. 50 | This convention is more common in the quantum algorithms community, as it maps more closely to classical bits. 51 | -------------------------------------------------------------------------------- /articles/user-guide/language/uid-map.csv: -------------------------------------------------------------------------------- 1 | 1_ProgramStructure/1_Namespaces.md,microsoft.quantum.qsharp.namespaces 2 | 1_ProgramStructure/2_TypeDeclarations.md,microsoft.quantum.qsharp.typedeclarations 3 | 1_ProgramStructure/3_CallableDeclarations.md,microsoft.quantum.qsharp.callabledeclarations 4 | 1_ProgramStructure/4_SpecializationDeclarations.md,microsoft.quantum.qsharp.specializationdeclarations 5 | 1_ProgramStructure/5_Attributes.md,microsoft.quantum.qsharp.programstructure-overview 6 | 1_ProgramStructure/6_AccessModifiers.md,microsoft.quantum.qsharp.programstructure-overview 7 | 1_ProgramStructure/7_Comments.md,microsoft.quantum.qsharp.comments 8 | 1_ProgramStructure/README.md,microsoft.quantum.qsharp.programstructure-overview 9 | 1_ProgramStructure,microsoft.quantum.qsharp.programstructure-overview 10 | 2_Statements/VariableDeclarationsAndReassignments.md,microsoft.quantum.qsharp.variabledeclarationsandreassignments 11 | 3_Expressions/ReturnsAndTermination.md,microsoft.quantum.qsharp.returnsandtermination 12 | 2_Statements/QuantumMemoryManagement.md,microsoft.quantum.qsharp.quantummemorymanagement 13 | 2_Statements/README.md,microsoft.quantum.qsharp.statements-overview 14 | 3_Expressions/Iterations.md,microsoft.quantum.qsharp.iterations 15 | 3_Expressions/Conjugations.md,microsoft.quantum.qsharp.conjugations 16 | 3_Expressions/ConditionalLoops.md,microsoft.quantum.qsharp.conditionalloops 17 | 3_Expressions/ConditionalBranching.md,microsoft.quantum.qsharp.conditionalbranching 18 | 3_Expressions/CallExpressions.md,microsoft.quantum.qsharp.callstatements 19 | 2_Statements/BindingScopes.md,microsoft.quantum.qsharp.bindingscopes 20 | 2_Statements,microsoft.quantum.qsharp.statements-overview 21 | 3_Expressions/ValueLiterals.md,microsoft.quantum.qsharp.valueliterals 22 | 3_Expressions/PrecedenceAndAssociativity.md,microsoft.quantum.qsharp.precedenceandassociativity 23 | 3_Expressions/Closures.md,microsoft.quantum.qsharp.closures 24 | 3_Expressions/LogicalExpressions.md,microsoft.quantum.qsharp.logicalexpressions 25 | 3_Expressions/ItemAccessExpressions.md,microsoft.quantum.qsharp.itemaccessexpression 26 | 3_Expressions/README.md,microsoft.quantum.qsharp.expressions-overview 27 | 3_Expressions/Identifiers.md,microsoft.quantum.qsharp.expressions-overview 28 | 3_Expressions/FunctorApplication.md,microsoft.quantum.qsharp.functorapplication 29 | 3_Expressions/CopyAndUpdateExpressions.md,microsoft.quantum.qsharp.copyandupdateexpressions 30 | 3_Expressions/ContextualExpressions.md,microsoft.quantum.qsharp.contextualexpressions 31 | 3_Expressions/ConditionalExpressions.md,microsoft.quantum.qsharp.conditionalexpressions 32 | 3_Expressions/Concatentation.md,microsoft.quantum.qsharp.concatenationexpressions 33 | 3_Expressions/ComparativeExpressions.md,microsoft.quantum.qsharp.comparativeexpressions 34 | 3_Expressions/BitwiseExpressions.md,microsoft.quantum.qsharp.bitwiseexpressions 35 | 3_Expressions/ArithmeticExpressions.md,microsoft.quantum.qsharp.arithmeticexpressions 36 | 3_Expressions,microsoft.quantum.qsharp.expressions-overview 37 | 4_TypeSystem/TypeParameterizations.md,microsoft.quantum.qsharp.typeparameterizations 38 | 4_TypeSystem/TypeInference.md,microsoft.quantum.qsharp.typeinference 39 | 4_TypeSystem/SubtypingAndVariance.md,microsoft.quantum.qsharp.subtypingandvariance 40 | 4_TypeSystem/SingletonTupleEquivalence.md,microsoft.quantum.qsharp.singletontupleequivalence 41 | 4_TypeSystem/QuantumDataTypes.md,microsoft.quantum.qsharp.quantumdatatypes 42 | 4_TypeSystem/OperationsAndFunctions.md,microsoft.quantum.qsharp.operationsandfunctions 43 | 4_TypeSystem/README.md,microsoft.quantum.qsharp.typesystem-overview 44 | 4_TypeSystem/Immutability.md,microsoft.quantum.qsharp.immutability 45 | 4_TypeSystem,microsoft.quantum.qsharp.typesystem-overview 46 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/conditionalloops.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about conditional loops in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/18/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Conditional loops in Q# 11 | uid: microsoft.quantum.qsharp.conditionalloops 12 | --- 13 | 14 | # Conditional loops 15 | 16 | Like most classical programming languages, Q# supports loops that break based on a condition: loops for which the number of iterations is unknown and may vary from run to run. Since the instruction sequence is unknown at compile-time, the compiler handles these conditional loops in a particular way in a quantum runtime. 17 | 18 | > [!IMPORTANT] 19 | > **Quantum hardware restrictions** 20 | > 21 | > Loops that break based on a condition are challenging to process on quantum hardware *if the condition depends on measurement outcomes*, since the length of the instruction sequence to run isn't known ahead of time. 22 | > 23 | > Despite their common presence in particular classes of quantum algorithms, current hardware doesn't yet provide native support for these kinds of control flow constructs. Running these kinds of loops on quantum hardware can potentially be supported in the future by imposing a maximum number of iterations, or as other hardware support becomes available. Quantum simulators, however, run any loops based on measurements. 24 | 25 | ## Compiling loops 26 | 27 | As long as the condition doesn't depend on quantum measurements, conditional loops are processed with a just-in-time compilation before sending the instruction sequence to the quantum processor. In particular, using conditional loops within functions is unproblematic since code within functions can always run on conventional (non-quantum) hardware. Q#, therefore, supports the use of traditional `while` loops within functions. 28 | 29 | 30 | ## Repeat expression 31 | 32 | When you run programs on quantum simulators, Q# allows you to express control flow that depends on the results of quantum measurements. 33 | This capability enables probabilistic implementations that can significantly reduce computational costs. 34 | A common example is the *repeat-until-success* pattern, which repeats a computation until a certain condition - which usually depends on a measurement - is satisfied. Such `repeat` loops are widely used in particular classes of quantum algorithms. Q# hence has a dedicated language construct to express them, despite that they still pose a challenge for execution on quantum hardware. 35 | 36 | 37 | 38 | The `repeat` expression takes the following form 39 | 40 | ```qsharp 41 | repeat { 42 | // ... 43 | } 44 | until condition 45 | fixup { 46 | // ... 47 | } 48 | ``` 49 | 50 | or alternatively 51 | 52 | ```qsharp 53 | repeat { 54 | // ... 55 | } 56 | until condition; 57 | ``` 58 | 59 | where `condition` is an arbitrary expression of type `Bool`. 60 | 61 | The `repeat` loop runs a block of statements before evaluating a condition. If the condition evaluates to true, the loop exits. If the condition evaluates to false, an additional block of statements defined as part of an optional `fixup` block, if present, is run before entering the next loop iteration. 62 | 63 | ## While loop 64 | 65 | A more familiar-looking loop for classical computations is the `while` loop, which consists of the keyword `while`, an expression of type `Bool`, and a statement block. 66 | For example, if `arr` is an array of positive integers, 67 | 68 | ```qsharp 69 | mutable (item, index) = (-1, 0); 70 | while index < Length(arr) && item < 0 { 71 | item = arr[index]; 72 | index += 1; 73 | } 74 | ``` 75 | 76 | The statement block is run as long as the condition evaluates to `true`. 77 | 78 | -------------------------------------------------------------------------------- /articles/user-guide/language/ProgramStructure/comments.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn how to use comments in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 08/15/2024 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Comments in Q# 11 | uid: microsoft.quantum.qsharp.comments 12 | --- 13 | 14 | # Comments 15 | 16 | Comments begin with two forward slashes (`//`) and continue until the end of line. 17 | Such end-of-line comments may appear anywhere in the source code. 18 | Q# does not currently support block comments. 19 | 20 | ## Documentation Comments 21 | 22 | Comments that begin with three forward slashes, `///`, 23 | are treated specially by the compiler when they appear before a type or callable declaration. 24 | In that case, their contents are taken as documentation for the defined 25 | type or callable, as for other .NET languages. 26 | 27 | Within `///` comments, text to appear as a part of API documentation is 28 | formatted as [Markdown](https://daringfireball.net/projects/markdown/syntax), 29 | with different parts of the documentation indicated by specially-named 30 | headers. 31 | As an extension to Markdown, cross-references to operations, functions, and 32 | struct types in Q# can be included using `@"<ref target>,"` 33 | where `<ref target>` is replaced by the fully qualified name of the 34 | code object being referenced. 35 | Optionally, a documentation engine may also support additional 36 | Markdown extensions. 37 | 38 | For example: 39 | 40 | ```qsharp 41 | /// # Summary 42 | /// Given an operation and a target for that operation, 43 | /// applies the given operation twice. 44 | /// 45 | /// # Input 46 | /// ## op 47 | /// The operation to be applied. 48 | /// ## target 49 | /// The target to which the operation is to be applied. 50 | /// 51 | /// # Type Parameters 52 | /// ## 'T 53 | /// The type expected by the given operation as its input. 54 | /// 55 | /// # Example 56 | /// ```Q# 57 | /// // Should be equivalent to the identity. 58 | /// ApplyTwice(H, qubit); 59 | /// ``` 60 | /// 61 | /// # See Also 62 | /// - Microsoft.Quantum.Intrinsic.H 63 | operation ApplyTwice<'T>(op : ('T => Unit), target : 'T) : Unit { 64 | op(target); 65 | op(target); 66 | } 67 | ``` 68 | 69 | Q# recognizes the following names as documentation comment headers. 70 | 71 | - **Summary**: A short summary of a function or operation's behavior 72 | or the purpose of a type. The first paragraph of the summary is used 73 | for hover information. It should be plain text. 74 | - **Description**: A description of a function or operation's behavior 75 | or the purpose of a type. The summary and description are concatenated to 76 | form the generated documentation file for the function, operation, or type. 77 | The description may contain in-line LaTeX-formatted symbols and equations. 78 | - **Input**: A description of the input tuple for an operation or function. 79 | May contain additional Markdown subsections indicating each element of the input tuple. 80 | - **Output**: A description of the tuple returned by an operation or function. 81 | - **Type Parameters**: An empty section that contains one additional 82 | subsection for each generic type parameter. 83 | - **Named Items**: A description of the named items in a struct type. 84 | May contain additional Markdown subsections with the description for each named item. 85 | - **Example**: A short example of the operation, function, or type in use. 86 | - **Remarks**: Miscellaneous prose describing some aspect of the operation, 87 | function, or type. 88 | - **See Also**: A list of fully qualified names indicating related functions, 89 | operations, or struct types. 90 | - **References**: A list of references and citations for the documented item. 91 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/copyandupdateexpressions.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn how to use copy-and-update expressions in Q#. 4 | ms.author: quantumdocwriters 5 | ms.date: 08/15/2024 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Copy-and-update expressions in Q# 11 | uid: microsoft.quantum.qsharp.copyandupdateexpressions 12 | --- 13 | 14 | # Copy-and-update expressions 15 | 16 | To reduce the need for mutable bindings, Q# supports copy-and-update expressions for arrays, which allow you to access items via an index or range of indices. 17 | 18 | Copy-and-update expressions instantiate a new array with all items set to the corresponding value in the original array, except the certain specified items, which are set to the ones defined on the right-hand side of the expression. 19 | They are constructed using a ternary operator `w/` `<-`; the syntax `w/` should be read as the commonly used short notation for "with": 20 | 21 | ```qsharp 22 | original w/ itemAccess <- modification 23 | ``` 24 | 25 | where `original` is an array expression, `itemAccess` is any expression that is valid for array slicing, and `modification` is the new value or values. Concretely, the `itemAccess` expression can be of type `Int` or `Range`. If `itemAccess` is a value of type `Int`, then the type of `modification` has to match the item type of the array. If `itemAccess` is a value of type `Range`, then the type of `modification` has to be the same as the array type. 26 | 27 | For example, if `arr` contains an array `[0, 1, 2, 3]`, then 28 | 29 | - `arr w/ 0 <- 10` is the array `[10, 1, 2, 3]`. 30 | - `arr w/ 2 <- 10` is the array `[0, 1, 10, 3]`. 31 | - `arr w/ 0..2..3 <- [10, 12]` is the array `[10, 1, 12, 3]`. 32 | 33 | In terms of precedence, the copy-and-update operator is left-associative and has lowest precedence, and, in particular, lower precedence than the range operator (`..`) or the ternary conditional operator (`?` `|`). 34 | The chosen left associativity allows easy chaining of copy-and-update expressions: 35 | 36 | ```qsharp 37 | let model = ArrayConstructor() 38 | w/ 1 <- alpha 39 | w/ 3 <- gamma 40 | w/ 5 <- epsilon; 41 | ``` 42 | 43 | As for any operator that constructs an expression of the same type as the left-most expression involved, the corresponding [evaluate-and-reassign statement](xref:microsoft.quantum.qsharp.variabledeclarationsandreassignments#evaluate-and-reassign-statements) is available. 44 | The two following statements, for example, achieve the following: The first statement declares a mutable variable `arr` and binds it to the default value of an integer array. The second statement then builds a new array with the first item (with index 0) set to 10 and reassigns it to `arr`. 45 | 46 | ```qsharp 47 | mutable arr = [0, size = 3]; // arr contains [0, 0, 0] 48 | arr w/= 0 <- 10; // arr contains [10, 0, 0] 49 | ``` 50 | 51 | The second statement is just short-hand for the more verbose syntax `arr = arr w/ 0 <- 10;`. 52 | 53 | Copy-and-update expressions allow the efficient creation of new arrays based on existing ones. 54 | The implementation for copy-and-update expressions avoids copying the entire array 55 | by duplicating only the necessary parts to achieve the desired behavior and performs an in-place modification if possible. Hence, array initializations do not incur additional overhead due to immutability. 56 | 57 | The `Std.Arrays` namespace provides an arsenal of convenient tools for array creation and manipulation. 58 | 59 | Copy-and-update expressions are a convenient way to construct new arrays on the fly; 60 | the following expression, for example, evaluates to an array with all items set to `PauliI`, except the item at index `i`, which is set to `PauliZ`: 61 | 62 | ```qsharp 63 | [PauliI, size = n] w/ i <- PauliZ 64 | ``` 65 | -------------------------------------------------------------------------------- /articles/user-guide/language/ProgramStructure/namespaces.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about how namespaces are used in the Q# programming language. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/18/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Namespaces in Q# 11 | uid: microsoft.quantum.qsharp.namespaces 12 | --- 13 | 14 | # Namespaces 15 | 16 | At its top-level, a Q# program consists of a set of namespaces. Aside from [comments](xref:microsoft.quantum.qsharp.comments#comments), namespaces are the only top-level elements in a Q# program, and any other elements must reside within a namespace. 17 | Each file may contain zero or more namespaces, and each namespace may span multiple files. Q# does not support nested namespaces. 18 | 19 | > [!NOTE] 20 | > If you do not explicitly declare a namespace, the Q# compiler uses the filename as the namespace name. 21 | 22 | A namespace block consists of the keyword `namespace`, followed by the namespace name, and the content of the block inside braces `{ }`. 23 | Namespace names consist of a sequence of one or more [legal symbols](xref:microsoft.quantum.qsharp.expressions-overview#identifiers) separated by a dot (`.`). 24 | While namespace names may contain dots for better readability, Q# does not support relative references to namespaces. For example, two namespaces `Foo` and `Foo.Bar` are unrelated, and there is no notion of a hierarchy. In particular, for a function `Baz` defined in `Foo.Bar`, it is *not* possible to open `Foo` and then access that function via `Bar.Baz`. 25 | 26 | Namespace blocks may contain [import directives](#import-directives), [operations](xref:microsoft.quantum.qsharp.callabledeclarations#callable-declarations), [functions](xref:microsoft.quantum.qsharp.callabledeclarations#callable-declarations), and [type](xref:microsoft.quantum.qsharp.typedeclarations#type-declarations) declarations. These elements may occur in any order and are recursive by default, meaning they can be declared and used in any order and can call themselves. There is no need for the declaration of a type or callable to precede its use. 27 | 28 | ## Import Directives 29 | 30 | By default, everything declared within the same namespace can be accessed without further qualification. However, declarations in a different namespace can only be used by qualifying their name with the name of the namespace they belong to or by opening that namespace before it is used, as shown in the following example. 31 | 32 | ```qsharp 33 | namespace Microsoft.Quantum.Samples { 34 | 35 | import Microsoft.Quantum.Arithmetic.*; 36 | import Microsoft.Quantum.Arrays.* as Array; 37 | 38 | // ... 39 | } 40 | ``` 41 | 42 | > [!NOTE] 43 | > For namespaces in the standard Q# library, the root of the namespace may be simplified to `Std`. For example, the previous example could be rewritten as: 44 | > ```qsharp 45 | > import Std.Arithmetic.*; 46 | > import Std.Arrays.* as Array; 47 | > ``` 48 | 49 | 50 | The example uses an `import` directive to import all types and callables declared in the `Microsoft.Quantum.Arithmetic` namespace. You can then refer to them by their unqualified name unless that name conflicts with a declaration in the namespace block or another opened namespace. 51 | 52 | To avoid typing out the full name while still distinguishing where certain elements come from, you can define an alternative name, or *alias*, for a particular namespace. In this case, you can qualify all types and callables declared in that namespace by the defined short name instead. 53 | The previous example uses an alias for the `Microsoft.Quantum.Arrays` namespace. You can then use the function `IndexRange`, declared in `Microsoft.Quantum.Arrays`, for example, via `Array.IndexRange` within that namespace block. 54 | 55 | Whether you are opening a namespace or defining an alias, `import` directives are valid throughout the namespace piece in that file only. 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/functorapplication.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn how to use functors with callables in Q#. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/01/2021 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Functors in Q# 11 | uid: microsoft.quantum.qsharp.functorapplication 12 | --- 13 | 14 | # Functor application 15 | 16 | Functors are factories that allow you to access particular specialization implementations of a callable. Q# currently supports two functors; the `Adjoint` and the `Controlled`, both of which can be applied to operations that provide the necessary specializations. 17 | 18 | The `Controlled` and `Adjoint` functors commute; if `ApplyUnitary` is an operation that supports both functors, then there is no difference between `Controlled Adjoint ApplyUnitary` and `Adjoint Controlled ApplyUnitary`. 19 | Both have the same type and, upon invocation, execute the implementation defined for the `controlled adjoint` [specialization](xref:microsoft.quantum.qsharp.specializationdeclarations#specialization-declarations). 20 | 21 | ## Adjoint functor 22 | 23 | If the operation `ApplyUnitary` defines a unitary transformation *U* of the quantum state, `Adjoint ApplyUnitary` accesses the implementation of *U†*. The `Adjoint` functor is its own inverse, since *(U†)† = U* by definition. For example, `Adjoint Adjoint ApplyUnitary` is the same as `ApplyUnitary`. 24 | 25 | The expression `Adjoint ApplyUnitary` is an operation of the same type as `ApplyUnitary`; it has the same argument and return type and supports the same functors. Like any operation, it can be invoked with an argument of suitable type. The following expression applies the [adjoint specialization](xref:microsoft.quantum.qsharp.specializationdeclarations#specialization-declarations) of `ApplyUnitary` to an argument `arg`: 26 | 27 | ```qsharp 28 | Adjoint ApplyUnitary(arg) 29 | ``` 30 | 31 | ## Controlled functor 32 | 33 | For an operation `ApplyUnitary` that defines a unitary transformation *U* of the quantum state, `Controlled ApplyUnitary` accesses the implementation that applies *U* conditional on all qubits in an array of control qubits being in the |1⟩ state. 34 | 35 | The expression `Controlled ApplyUnitary` is an operation with the same return type and [operation characteristics](xref:microsoft.quantum.qsharp.operationsandfunctions#operation-characteristics) as `ApplyUnitary`, meaning it supports the same functors. 36 | It takes an argument of type `(Qubit[], <TIn>)`, where `<TIn>` should be replaced with the argument type of `ApplyUnitary`, taking [singleton tuple equivalence](xref:microsoft.quantum.qsharp.singletontupleequivalence#singleton-tuple-equivalence) into account. 37 | 38 | | Operation | Argument Type | Controlled Argument Type | 39 | | --- | --- | --- | 40 | | X | `Qubit` | `(Qubit[], Qubit)` | 41 | | SWAP | `(Qubit, Qubit)` | `(Qubit[], (Qubit, Qubit))` | 42 | 43 | Concretely, if `cs` contains an array of qubits, `q1` and `q2` are two qubits, and the operation `SWAP` is as defined [here](xref:microsoft.quantum.qsharp.specializationdeclarations#specialization-declarations), then the following expression exchanges the state of `q1` and `q2` if all qubits in `cs` are in the |1⟩ state: 44 | 45 | ```qsharp 46 | Controlled SWAP(cs, (q1, q2)) 47 | ``` 48 | 49 | >[!NOTE] 50 | > Conditionally applying an operation based on the control qubits being in a state other than the |1⟩ state may be achieved by applying the appropriate adjointable transformation to the control qubits before invocation, and applying the inverses after. Conditioning the transformation on all control qubits being in the |0⟩ state, for example, can be achieved by applying the `X` operation before and after. This can be conveniently expressed using a [conjugation](xref:microsoft.quantum.qsharp.conjugations#conjugations). Nonetheless, the verbosity of such a construct may merit additional support for a more compact syntax in the future. 51 | 52 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/contextualexpressions.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about types of expressions in Q# that only valid in certain contexts or that can be inferred automatically. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/18/2025 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Contextual and omitted expressions in Q# 11 | uid: microsoft.quantum.qsharp.contextualexpressions 12 | --- 13 | 14 | # Contextual and omitted expressions 15 | 16 | Contextual expressions are expressions that are only valid in certain contexts, such as the use of item names in [copy-and-update expressions](xref:microsoft.quantum.qsharp.copyandupdateexpressions#copy-and-update-expressions) without having to qualify them. 17 | 18 | Expressions can be *omitted* when they can be inferred and automatically inserted by the compiler, such as [evaluate-and-reassign statements](xref:microsoft.quantum.qsharp.variabledeclarationsandreassignments#evaluate-and-reassign-statements). 19 | 20 | Open-ended ranges are another example that applies to both contextual and omitted expressions. They are valid only within a certain context, and the compiler translates them into normal `Range` expressions during compilation by inferring suitable boundaries. 21 | 22 | A value of type `Range` generates a sequence of integers, specified by a start value, a step value (optional), and an end value. For example, the `Range` literal expression `1..3` generates the sequence 1,2,3. Likewise, the expression `3..-1..1` generates the sequence 3,2,1. You can also use ranges to create a new array from an existing one by slicing, for example: 23 | 24 | ```qsharp 25 | let arr = [1,2,3,4]; 26 | let slice1 = arr[1..2..4]; // contains [2,4] 27 | let slice2 = arr[2..-1..0]; // contains [3,2,1] 28 | ``` 29 | 30 | You cannot define an infinite range in Q#; the start and end values always need to be specified. The only exception is when you use a `Range` to slice an array. In that case, the compiler can reasonably infer the start or end values of the range. 31 | 32 | In the previous array slicing examples, it is reasonable for the compiler to assume that the intended range end should be the index of the last item in the array if the step size is positive. If the step size is negative, then the range end likely should be the index of the first item in the array, `0`. The converse holds for the start of the range. 33 | 34 | To summarize, if you omit the range start value, the inferred start value 35 | 36 | - is zero if no step is specified or the specified step is positive. 37 | - is the length of the array minus one if the specified step is negative. 38 | 39 | If you omit the range end value, the inferred end value 40 | 41 | - is the length of the array minus one if no step is specified or the specified step is positive. 42 | - is zero if the specified step is negative. 43 | 44 | Q# hence allows the use of open-ended ranges within array slicing expressions, for example: 45 | 46 | ```qsharp 47 | let arr = [1,2,3,4,5,6]; 48 | let slice1 = arr[3...]; // slice1 is [4,5,6]; 49 | let slice2 = arr[0..2...]; // slice2 is [1,3,5]; 50 | let slice3 = arr[...2]; // slice3 is [1,2,3]; 51 | let slice4 = arr[...2..3]; // slice4 is [1,3]; 52 | let slice5 = arr[...2...]; // slice5 is [1,3,5]; 53 | let slice7 = arr[4..-2...]; // slice7 is [5,3,1]; 54 | let slice8 = arr[...-1..3]; // slice8 is [6,5,4]; 55 | let slice9 = arr[...-1...]; // slice9 is [6,5,4,3,2,1]; 56 | let slice10 = arr[...]; // slice10 is [1,2,3,4,5,6]; 57 | ``` 58 | 59 | Since the determination of whether the range step is positive or negative happens at runtime, the compiler inserts a suitable expression that is evaluated at runtime. For omitted end values, the inserted expression is `step < 0 ? 0 | Length(arr)-1`, and for omitted start values it is `step < 0 ? Length(arr)-1 | 0`, where `step` is the expression given for the range step, or `1` if no step is specified. 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /articles/resource-estimator-quantum-safe-planning.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn how to use the Resource Estimator to estimate the resources needed for a future scaled quantum computer to break a particular encryption algorithm. 4 | ms.date: 09/10/2024 5 | ms.author: quantumdocwriters 6 | ms.service: azure-quantum 7 | ms.subservice: qdk 8 | ms.topic: how-to 9 | no-loc: ['Q#', '$$v', target, targets] 10 | title: Resource Estimator for Analyzing Cryptography 11 | uid: microsoft.quantum.resource-estimator-cryptography 12 | 13 | #customer intent: As a quantum developer, I want to use the Resource Estimator to estimate the resources needed for a future scaled quantum computer to break a particular encryption algorithm, so that I can analyze the impact of quantum computing on the security of some classical encryption methods and prepare for a quantum-safe future. 14 | --- 15 | 16 | # Analyze cryptographic protocols with the Resource Estimator 17 | 18 | The [Azure Quantum Resource Estimator](xref:microsoft.quantum.overview.intro-resource-estimator) is available on the [Microsoft Quantum website](https://quantum.microsoft.com/tools/quantum-cryptography) to estimate the resources needed for a future scaled quantum computer to break a particular encryption algorithm. This tool helps you to analyze the impact of quantum computing on the security of some classical encryption methods, and prepare for a quantum-safe future. 19 | 20 | > [!NOTE] 21 | > To access the Resource Estimator on the [Microsoft Quantum website](https://quantum.microsoft.com/tools/quantum-cryptography) you only need a Microsoft account. 22 | 23 | The Resource Estimator for quantum-safe planning takes a set of four target parameters as input: 24 | 25 | - **Classical encryption algorithm,** which are Rivest-Shamir-Adleman (RSA), Elliptic Curve Cryptography (ECC), and Advanced Encryption Standard (AES). 26 | - **Key strength,** which are standard, enhanced, and highest. 27 | - **Qubit type,** which are topological and superconducting. 28 | - **Qubit error rate,** which are reasonable and optimistic. 29 | 30 | ## Use the Resource Estimator for quantum-safe planning 31 | 32 | To use the Resource Estimator for quantum-safe planning, go to the [Microsoft Quantum website](https://quantum.microsoft.com/tools/quantum-cryptography). 33 | 34 | 1. Click on the **arrows** to switch between different selections of preset input parameters. See that the fields are populated for you. 35 | 1. Click **Ask Copilot** if you want to know more about the resource estimation data. 36 | 1. Click **Download** to download the plot of the resource estimation job. 37 | 1. You can also **customize the parameters** of the encryption algorithm. You need to select *at least* one option for each input parameter. You can select multiple combinations of parameters and compare their security against quantum computers. 38 | 1. The results are displayed in a **plot** that shows the number of qubits and the runtime that a quantum computer with the selected architecture would need to break the encryption algorithm. **Hover over** the points of the plot to see more information about the resource estimates. 39 | 1. At any point, you can **ask Copilot a question** about cryptography, resource estimation, or quantum computing. 40 | 41 | :::image type="content" source="media/quantum-cryptography-qcom.png" alt-text="Screenshot of the quantum cryptography experience in the Microsoft Quantum website. The picture displays the input parameters that constitute the encryption algorithm and the resulting plot of the resource estimation job."::: 42 | 43 | ## Next steps 44 | 45 | - [Understand the results of the Resource Estimator](xref:microsoft.quantum.overview.resources-estimator-output.data) 46 | - [Different ways to run the Resource Estimator](xref:microsoft.quantum.submit-resource-estimation-jobs) 47 | - [Customize resource estimates to machine characteristics](xref:microsoft.quantum.overview.resources-estimator) 48 | - [Tutorial: Estimate the resources of a quantum chemistry problem](xref:microsoft.quantum.tutorial.resource-estimator.chemistry) 49 | -------------------------------------------------------------------------------- /articles/user-guide/language/Expressions/itemaccessexpressions.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | description: Learn about array item access and array slicing in Q#. 4 | ms.author: quantumdocwriters 5 | ms.date: 02/01/2021 6 | ms.service: azure-quantum 7 | ms.subservice: qsharp-guide 8 | ms.topic: reference 9 | no-loc: ['Q#', '$$v'] 10 | title: Item access in Q# 11 | uid: microsoft.quantum.qsharp.itemaccessexpression 12 | --- 13 | 14 | # Item access 15 | 16 | Q# supports item access for array items and for `struct` types. In both cases, the access is read-only; the value cannot be changed without creating a new instance using a [copy-and-update expression](xref:microsoft.quantum.qsharp.copyandupdateexpressions#copy-and-update-expressions). 17 | 18 | ## Array item access and array slicing 19 | 20 | Given an array expression and an expression of type `Int` or `Range`, a new expression may be formed using the array item access operator consisting of `[` and `]`. 21 | 22 | If the expression inside the brackets is of type `Int`, then the new expression contains the array item at that index. 23 | For example, if `arr` is of type `Double[]` and contains five or more items, then `arr[4]` is an expression of type `Double`. 24 | 25 | If the expression inside the brackets is of type `Range`, then the new expression contains an array of all the items indexed by the specified `Range`. If the `Range` is empty, then the resulting array is empty. 26 | For example, 27 | 28 | ```qsharp 29 | let arr = [10, 11, 36, 49]; 30 | let ten = arr[0]; // contains the value 10 31 | let odds = arr[1..2..4]; // contains the value [11, 49] 32 | let reverse = arr[...-1...]; // contains the value [49, 36, 11, 10] 33 | ``` 34 | 35 | In the last line of the example, the start and end value of the range have been omitted for convenience. For more information, see [Contextual expressions](xref:microsoft.quantum.qsharp.contextualexpressions#contextual-and-omitted-expressions). 36 | 37 | If the array expression is not a simple identifier, it must be enclosed in parentheses in order to extract an item or a slice. 38 | For instance, if `arr1` and `arr2` are both arrays of integers, an item from the concatenation would be expressed as `(arr1 + arr2)[13]`. For more information, see [Precedence and associativity](xref:microsoft.quantum.qsharp.precedenceandassociativity#precedence-and-associativity). 39 | 40 | All arrays in Q# are zero-based, that is, the first element of an array `arr` is always `arr[0]`. 41 | An exception is thrown at runtime if the index or one of the indices used for slicing is outside the bounds of the array, for example, if it is less than zero or larger or equal to the length of the array. 42 | 43 | ## Item access for struct types 44 | 45 | The contained items in a `struct` can be accessed two ways: 46 | 47 | - By reference, using a period (`.`) 48 | - By deconstruction, using the `unwrap` (`!`) operator. 49 | 50 | For example, given the struct `Complex` 51 | 52 | ```qsharp 53 | struct Complex { 54 | Real : Double, 55 | Imaginary : Double, 56 | } 57 | 58 | // create an instance of type Complex 59 | let complex = Complex(1., 0.); 60 | 61 | // item access via deconstruction 62 | let (re, _) = complex!; 63 | 64 | // item access via name reference 65 | let im = complex.Imaginary; 66 | ``` 67 | 68 | Access via deconstruction makes use of the unwrap operator (`!`). The unwrap operator returns a tuple of all contained items, where the shape of the tuple matches the one defined in the declaration, and a single item tuple is equivalent to the item itself (see [this section](xref:microsoft.quantum.qsharp.singletontupleequivalence#singleton-tuple-equivalence)). 69 | 70 | The `!` operator has lower [precedence](xref:microsoft.quantum.qsharp.precedenceandassociativity#modifiers-and-combinators) than both item access operators, but higher precedence than any other operator. For a complete list of precedences, see [Precedence and associativity](xref:microsoft.quantum.qsharp.precedenceandassociativity#precedence-and-associativity). 71 | 72 | For more information on deconstruction syntax, see [Variable declarations and reassignments](xref:microsoft.quantum.qsharp.variabledeclarationsandreassignments). 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /articles/includes/quickstart-provider-include-quantinuum.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: azure-quantum-content 3 | ms.author: quantumdocwriters 4 | ms.date: 09/26/2022 5 | ms.service: azure-quantum 6 | ms.subservice: qdk 7 | ms.topic: include 8 | --- 9 | 10 | ## Load the required imports 11 | 12 | First, run the following cell to load the required imports: 13 | 14 | ```python 15 | from azure.quantum import Workspace 16 | ``` 17 | 18 | ## Connect to the Azure Quantum service 19 | 20 | To connect to the Azure Quantum service, your program will need the resource ID and the 21 | location of your Azure Quantum workspace. Log in to your Azure account, 22 | <https://portal.azure.com>, navigate to your Azure Quantum workspace, and 23 | copy the values from the header. 24 | 25 | ![How to retrieve the resource ID and location from an Azure Quantum workspace](../media/azure-quantum-resource-id.png) 26 | 27 | Paste the values into the following `Workspace` constructor to 28 | create a `workspace` object that connects to your Azure Quantum workspace. 29 | 30 | ```python 31 | workspace = Workspace( 32 | resource_id="", 33 | location="" 34 | ) 35 | ``` 36 | 37 | ## Submit a quantum circuit to the Quantinuum API validator 38 | 39 | 1. Create a quantum circuit in the [OpenQASM](https://en.wikipedia.org/wiki/OpenQASM) representation. For example, the following example creates a Teleportation circuit: 40 | 41 | ```py 42 | circuit = """OPENQASM 2.0; 43 | include "qelib1.inc"; 44 | qreg q[3]; 45 | creg c0[3]; 46 | h q[0]; 47 | cx q[0], q[1]; 48 | cx q[1], q[2]; 49 | measure q[0] -> c0[0]; 50 | measure q[1] -> c0[1]; 51 | measure q[2] -> c0[2]; 52 | """ 53 | ``` 54 | 55 | Optionally, you can load the circuit from a file: 56 | 57 | ```py 58 | with open("my_teleport.qasm", "r") as f: 59 | circuit = f.read() 60 | ``` 61 | 62 | 1. Submit the circuit to the Quantinuum target. The following example uses the Quantinuum API validator, which returns a `Job` object. For more information, see [Azure Quantum Job](xref:microsoft.quantum.optimization.job-reference). 63 | 64 | ```python 65 | target = workspace.get_targets(name="quantinuum.sim.h2-1sc") 66 | job = target.submit(circuit, num_shots=500) 67 | ``` 68 | 69 | 1. Wait until the job is complete and then fetch the results. 70 | 71 | ```python 72 | results = job.get_results() 73 | print(results) 74 | ``` 75 | 76 | ```output 77 | ........ 78 | {'c0': ['000', 79 | '000', 80 | '000', 81 | '000', 82 | '000', 83 | '000', 84 | '000', 85 | ... 86 | ]} 87 | ``` 88 | 89 | 1. You can then visualize the results using [Matplotlib](https://matplotlib.org/stable/users/installing/index.html). 90 | 91 | ```python 92 | import pylab as pl 93 | pl.hist(results["c0"]) 94 | pl.ylabel("Counts") 95 | pl.xlabel("Bitstring") 96 | ``` 97 | 98 | ![Quantinuum job output](../media/quantinuum-results.png) 99 | 100 | Looking at the histogram, you may notice that the random number generator returned 0 every time, which is not very random. This is because that, while the API Validator ensures that your code will run successfully on Quantinuum hardware, it also returns 0 for every quantum measurement. For a true random number generator, you need to run your circuit on quantum hardware. 101 | 102 | ## Estimate job cost 103 | 104 | Before running a job on the QPU, you can estimate how much it will cost to run. To estimate the cost of running a job on the QPU, you can use the `estimate_cost` method: 105 | 106 | ```python 107 | target = workspace.get_targets(name="quantinuum.qpu.h2-1") 108 | cost = target.estimate_cost(circuit, num_shots=500) 109 | 110 | print(f"Estimated cost: {cost.estimated_total}") 111 | ``` 112 | 113 | This prints the estimated cost in H-System Quantum Credits (HQCs). 114 | 115 | For the most current pricing details, see [Azure Quantum pricing](xref:microsoft.quantum.providers-pricing#quantinuum), or find your workspace and view pricing options in the "Provider" tab of your workspace via: [aka.ms/aq/myworkspaces](https://aka.ms/aq/myworkspaces). 116 | 117 | 118 | -------------------------------------------------------------------------------- /.github/actions/status-checker/src/status-checker.ts: -------------------------------------------------------------------------------- 1 | import { setFailed } from "@actions/core"; 2 | import { context, getOctokit } from "@actions/github"; 3 | import { wait } from "./wait"; 4 | 5 | export async function isSuccessStatus(token: string) { 6 | const octokit = getOctokit(token); 7 | const owner = context.repo.owner; 8 | const repo = context.repo.repo; 9 | const payload = context.payload; 10 | 11 | if ( 12 | ["pull_request", "pull_request_target"].includes(context.eventName) && 13 | payload?.action 14 | ) { 15 | const prNumber = payload.number; 16 | console.log({ prNumber }); 17 | 18 | const commit = payload.pull_request?.head.sha; 19 | console.log({ commit }); 20 | 21 | let buildStatus: any; 22 | 23 | const { data: statuses } = 24 | await octokit.rest.repos.listCommitStatusesForRef({ 25 | owner, 26 | repo, 27 | ref: commit, 28 | }); 29 | 30 | // Get the most recent OPS status. 31 | for (const status of statuses) { 32 | if (status.context === "OpenPublishing.Build") { 33 | buildStatus = status; 34 | console.log("Found OPS status check."); 35 | break; 36 | } 37 | } 38 | 39 | // Loop and wait if there's no OPS build status yet. 40 | // (This is unusual.) 41 | const loops = 30; 42 | for (let i = 0; i < loops && !buildStatus; i++) { 43 | // Sleep for 10 seconds. 44 | await wait(10000); 45 | 46 | const { data: statuses } = 47 | await octokit.rest.repos.listCommitStatusesForRef({ 48 | owner, 49 | repo, 50 | ref: commit, 51 | }); 52 | 53 | // Get the most recent OPS status. 54 | for (const status of statuses) { 55 | if (status.context === "OpenPublishing.Build") { 56 | buildStatus = status; 57 | console.log("Found OPS status check."); 58 | break; 59 | } 60 | } 61 | } 62 | 63 | // Didn't find OPS status. This is bad. 64 | if (!buildStatus) { 65 | setFailed( 66 | `Did not find OPS status check after waiting for ${(loops * 10) / 60 67 | } minutes. If it shows 'Expected — Waiting for status to be reported', close and reopen the pull request to trigger a build.` 68 | ); 69 | } 70 | 71 | // Check state of OPS status check. 72 | while (buildStatus.state === "pending") { 73 | console.log( 74 | "OPS status check is still pending; sleeping for 10 seconds." 75 | ); 76 | 77 | // Sleep for 10 seconds. 78 | await wait(10000); 79 | 80 | // Get latest OPS status. 81 | const { data: statuses } = 82 | await octokit.rest.repos.listCommitStatusesForRef({ 83 | owner, 84 | repo, 85 | ref: commit, 86 | }); 87 | 88 | buildStatus = null; 89 | for (const status of statuses) { 90 | if (status.context === "OpenPublishing.Build") { 91 | buildStatus = status; 92 | break; 93 | } 94 | } 95 | 96 | // This should never happen since if nothing else, 97 | // we'll find the OPS status we found initially. 98 | if (!buildStatus) { 99 | throw new Error("Did not find OPS status check."); 100 | } 101 | } 102 | 103 | // Status is no longer pending. 104 | console.log("OPS status check has completed."); 105 | 106 | if (buildStatus.state === "success") { 107 | if (buildStatus.description === "Validation status: warnings") { 108 | setFailed( 109 | "Please fix OPS build warnings before merging. To see the warnings, click 'Details' next to the OpenPublishing.build status check at the bottom of your pull request." 110 | ); 111 | } else { 112 | console.log( 113 | "OpenPublishing.Build status check does not have warnings." 114 | ); 115 | return true; 116 | } 117 | } else { 118 | // Build status is error/failure. 119 | setFailed( 120 | "OpenPublishing.Build status is either failure or error." 121 | ); 122 | } 123 | } else { 124 | setFailed( 125 | "Event is not a pull request or payload action is undefined." 126 | ); 127 | } 128 | 129 | return false; 130 | } 131 | -------------------------------------------------------------------------------- /articles/index.yml: -------------------------------------------------------------------------------- 1 | ### YamlMime:Landing 2 | 3 | title: Azure Quantum documentation 4 | summary: Learn about quantum computing with the Azure Quantum service. Use Python and Q#, a language for quantum programming, to create and submit quantum programs in the Azure portal, or set up your own local development environment with the Quantum Development Kit (QDK) to write quantum programs. 5 | metadata: 6 | title: Azure Quantum documentation, QDK & Q# programming language 7 | description: Learn quantum computing and develop your quantum programs with the Azure Quantum service. Use Python and Q#, a language for quantum programming, to write your quantum programs and submit them to the real quantum hardware available in Azure Quantum. With the Quantum Development Kit (QDK), you can set up your local development environment and benefit from several tools and libraries to write your quantum programs. 8 | ms.service: azure-quantum 9 | ms.topic: landing-page 10 | ms.collection: collection 11 | author: azure-quantum-content 12 | ms.author: quantumdocwriters 13 | ms.date: 02/24/2025 14 | 15 | 16 | # linkListType: architecture | concept | deploy | download | get-started | how-to-guide | learn | overview | quickstart | reference | tutorial | video | whats-new 17 | 18 | landingContent: 19 | 20 | # About Azure Quantum 21 | - title: About Azure Quantum 22 | linkLists: 23 | - linkListType: overview 24 | links: 25 | - text: What is Azure Quantum? 26 | url: overview-azure-quantum.md 27 | - text: Azure Quantum pricing plans 28 | url: pricing.md 29 | - linkListType: deploy 30 | links: 31 | - text: Create a quantum workspace 32 | url: how-to-create-workspace.md 33 | - linkListType: reference 34 | links: 35 | - text: List of quantum hardware providers 36 | url: qc-target-list.md 37 | - linkListType: training 38 | links: 39 | - text: Training path - Get started with Azure Quantum 40 | url: /training/paths/quantum-computing-fundamentals/ 41 | 42 | # Get started 43 | - title: Get started with Q# and the Quantum Development Kit 44 | linkLists: 45 | - linkListType: download 46 | links: 47 | - text: Set up the Quantum Development Kit 48 | url: install-overview-qdk.md 49 | - linkListType: overview 50 | links: 51 | - text: What is Q#? 52 | url: qsharp-overview.md 53 | - linkListType: quickstart 54 | links: 55 | - text: Create your first Q# program 56 | url: qsharp-quickstart.md 57 | - linkListType: tutorial 58 | links: 59 | - text: Create a quantum random number generator 60 | url: tutorial-qdk-quantum-random-number-generator.md 61 | - text: Explore quantum entanglement 62 | url: tutorial-qdk-explore-entanglement.md 63 | 64 | 65 | # Develop with QDK 66 | - title: Advanced development with the Quantum Development Kit 67 | linkLists: 68 | - linkListType: get-started 69 | links: 70 | - text: Different ways to run Q# programs 71 | url: qsharp-ways-to-work.md 72 | - linkListType: overview 73 | links: 74 | - text: Introduction to the Azure Quantum Resource Estimator 75 | url: intro-to-resource-estimation.md 76 | - text: Introduction to hybrid quantum computing 77 | url: hybrid-computing-overview.md 78 | 79 | 80 | 81 | # Concepts 82 | - title: Learn about quantum computing 83 | linkLists: 84 | - linkListType: concept 85 | links: 86 | - text: What is quantum computing? 87 | url: overview-understanding-quantum-computing.md 88 | - text: The qubit 89 | url: concepts-the-qubit.md 90 | - text: Vectors and matrices 91 | url: concepts-vectors-and-matrices.md 92 | - text: Dirac notation 93 | url: concepts-dirac-notation.md 94 | - text: Quantum circuits 95 | url: concepts-circuits.md 96 | - text: Quantum error correction 97 | url: concepts-error-correction.md 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /.github/actions/status-checker/__tests__/no-heading.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Phew, that worked! 3 | --- 4 | 5 | An h1 header 6 | ============ 7 | 8 | Paragraphs are separated by a blank line. 9 | 10 | 2nd paragraph. *Italic*, **bold**, and `monospace`. Itemized lists 11 | look like: 12 | 13 | * this one 14 | * that one 15 | * the other one 16 | 17 | Note that --- not considering the asterisk --- the actual text 18 | content starts at 4-columns in. 19 | 20 | > Block quotes are 21 | > written like so. 22 | > 23 | > They can span multiple paragraphs, 24 | > if you like. 25 | 26 | Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., "it's all 27 | in chapters 12--14"). Three dots ... will be converted to an ellipsis. 28 | Unicode is supported. ☺ 29 | 30 | An h2 header 31 | ------------ 32 | 33 | Here's a numbered list: 34 | 35 | 1. first item 36 | 2. second item 37 | 3. third item 38 | 39 | Note again how the actual text starts at 4 columns in (4 characters 40 | from the left side). Here's a code sample: 41 | 42 | # Let me re-iterate ... 43 | for i in 1 .. 10 { do-something(i) } 44 | 45 | As you probably guessed, indented 4 spaces. By the way, instead of 46 | indenting the block, you can use delimited blocks, if you like: 47 | 48 | ~~~ 49 | define foobar() { 50 | print "Welcome to flavor country!"; 51 | } 52 | ~~~ 53 | 54 | (which makes copying & pasting easier). You can optionally mark the 55 | delimited block for Pandoc to syntax highlight it: 56 | 57 | ~~~python 58 | import time 59 | for i in range(10): 60 | # (but not *too* quick) 61 | time.sleep(0.5) 62 | print i 63 | ~~~ 64 | 65 | ### An h3 header ### 66 | 67 | Now a nested list: 68 | 69 | 1. First, get these ingredients: 70 | 71 | * carrots 72 | * celery 73 | * lentils 74 | 75 | 2. Boil some water. 76 | 77 | 3. Dump everything in the pot and follow 78 | this algorithm: 79 | 80 | find wooden spoon 81 | uncover pot 82 | stir 83 | cover pot 84 | balance wooden spoon precariously on pot handle 85 | wait 10 minutes 86 | goto first step (or shut off burner when done) 87 | 88 | Do not bump wooden spoon or it will fall. 89 | 90 | Notice again how text always lines up on 4-space indents (including 91 | that last line which continues item 3 above). 92 | 93 | Here's a link to [a website](http://foo.bar), and to a [section heading in the current 94 | doc](#an-h2-header). Here's a footnote [^1]. 95 | 96 | [^1]: Footnote text goes here. 97 | 98 | Tables can look like this: 99 | 100 | size material color 101 | ---- ------------ ------------ 102 | 9 leather brown 103 | 10 hemp canvas natural 104 | 11 glass transparent 105 | 106 | Table: Shoes, their sizes, and what they're made of 107 | 108 | (The above is the caption for the table.) Pandoc also supports 109 | multi-line tables: 110 | 111 | -------- ----------------------- 112 | keyword text 113 | -------- ----------------------- 114 | red Sunsets, apples, and 115 | other red or reddish 116 | things. 117 | 118 | green Leaves, grass, frogs 119 | and other things it's 120 | not easy being. 121 | -------- ----------------------- 122 | 123 | A horizontal rule follows. 124 | 125 | *** 126 | 127 | Here's a definition list: 128 | 129 | apples 130 | : Good for making applesauce. 131 | oranges 132 | : Citrus! 133 | tomatoes 134 | : There's no "e" in tomatoe. 135 | 136 | Again, text is indented 4 spaces. (Put a blank line between each 137 | term/definition pair to spread things out more.) 138 | 139 | Here's a "line block": 140 | 141 | | Line one 142 | | Line too 143 | | Line tree 144 | 145 | and images can be specified like so: 146 | 147 | ![example image](https://placehold.co/600x400.png "An exemplary image") 148 | 149 | Inline math equations go in like so: $\omega = d\phi / dt$. Display 150 | math should get its own line and be put in in double-dollarsigns: 151 | 152 | $$I = \int \rho R^{2} dV$$ 153 | 154 | And note that you can backslash-escape any punctuation characters 155 | which you wish to be displayed literally, ex.: \`foo\`, \*bar\*, etc. 156 | 157 | ```dockerfile 158 | RUN dotnet restore -a $TARGETARCH 159 | 160 | COPY aspnetapp/. . 161 | RUN dotnet publish -a $TARGETARCH --self-contained false --no-restore -o /app 162 | ``` 163 | -------------------------------------------------------------------------------- /.github/actions/status-checker/__tests__/sample.md: -------------------------------------------------------------------------------- 1 | ## Not heading 2 | 3 | # The heading <xref:System.Console> class 4 | 5 | An h1 header 6 | ============ 7 | 8 | Paragraphs are separated by a blank line. 9 | 10 | 2nd paragraph. *Italic*, **bold**, and `monospace`. Itemized lists 11 | look like: 12 | 13 | - this one 14 | - that one 15 | - the other one 16 | 17 | Note that --- not considering the asterisk --- the actual text 18 | content starts at 4-columns in. 19 | 20 | > Block quotes are 21 | > written like so. 22 | > 23 | > They can span multiple paragraphs, 24 | > if you like. 25 | 26 | Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., "it's all 27 | in chapters 12--14"). Three dots ... will be converted to an ellipsis. 28 | Unicode is supported. ☺ 29 | 30 | An h2 header 31 | ------------ 32 | 33 | Here's a numbered list: 34 | 35 | 1. first item 36 | 2. second item 37 | 3. third item 38 | 39 | Note again how the actual text starts at 4 columns in (4 characters 40 | from the left side). Here's a code sample: 41 | 42 | # Let me re-iterate ... 43 | for i in 1 .. 10 { do-something(i) } 44 | 45 | As you probably guessed, indented 4 spaces. By the way, instead of 46 | indenting the block, you can use delimited blocks, if you like: 47 | 48 | ~~~ 49 | define foobar() { 50 | print "Welcome to flavor country!"; 51 | } 52 | ~~~ 53 | 54 | (which makes copying & pasting easier). You can optionally mark the 55 | delimited block for Pandoc to syntax highlight it: 56 | 57 | ~~~python 58 | import time 59 | for i in range(10): 60 | # (but not *too* quick) 61 | time.sleep(0.5) 62 | print i 63 | ~~~ 64 | 65 | ### An h3 header ### 66 | 67 | Now a nested list: 68 | 69 | 1. First, get these ingredients: 70 | 71 | - carrots 72 | - celery 73 | - lentils 74 | 75 | 2. Boil some water. 76 | 77 | 3. Dump everything in the pot and follow 78 | this algorithm: 79 | 80 | find wooden spoon 81 | uncover pot 82 | stir 83 | cover pot 84 | balance wooden spoon precariously on pot handle 85 | wait 10 minutes 86 | goto first step (or shut off burner when done) 87 | 88 | Do not bump wooden spoon or it will fall. 89 | 90 | Notice again how text always lines up on 4-space indents (including 91 | that last line which continues item 3 above). 92 | 93 | Here's a link to [a website](http://foo.bar), and to a [section heading in the current 94 | doc](#an-h2-header). Here's a footnote [^1]. 95 | 96 | [^1]: Footnote text goes here. 97 | 98 | Tables can look like this: 99 | 100 | size material color 101 | ---- ------------ ------------ 102 | 9 leather brown 103 | 10 hemp canvas natural 104 | 11 glass transparent 105 | 106 | Table: Shoes, their sizes, and what they're made of 107 | 108 | (The above is the caption for the table.) Pandoc also supports 109 | multi-line tables: 110 | 111 | -------- ----------------------- 112 | keyword text 113 | -------- ----------------------- 114 | red Sunsets, apples, and 115 | other red or reddish 116 | things. 117 | 118 | green Leaves, grass, frogs 119 | and other things it's 120 | not easy being. 121 | -------- ----------------------- 122 | 123 | A horizontal rule follows. 124 | 125 | *** 126 | 127 | Here's a definition list: 128 | 129 | apples 130 | : Good for making applesauce. 131 | oranges 132 | : Citrus! 133 | tomatoes 134 | : There's no "e" in tomatoe. 135 | 136 | Again, text is indented 4 spaces. (Put a blank line between each 137 | term/definition pair to spread things out more.) 138 | 139 | Here's a "line block": 140 | 141 | | Line one 142 | | Line too 143 | | Line tree 144 | 145 | and images can be specified like so: 146 | 147 | ![example image](https://placehold.co/600x400.png "An exemplary image") 148 | 149 | Inline math equations go in like so: $\omega = d\phi / dt$. Display 150 | math should get its own line and be put in in double-dollarsigns: 151 | 152 | $$I = \int \rho R^{2} dV$$ 153 | 154 | And note that you can backslash-escape any punctuation characters 155 | which you wish to be displayed literally, ex.: \`foo\`, \*bar\*, etc. 156 | 157 | ```dockerfile 158 | RUN dotnet restore -a $TARGETARCH 159 | 160 | # Copy everything else and build app. 161 | COPY aspnetapp/. . 162 | RUN dotnet publish -a $TARGETARCH --self-contained false --no-restore -o /app 163 | ``` 164 | --------------------------------------------------------------------------------