@azure/quantum-jobs 1.0.0-beta.1 → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{LICENSE.txt → LICENSE} +4 -4
- package/README.md +247 -98
- package/dist/browser/index.d.ts +4 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +11 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/models/index.d.ts +320 -0
- package/dist/browser/models/index.d.ts.map +1 -0
- package/dist/browser/models/index.js +58 -0
- package/dist/browser/models/index.js.map +1 -0
- package/dist/browser/models/mappers.d.ts +13 -0
- package/dist/browser/models/mappers.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/models/mappers.js +141 -140
- package/dist/browser/models/mappers.js.map +1 -0
- package/dist/browser/models/parameters.d.ts +12 -0
- package/dist/browser/models/parameters.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/models/parameters.js +37 -37
- package/dist/browser/models/parameters.js.map +1 -0
- package/dist/browser/operations/index.d.ts +5 -0
- package/dist/browser/operations/index.d.ts.map +1 -0
- package/dist/browser/operations/index.js +12 -0
- package/dist/browser/operations/index.js.map +1 -0
- package/dist/browser/operations/jobs.d.ts +51 -0
- package/dist/browser/operations/jobs.d.ts.map +1 -0
- package/dist/browser/operations/jobs.js +209 -0
- package/dist/browser/operations/jobs.js.map +1 -0
- package/dist/browser/operations/providers.d.ts +32 -0
- package/dist/browser/operations/providers.d.ts.map +1 -0
- package/dist/browser/operations/providers.js +118 -0
- package/dist/browser/operations/providers.js.map +1 -0
- package/dist/browser/operations/quotas.d.ts +32 -0
- package/dist/browser/operations/quotas.d.ts.map +1 -0
- package/dist/browser/operations/quotas.js +118 -0
- package/dist/browser/operations/quotas.js.map +1 -0
- package/dist/browser/operations/storage.d.ts +20 -0
- package/dist/browser/operations/storage.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/operations/storage.js +33 -35
- package/dist/browser/operations/storage.js.map +1 -0
- package/dist/browser/operationsInterfaces/index.d.ts +5 -0
- package/dist/browser/operationsInterfaces/index.d.ts.map +1 -0
- package/dist/browser/operationsInterfaces/index.js +12 -0
- package/dist/browser/operationsInterfaces/index.js.map +1 -0
- package/dist/browser/operationsInterfaces/jobs.d.ts +30 -0
- package/dist/browser/operationsInterfaces/jobs.d.ts.map +1 -0
- package/{dist-esm/src/models/index.js → dist/browser/operationsInterfaces/jobs.js} +1 -1
- package/dist/browser/operationsInterfaces/jobs.js.map +1 -0
- package/dist/browser/operationsInterfaces/providers.d.ts +11 -0
- package/dist/browser/operationsInterfaces/providers.d.ts.map +1 -0
- package/{dist-esm/src/operations/index.js → dist/browser/operationsInterfaces/providers.js} +2 -5
- package/dist/browser/operationsInterfaces/providers.js.map +1 -0
- package/dist/browser/operationsInterfaces/quotas.d.ts +11 -0
- package/dist/browser/operationsInterfaces/quotas.d.ts.map +1 -0
- package/dist/browser/operationsInterfaces/quotas.js +9 -0
- package/dist/browser/operationsInterfaces/quotas.js.map +1 -0
- package/dist/browser/operationsInterfaces/storage.d.ts +12 -0
- package/dist/browser/operationsInterfaces/storage.d.ts.map +1 -0
- package/dist/browser/operationsInterfaces/storage.js +9 -0
- package/dist/browser/operationsInterfaces/storage.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/pagingHelper.d.ts +13 -0
- package/dist/browser/pagingHelper.d.ts.map +1 -0
- package/dist/browser/pagingHelper.js +30 -0
- package/dist/browser/pagingHelper.js.map +1 -0
- package/dist/browser/quantumJobClient.d.ts +25 -0
- package/dist/browser/quantumJobClient.d.ts.map +1 -0
- package/dist/browser/quantumJobClient.js +93 -0
- package/dist/browser/quantumJobClient.js.map +1 -0
- package/dist/browser/tracing.d.ts +2 -0
- package/dist/browser/tracing.d.ts.map +1 -0
- package/dist/browser/tracing.js +14 -0
- package/dist/browser/tracing.js.map +1 -0
- package/dist/commonjs/index.d.ts +4 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +16 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +320 -0
- package/dist/commonjs/models/index.d.ts.map +1 -0
- package/dist/commonjs/models/index.js +61 -0
- package/dist/commonjs/models/index.js.map +1 -0
- package/dist/commonjs/models/mappers.d.ts +13 -0
- package/dist/commonjs/models/mappers.d.ts.map +1 -0
- package/dist/commonjs/models/mappers.js +414 -0
- package/dist/commonjs/models/mappers.js.map +1 -0
- package/dist/commonjs/models/parameters.d.ts +12 -0
- package/dist/commonjs/models/parameters.d.ts.map +1 -0
- package/dist/commonjs/models/parameters.js +104 -0
- package/dist/commonjs/models/parameters.js.map +1 -0
- package/dist/commonjs/operations/index.d.ts +5 -0
- package/dist/commonjs/operations/index.d.ts.map +1 -0
- package/dist/commonjs/operations/index.js +15 -0
- package/dist/commonjs/operations/index.js.map +1 -0
- package/dist/commonjs/operations/jobs.d.ts +51 -0
- package/dist/commonjs/operations/jobs.d.ts.map +1 -0
- package/dist/commonjs/operations/jobs.js +214 -0
- package/dist/commonjs/operations/jobs.js.map +1 -0
- package/dist/commonjs/operations/providers.d.ts +32 -0
- package/dist/commonjs/operations/providers.d.ts.map +1 -0
- package/dist/commonjs/operations/providers.js +123 -0
- package/dist/commonjs/operations/providers.js.map +1 -0
- package/dist/commonjs/operations/quotas.d.ts +32 -0
- package/dist/commonjs/operations/quotas.d.ts.map +1 -0
- package/dist/commonjs/operations/quotas.js +123 -0
- package/dist/commonjs/operations/quotas.js.map +1 -0
- package/dist/commonjs/operations/storage.d.ts +20 -0
- package/dist/commonjs/operations/storage.d.ts.map +1 -0
- package/dist/commonjs/operations/storage.js +63 -0
- package/dist/commonjs/operations/storage.js.map +1 -0
- package/dist/commonjs/operationsInterfaces/index.d.ts +5 -0
- package/dist/commonjs/operationsInterfaces/index.d.ts.map +1 -0
- package/dist/commonjs/operationsInterfaces/index.js +15 -0
- package/dist/commonjs/operationsInterfaces/index.js.map +1 -0
- package/dist/commonjs/operationsInterfaces/jobs.d.ts +30 -0
- package/dist/commonjs/operationsInterfaces/jobs.d.ts.map +1 -0
- package/dist/commonjs/operationsInterfaces/jobs.js +10 -0
- package/dist/commonjs/operationsInterfaces/jobs.js.map +1 -0
- package/dist/commonjs/operationsInterfaces/providers.d.ts +11 -0
- package/dist/commonjs/operationsInterfaces/providers.d.ts.map +1 -0
- package/dist/commonjs/operationsInterfaces/providers.js +10 -0
- package/dist/commonjs/operationsInterfaces/providers.js.map +1 -0
- package/dist/commonjs/operationsInterfaces/quotas.d.ts +11 -0
- package/dist/commonjs/operationsInterfaces/quotas.d.ts.map +1 -0
- package/dist/commonjs/operationsInterfaces/quotas.js +10 -0
- package/dist/commonjs/operationsInterfaces/quotas.js.map +1 -0
- package/dist/commonjs/operationsInterfaces/storage.d.ts +12 -0
- package/dist/commonjs/operationsInterfaces/storage.d.ts.map +1 -0
- package/dist/commonjs/operationsInterfaces/storage.js +10 -0
- package/dist/commonjs/operationsInterfaces/storage.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/pagingHelper.d.ts +13 -0
- package/dist/commonjs/pagingHelper.d.ts.map +1 -0
- package/dist/commonjs/pagingHelper.js +34 -0
- package/dist/commonjs/pagingHelper.js.map +1 -0
- package/dist/commonjs/quantumJobClient.d.ts +25 -0
- package/dist/commonjs/quantumJobClient.d.ts.map +1 -0
- package/dist/commonjs/quantumJobClient.js +98 -0
- package/dist/commonjs/quantumJobClient.js.map +1 -0
- package/dist/commonjs/tracing.d.ts +2 -0
- package/dist/commonjs/tracing.d.ts.map +1 -0
- package/dist/commonjs/tracing.js +17 -0
- package/dist/commonjs/tracing.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +11 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/models/index.d.ts +320 -0
- package/dist/esm/models/index.d.ts.map +1 -0
- package/dist/esm/models/index.js +58 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/models/mappers.d.ts +13 -0
- package/dist/esm/models/mappers.d.ts.map +1 -0
- package/dist/esm/models/mappers.js +411 -0
- package/dist/esm/models/mappers.js.map +1 -0
- package/dist/esm/models/parameters.d.ts +12 -0
- package/dist/esm/models/parameters.d.ts.map +1 -0
- package/dist/esm/models/parameters.js +101 -0
- package/dist/esm/models/parameters.js.map +1 -0
- package/dist/esm/operations/index.d.ts +5 -0
- package/dist/esm/operations/index.d.ts.map +1 -0
- package/dist/esm/operations/index.js +12 -0
- package/dist/esm/operations/index.js.map +1 -0
- package/dist/esm/operations/jobs.d.ts +51 -0
- package/dist/esm/operations/jobs.d.ts.map +1 -0
- package/dist/esm/operations/jobs.js +209 -0
- package/dist/esm/operations/jobs.js.map +1 -0
- package/dist/esm/operations/providers.d.ts +32 -0
- package/dist/esm/operations/providers.d.ts.map +1 -0
- package/dist/esm/operations/providers.js +118 -0
- package/dist/esm/operations/providers.js.map +1 -0
- package/dist/esm/operations/quotas.d.ts +32 -0
- package/dist/esm/operations/quotas.d.ts.map +1 -0
- package/dist/esm/operations/quotas.js +118 -0
- package/dist/esm/operations/quotas.js.map +1 -0
- package/dist/esm/operations/storage.d.ts +20 -0
- package/dist/esm/operations/storage.d.ts.map +1 -0
- package/dist/esm/operations/storage.js +58 -0
- package/dist/esm/operations/storage.js.map +1 -0
- package/dist/esm/operationsInterfaces/index.d.ts +5 -0
- package/dist/esm/operationsInterfaces/index.d.ts.map +1 -0
- package/dist/esm/operationsInterfaces/index.js +12 -0
- package/dist/esm/operationsInterfaces/index.js.map +1 -0
- package/dist/esm/operationsInterfaces/jobs.d.ts +30 -0
- package/dist/esm/operationsInterfaces/jobs.d.ts.map +1 -0
- package/dist/esm/operationsInterfaces/jobs.js +9 -0
- package/dist/esm/operationsInterfaces/jobs.js.map +1 -0
- package/dist/esm/operationsInterfaces/providers.d.ts +11 -0
- package/dist/esm/operationsInterfaces/providers.d.ts.map +1 -0
- package/dist/esm/operationsInterfaces/providers.js +9 -0
- package/dist/esm/operationsInterfaces/providers.js.map +1 -0
- package/dist/esm/operationsInterfaces/quotas.d.ts +11 -0
- package/dist/esm/operationsInterfaces/quotas.d.ts.map +1 -0
- package/dist/esm/operationsInterfaces/quotas.js +9 -0
- package/dist/esm/operationsInterfaces/quotas.js.map +1 -0
- package/dist/esm/operationsInterfaces/storage.d.ts +12 -0
- package/dist/esm/operationsInterfaces/storage.d.ts.map +1 -0
- package/dist/esm/operationsInterfaces/storage.js +9 -0
- package/dist/esm/operationsInterfaces/storage.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/pagingHelper.d.ts +13 -0
- package/dist/esm/pagingHelper.d.ts.map +1 -0
- package/dist/esm/pagingHelper.js +30 -0
- package/dist/esm/pagingHelper.js.map +1 -0
- package/dist/esm/quantumJobClient.d.ts +25 -0
- package/dist/esm/quantumJobClient.d.ts.map +1 -0
- package/dist/esm/quantumJobClient.js +93 -0
- package/dist/esm/quantumJobClient.js.map +1 -0
- package/dist/esm/tracing.d.ts +2 -0
- package/dist/esm/tracing.d.ts.map +1 -0
- package/dist/esm/tracing.js +14 -0
- package/dist/esm/tracing.js.map +1 -0
- package/dist/react-native/index.d.ts +4 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +11 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/models/index.d.ts +320 -0
- package/dist/react-native/models/index.d.ts.map +1 -0
- package/dist/react-native/models/index.js +58 -0
- package/dist/react-native/models/index.js.map +1 -0
- package/dist/react-native/models/mappers.d.ts +13 -0
- package/dist/react-native/models/mappers.d.ts.map +1 -0
- package/dist/react-native/models/mappers.js +411 -0
- package/dist/react-native/models/mappers.js.map +1 -0
- package/dist/react-native/models/parameters.d.ts +12 -0
- package/dist/react-native/models/parameters.d.ts.map +1 -0
- package/dist/react-native/models/parameters.js +101 -0
- package/dist/react-native/models/parameters.js.map +1 -0
- package/dist/react-native/operations/index.d.ts +5 -0
- package/dist/react-native/operations/index.d.ts.map +1 -0
- package/dist/react-native/operations/index.js +12 -0
- package/dist/react-native/operations/index.js.map +1 -0
- package/dist/react-native/operations/jobs.d.ts +51 -0
- package/dist/react-native/operations/jobs.d.ts.map +1 -0
- package/dist/react-native/operations/jobs.js +209 -0
- package/dist/react-native/operations/jobs.js.map +1 -0
- package/dist/react-native/operations/providers.d.ts +32 -0
- package/dist/react-native/operations/providers.d.ts.map +1 -0
- package/dist/react-native/operations/providers.js +118 -0
- package/dist/react-native/operations/providers.js.map +1 -0
- package/dist/react-native/operations/quotas.d.ts +32 -0
- package/dist/react-native/operations/quotas.d.ts.map +1 -0
- package/dist/react-native/operations/quotas.js +118 -0
- package/dist/react-native/operations/quotas.js.map +1 -0
- package/dist/react-native/operations/storage.d.ts +20 -0
- package/dist/react-native/operations/storage.d.ts.map +1 -0
- package/dist/react-native/operations/storage.js +58 -0
- package/dist/react-native/operations/storage.js.map +1 -0
- package/dist/react-native/operationsInterfaces/index.d.ts +5 -0
- package/dist/react-native/operationsInterfaces/index.d.ts.map +1 -0
- package/dist/react-native/operationsInterfaces/index.js +12 -0
- package/dist/react-native/operationsInterfaces/index.js.map +1 -0
- package/dist/react-native/operationsInterfaces/jobs.d.ts +30 -0
- package/dist/react-native/operationsInterfaces/jobs.d.ts.map +1 -0
- package/dist/react-native/operationsInterfaces/jobs.js +9 -0
- package/dist/react-native/operationsInterfaces/jobs.js.map +1 -0
- package/dist/react-native/operationsInterfaces/providers.d.ts +11 -0
- package/dist/react-native/operationsInterfaces/providers.d.ts.map +1 -0
- package/dist/react-native/operationsInterfaces/providers.js +9 -0
- package/dist/react-native/operationsInterfaces/providers.js.map +1 -0
- package/dist/react-native/operationsInterfaces/quotas.d.ts +11 -0
- package/dist/react-native/operationsInterfaces/quotas.d.ts.map +1 -0
- package/dist/react-native/operationsInterfaces/quotas.js +9 -0
- package/dist/react-native/operationsInterfaces/quotas.js.map +1 -0
- package/dist/react-native/operationsInterfaces/storage.d.ts +12 -0
- package/dist/react-native/operationsInterfaces/storage.d.ts.map +1 -0
- package/dist/react-native/operationsInterfaces/storage.js +9 -0
- package/dist/react-native/operationsInterfaces/storage.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/pagingHelper.d.ts +13 -0
- package/dist/react-native/pagingHelper.d.ts.map +1 -0
- package/dist/react-native/pagingHelper.js +30 -0
- package/dist/react-native/pagingHelper.js.map +1 -0
- package/dist/react-native/quantumJobClient.d.ts +25 -0
- package/dist/react-native/quantumJobClient.d.ts.map +1 -0
- package/dist/react-native/quantumJobClient.js +93 -0
- package/dist/react-native/quantumJobClient.js.map +1 -0
- package/dist/react-native/tracing.d.ts +2 -0
- package/dist/react-native/tracing.d.ts.map +1 -0
- package/dist/react-native/tracing.js +14 -0
- package/dist/react-native/tracing.js.map +1 -0
- package/package.json +90 -92
- package/CHANGELOG.md +0 -5
- package/dist/index.js +0 -1309
- package/dist/index.js.map +0 -1
- package/dist-esm/src/index.js +0 -13
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/models/index.js.map +0 -1
- package/dist-esm/src/models/mappers.js.map +0 -1
- package/dist-esm/src/models/parameters.js.map +0 -1
- package/dist-esm/src/operations/index.js.map +0 -1
- package/dist-esm/src/operations/jobs.js +0 -280
- package/dist-esm/src/operations/jobs.js.map +0 -1
- package/dist-esm/src/operations/providers.js +0 -182
- package/dist-esm/src/operations/providers.js.map +0 -1
- package/dist-esm/src/operations/quotas.js +0 -182
- package/dist-esm/src/operations/quotas.js.map +0 -1
- package/dist-esm/src/operations/storage.js.map +0 -1
- package/dist-esm/src/quantumJobClient.js +0 -33
- package/dist-esm/src/quantumJobClient.js.map +0 -1
- package/dist-esm/src/quantumJobClientContext.js +0 -59
- package/dist-esm/src/quantumJobClientContext.js.map +0 -1
- package/types/latest/quantum-jobs.d.ts +0 -534
package/{LICENSE.txt → LICENSE}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
Copyright (c) Microsoft Corporation.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MIT License
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -12,10 +12,10 @@ furnished to do so, subject to the following conditions:
|
|
|
12
12
|
The above copyright notice and this permission notice shall be included in all
|
|
13
13
|
copies or substantial portions of the Software.
|
|
14
14
|
|
|
15
|
-
THE SOFTWARE IS PROVIDED
|
|
15
|
+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
This package contains an isomorphic SDK for QuantumJobClient.
|
|
4
4
|
|
|
5
|
-
Azure Quantum is a Microsoft Azure service that you can use to run quantum computing programs
|
|
5
|
+
Azure Quantum is a Microsoft Azure service that you can use to run quantum computing programs in the cloud. Using the Azure Quantum tools and SDKs, you can create quantum programs and run them against different quantum simulators and machines. You can use the `@azure/quantum-jobs` client library to:
|
|
6
6
|
|
|
7
7
|
- Create, enumerate, and cancel quantum jobs
|
|
8
8
|
- Enumerate provider status and quotas
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Key links:
|
|
11
|
+
|
|
12
|
+
- [Source code][source]
|
|
13
|
+
- [API reference documentation](https://learn.microsoft.com/qsharp/api/)
|
|
14
|
+
- [Product documentation](https://learn.microsoft.com/azure/quantum/)
|
|
15
|
+
- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quantum/quantum-jobs/samples)
|
|
11
16
|
|
|
12
17
|
## Getting started
|
|
13
18
|
|
|
@@ -23,15 +28,15 @@ npm install @azure/quantum-jobs
|
|
|
23
28
|
|
|
24
29
|
### Prerequisites
|
|
25
30
|
|
|
26
|
-
- Node.js
|
|
31
|
+
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
|
|
27
32
|
- [Azure subscription](https://azure.microsoft.com/free/)
|
|
28
33
|
- [Azure Quantum Workspace][workspaces]
|
|
29
34
|
|
|
30
35
|
### Authenticate the client
|
|
31
36
|
|
|
32
|
-
To authenticate with the service, you can use [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/
|
|
37
|
+
To authenticate with the service, you can use [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential) from the `@azure/identity` library. This will try different authentication mechanisms based on the environment (e.g. Environment Variables, ManagedIdentity, CachedTokens) and finally, it will fallback to InteractiveBrowserCredential.
|
|
33
38
|
|
|
34
|
-
The client also allows the user to override the above behavior by passing their own implementations of the [TokenCredential](https://github.com/Azure/azure-sdk-for-js/blob/
|
|
39
|
+
The client also allows the user to override the above behavior by passing their own implementations of the [TokenCredential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-auth/src/tokenCredential.ts).
|
|
35
40
|
|
|
36
41
|
`TokenCredential` is the default Authentication mechanism used by Azure SDKs.
|
|
37
42
|
|
|
@@ -53,126 +58,260 @@ Create an instance of the QuantumJobClient by passing in these parameters:
|
|
|
53
58
|
|
|
54
59
|
- [Subscription Id][subscriptions] - looks like XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX and can be found in your list of subscriptions on azure
|
|
55
60
|
- [Resource Group Name][resource-groups] - a container that holds related resources for an Azure solution
|
|
56
|
-
- [Workspace Name][workspaces] - a collection of assets associated with running quantum
|
|
61
|
+
- [Workspace Name][workspaces] - a collection of assets associated with running quantum
|
|
57
62
|
- [Location][location] - choose the best data center by geographical region
|
|
58
63
|
- [Storage Container Name][blob-storage] - your blob storage
|
|
59
64
|
- [Credential][credentials] - used to authenticate
|
|
60
65
|
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
66
|
+
```ts snippet:ReadmeSampleCreateClient_TokenCredential
|
|
67
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
68
|
+
import { QuantumJobClient } from "@azure/quantum-jobs";
|
|
69
|
+
|
|
70
|
+
const credential = new DefaultAzureCredential();
|
|
71
|
+
|
|
72
|
+
// Create a QuantumJobClient
|
|
73
|
+
const subscriptionId = "your_subscription_id";
|
|
74
|
+
const resourceGroupName = "your_resource_group_name";
|
|
75
|
+
const workspaceName = "your_quantum_workspace_name";
|
|
76
|
+
const location = "westus";
|
|
77
|
+
const endpoint = `https://${location}.quantum.azure.com`;
|
|
78
|
+
const quantumJobClient = new QuantumJobClient(
|
|
79
|
+
credential,
|
|
80
|
+
subscriptionId,
|
|
81
|
+
resourceGroupName,
|
|
82
|
+
workspaceName,
|
|
83
|
+
{
|
|
84
|
+
endpoint: endpoint,
|
|
85
|
+
credentialScopes: "https://quantum.microsoft.com/.default",
|
|
86
|
+
},
|
|
87
|
+
);
|
|
82
88
|
```
|
|
83
89
|
|
|
84
90
|
### Get Container SAS URI
|
|
85
91
|
|
|
86
92
|
Create a storage container to put your data.
|
|
87
93
|
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
```ts snippet:ReadmeSampleCreateContainer
|
|
95
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
96
|
+
import { QuantumJobClient } from "@azure/quantum-jobs";
|
|
97
|
+
import { ContainerClient } from "@azure/storage-blob";
|
|
98
|
+
|
|
99
|
+
const credential = new DefaultAzureCredential();
|
|
100
|
+
const subscriptionId = "your_subscription_id";
|
|
101
|
+
const resourceGroupName = "your_resource_group_name";
|
|
102
|
+
const workspaceName = "your_quantum_workspace_name";
|
|
103
|
+
const storageContainerName = "containername";
|
|
104
|
+
const location = "westus";
|
|
105
|
+
const endpoint = `https://${location}.quantum.azure.com`;
|
|
106
|
+
|
|
107
|
+
const quantumJobClient = new QuantumJobClient(
|
|
108
|
+
credential,
|
|
109
|
+
subscriptionId,
|
|
110
|
+
resourceGroupName,
|
|
111
|
+
workspaceName,
|
|
112
|
+
{
|
|
113
|
+
endpoint: endpoint,
|
|
114
|
+
credentialScopes: "https://quantum.microsoft.com/.default",
|
|
115
|
+
},
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
// Get container Uri with SAS key
|
|
119
|
+
const containerUri = (
|
|
120
|
+
await quantumJobClient.storage.sasUri({
|
|
121
|
+
containerName: storageContainerName,
|
|
122
|
+
})
|
|
123
|
+
).sasUri;
|
|
124
|
+
|
|
125
|
+
// Create container if not exists
|
|
126
|
+
const containerClient = new ContainerClient(containerUri);
|
|
127
|
+
await containerClient.createIfNotExists();
|
|
99
128
|
```
|
|
100
129
|
|
|
130
|
+
### Compile your quantum program into QIR
|
|
131
|
+
|
|
132
|
+
This step can be done in multiple ways and it is not in scope for this sample.
|
|
133
|
+
|
|
134
|
+
[Quantum Intermediate Representation (QIR)](https://github.com/qir-alliance/qir-spec) is a [QIR Alliance](https://www.qir-alliance.org/) specification to represent quantum programs within the [LLVM](https://llvm.org/) Intermediate Representation (IR).
|
|
135
|
+
|
|
136
|
+
A few methods to compile or generate a quantum program into QIR:
|
|
137
|
+
|
|
138
|
+
- [Q# compiler](https://github.com/microsoft/qsharp-compiler/): Can be used to [compile Q# Code into QIR](https://github.com/microsoft/qsharp-compiler/tree/main/src/QsCompiler/QirGeneration).
|
|
139
|
+
- [PyQIR](https://github.com/qir-alliance/pyqir): PyQIR is a set of APIs for generating, parsing, and evaluating Quantum Intermediate Representation (QIR).
|
|
140
|
+
- [IQ#](https://github.com/microsoft/iqsharp): Can be used to compile a Q# program into QIR with the [%qir](https://learn.microsoft.com/qsharp/api/iqsharp-magic/qir) magic command.
|
|
141
|
+
|
|
142
|
+
In this sample, we assume you already have a file with the QIR bitcode and you know the method name that you want to execute (entry point).
|
|
143
|
+
|
|
144
|
+
We will use the QIR bitcode sample (`BellState.bc` in the samples folder), compiled a Q# code (`BellState.qs` in the samples folder) targeting the `quantinuum.sim.h1-1e` target, with `AdaptiveExecution` target capability.
|
|
145
|
+
|
|
101
146
|
### Upload Input Data
|
|
102
147
|
|
|
103
|
-
Using the SAS URI, upload the
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
148
|
+
Using the SAS URI, upload the QIR bitcode input data to the blob client.
|
|
149
|
+
|
|
150
|
+
```ts snippet:ReadmeSampleUploadInputData
|
|
151
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
152
|
+
import { QuantumJobClient } from "@azure/quantum-jobs";
|
|
153
|
+
import { BlockBlobClient } from "@azure/storage-blob";
|
|
154
|
+
import { readFileSync } from "node:fs";
|
|
155
|
+
|
|
156
|
+
const credential = new DefaultAzureCredential();
|
|
157
|
+
const subscriptionId = "your_subscription_id";
|
|
158
|
+
const resourceGroupName = "your_resource_group_name";
|
|
159
|
+
const workspaceName = "your_quantum_workspace_name";
|
|
160
|
+
const storageContainerName = "containername";
|
|
161
|
+
const location = "westus";
|
|
162
|
+
const endpoint = `https://${location}.quantum.azure.com`;
|
|
163
|
+
|
|
164
|
+
const quantumJobClient = new QuantumJobClient(
|
|
165
|
+
credential,
|
|
166
|
+
subscriptionId,
|
|
167
|
+
resourceGroupName,
|
|
168
|
+
workspaceName,
|
|
169
|
+
{
|
|
170
|
+
endpoint: endpoint,
|
|
171
|
+
credentialScopes: "https://quantum.microsoft.com/.default",
|
|
172
|
+
},
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
// Get input data blob Uri with SAS key
|
|
176
|
+
const blobName = "myjobinput.bc";
|
|
177
|
+
const inputDataUri = (
|
|
178
|
+
await quantumJobClient.storage.sasUri({
|
|
179
|
+
containerName: storageContainerName,
|
|
180
|
+
blobName: blobName,
|
|
181
|
+
})
|
|
182
|
+
).sasUri;
|
|
183
|
+
|
|
184
|
+
// Upload input data to blob
|
|
185
|
+
const blobClient = new BlockBlobClient(inputDataUri);
|
|
186
|
+
const problemFilename = "BellState.bc";
|
|
187
|
+
const fileContent = readFileSync(problemFilename, "utf8");
|
|
188
|
+
const blobOptions = {
|
|
189
|
+
blobHTTPHeaders: {
|
|
190
|
+
blobContentType: "qir.v1",
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
await blobClient.upload(fileContent, Buffer.byteLength(fileContent), blobOptions);
|
|
121
194
|
```
|
|
122
195
|
|
|
123
196
|
### Create The Job
|
|
124
197
|
|
|
125
198
|
Now that you've uploaded your problem definition to Azure Storage, you can use `jobs.create` to define an Azure Quantum job.
|
|
126
199
|
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
200
|
+
```ts snippet:ReadmeSampleCreateJob
|
|
201
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
202
|
+
import { QuantumJobClient } from "@azure/quantum-jobs";
|
|
203
|
+
|
|
204
|
+
const credential = new DefaultAzureCredential();
|
|
205
|
+
const subscriptionId = "your_subscription_id";
|
|
206
|
+
const resourceGroupName = "your_resource_group_name";
|
|
207
|
+
const workspaceName = "your_quantum_workspace_name";
|
|
208
|
+
const location = "westus";
|
|
209
|
+
const endpoint = `https://${location}.quantum.azure.com`;
|
|
210
|
+
|
|
211
|
+
const quantumJobClient = new QuantumJobClient(
|
|
212
|
+
credential,
|
|
213
|
+
subscriptionId,
|
|
214
|
+
resourceGroupName,
|
|
215
|
+
workspaceName,
|
|
216
|
+
{
|
|
217
|
+
endpoint: endpoint,
|
|
218
|
+
credentialScopes: "https://quantum.microsoft.com/.default",
|
|
219
|
+
},
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
const randomId = `${Math.floor(Math.random() * 10000 + 1)}`;
|
|
223
|
+
|
|
224
|
+
// Submit job
|
|
225
|
+
const jobId = `job-${randomId}`;
|
|
226
|
+
const jobName = `jobName-${randomId}`;
|
|
227
|
+
const inputDataFormat = "qir.v1";
|
|
228
|
+
const outputDataFormat = "microsoft.quantum-results.v1";
|
|
229
|
+
const providerId = "quantinuum";
|
|
230
|
+
const target = "quantinuum.sim.h1-1e";
|
|
231
|
+
const inputParams = {
|
|
232
|
+
entryPoint: "ENTRYPOINT__BellState",
|
|
233
|
+
arguments: [],
|
|
234
|
+
targetCapability: "AdaptiveExecution",
|
|
235
|
+
};
|
|
236
|
+
const createJobDetails = {
|
|
237
|
+
containerUri: "https://<container-uri>",
|
|
238
|
+
inputDataFormat: inputDataFormat,
|
|
239
|
+
providerId: providerId,
|
|
240
|
+
target: target,
|
|
241
|
+
id: jobId,
|
|
242
|
+
inputDataUri: "https://<input-data-url>",
|
|
243
|
+
name: jobName,
|
|
244
|
+
outputDataFormat: outputDataFormat,
|
|
245
|
+
inputParams: inputParams,
|
|
246
|
+
};
|
|
247
|
+
const createdJob = await quantumJobClient.jobs.create(jobId, createJobDetails);
|
|
148
248
|
```
|
|
149
249
|
|
|
150
250
|
### Get Job
|
|
151
251
|
|
|
152
252
|
`GetJob` retrieves a specific job by its id.
|
|
153
253
|
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
|
|
254
|
+
```ts snippet:ReadmeSampleGetJob
|
|
255
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
256
|
+
import { QuantumJobClient } from "@azure/quantum-jobs";
|
|
257
|
+
|
|
258
|
+
const credential = new DefaultAzureCredential();
|
|
259
|
+
const subscriptionId = "your_subscription_id";
|
|
260
|
+
const resourceGroupName = "your_resource_group_name";
|
|
261
|
+
const workspaceName = "your_quantum_workspace_name";
|
|
262
|
+
const location = "westus";
|
|
263
|
+
const endpoint = `https://${location}.quantum.azure.com`;
|
|
264
|
+
|
|
265
|
+
const quantumJobClient = new QuantumJobClient(
|
|
266
|
+
credential,
|
|
267
|
+
subscriptionId,
|
|
268
|
+
resourceGroupName,
|
|
269
|
+
workspaceName,
|
|
270
|
+
{
|
|
271
|
+
endpoint: endpoint,
|
|
272
|
+
credentialScopes: "https://quantum.microsoft.com/.default",
|
|
273
|
+
},
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
// Get the job that we've just created based on its jobId
|
|
277
|
+
const myJob = await quantumJobClient.jobs.get("job-1234");
|
|
157
278
|
```
|
|
158
279
|
|
|
159
280
|
### Get Jobs
|
|
160
281
|
|
|
161
282
|
To enumerate all the jobs in the workspace, use the `jobs.list` method.
|
|
162
283
|
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
284
|
+
```ts snippet:ReadmeSampleListJobs
|
|
285
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
286
|
+
import { QuantumJobClient } from "@azure/quantum-jobs";
|
|
287
|
+
|
|
288
|
+
const credential = new DefaultAzureCredential();
|
|
289
|
+
const subscriptionId = "your_subscription_id";
|
|
290
|
+
const resourceGroupName = "your_resource_group_name";
|
|
291
|
+
const workspaceName = "your_quantum_workspace_name";
|
|
292
|
+
const location = "westus";
|
|
293
|
+
const endpoint = `https://${location}.quantum.azure.com`;
|
|
294
|
+
|
|
295
|
+
const quantumJobClient = new QuantumJobClient(
|
|
296
|
+
credential,
|
|
297
|
+
subscriptionId,
|
|
298
|
+
resourceGroupName,
|
|
299
|
+
workspaceName,
|
|
300
|
+
{
|
|
301
|
+
endpoint: endpoint,
|
|
302
|
+
credentialScopes: "https://quantum.microsoft.com/.default",
|
|
303
|
+
},
|
|
304
|
+
);
|
|
305
|
+
|
|
306
|
+
const jobListResult = quantumJobClient.jobs.list();
|
|
307
|
+
for await (const job of jobListResult) {
|
|
308
|
+
console.log(`Job Id: ${job.id} and Job Name: ${job.name}`);
|
|
309
|
+
}
|
|
171
310
|
```
|
|
172
311
|
|
|
173
312
|
## Next steps
|
|
174
313
|
|
|
175
|
-
- Visit our [Product documentation](https://
|
|
314
|
+
- Visit our [Product documentation](https://learn.microsoft.com/azure/quantum/) to learn more about Azure Quantum.
|
|
176
315
|
|
|
177
316
|
## Contributing
|
|
178
317
|
|
|
@@ -193,17 +332,27 @@ additional questions or comments.
|
|
|
193
332
|
|
|
194
333
|
All Quantum Jobs service operations will throw a RequestFailedException on failure with helpful ErrorCodes. Many of these errors are recoverable.
|
|
195
334
|
|
|
335
|
+
### Logging
|
|
336
|
+
|
|
337
|
+
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
|
|
338
|
+
|
|
339
|
+
```ts snippet:SetLogLevel
|
|
340
|
+
import { setLogLevel } from "@azure/logger";
|
|
341
|
+
|
|
342
|
+
setLogLevel("info");
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
|
|
346
|
+
|
|
196
347
|
<!-- LINKS -->
|
|
197
348
|
|
|
198
|
-
[source]: https://github.com/Azure/azure-sdk-for-js/tree/
|
|
199
|
-
[resource-groups]: https://
|
|
200
|
-
[workspaces]: https://
|
|
349
|
+
[source]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quantum/quantum-jobs/src
|
|
350
|
+
[resource-groups]: https://learn.microsoft.com/azure/azure-resource-manager/management/manage-resource-groups-portal
|
|
351
|
+
[workspaces]: https://learn.microsoft.com/azure/quantum/how-to-create-quantum-workspaces-with-the-azure-portal
|
|
201
352
|
[location]: https://azure.microsoft.com/global-infrastructure/services/?products=quantum
|
|
202
|
-
[blob-storage]: https://
|
|
203
|
-
[contributing]: https://github.com/Azure/azure-sdk-for-js/tree/
|
|
353
|
+
[blob-storage]: https://learn.microsoft.com/azure/storage/blobs/storage-blobs-introduction
|
|
354
|
+
[contributing]: https://github.com/Azure/azure-sdk-for-js/tree/main/CONTRIBUTING.md
|
|
204
355
|
[subscriptions]: https://ms.portal.azure.com/#blade/Microsoft_Azure_Billing/SubscriptionsBlade
|
|
205
|
-
[credentials]: https://
|
|
206
|
-
[style-guide-msft]: https://
|
|
356
|
+
[credentials]: https://learn.microsoft.com/javascript/api/overview/azure/identity-readme?view=azure-node-latest#credentials
|
|
357
|
+
[style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization
|
|
207
358
|
[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide
|
|
208
|
-
|
|
209
|
-

|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAQA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
export * from "./models/index.js";
|
|
9
|
+
export { QuantumJobClient } from "./quantumJobClient.js";
|
|
10
|
+
export * from "./operationsInterfaces/index.js";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,cAAc,iCAAiC,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport * from \"./models/index.js\";\nexport { QuantumJobClient } from \"./quantumJobClient.js\";\nexport * from \"./operationsInterfaces/index.js\";\n"]}
|