Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cirq libraries. #605

Merged
merged 8 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion azure-quantum/azure/quantum/cirq/targets/ionq.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
##
from typing import TYPE_CHECKING, Any, Dict, Union
from typing import TYPE_CHECKING, Any, Dict, Union, Optional

try:
import cirq
Expand Down Expand Up @@ -71,6 +71,14 @@ def cancel_job(self, job_id: str):
def delete_job(self, job_id: str):
azure_job = self._workspace.get_job(job_id)
self._workspace.cancel_job(azure_job)

def get_results(
self, job_id: str, sharpen: Optional[bool] = None, extra_query_params: Optional[dict] = None
):
azure_job = self._workspace.get_job(job_id)
job_result = azure_job.get_results()
return job_result["histogram"]

kikomiss marked this conversation as resolved.
Show resolved Hide resolved


class IonQTarget(IonQ, CirqTarget):
Expand Down
4 changes: 2 additions & 2 deletions azure-quantum/requirements-cirq.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cirq-core>=1.1.0,<=1.2.0
cirq-ionq>=1.1.0,<=1.2.0
cirq-core>=1.3.0,<=1.4.0
cirq-ionq>=1.3.0,<=1.4.0

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

238 changes: 124 additions & 114 deletions azure-quantum/tests/unit/recordings/test_dft_success.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,21 @@ interactions:
uri: https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token
response:
body:
string: '{"token_type": "Bearer", "expires_in": 1745070742, "ext_expires_in":
1745070742, "refresh_in": 31536000, "access_token": "PLACEHOLDER"}'
string: '{"error": "invalid_client", "error_description": "AADSTS7000215: Invalid
client secret provided. Ensure the secret being sent in the request is the
client secret value, not the client secret ID, for a secret added to app ''00000000-0000-0000-0000-000000000000''.
Trace ID: 69c76057-41bb-4988-ac61-86917675bd00 Correlation ID: 3d9c2dd0-a763-4e40-8367-25e1fd37871a
Timestamp: 2024-04-30 13:58:46Z", "error_codes": [7000215], "timestamp": "2024-04-30
13:58:46Z", "trace_id": "69c76057-41bb-4988-ac61-86917675bd00", "correlation_id":
"3d9c2dd0-a763-4e40-8367-25e1fd37871a", "error_uri": "https://login.microsoftonline.com/error?code=7000215"}'
headers:
content-length:
- '135'
- '636'
content-type:
- application/json; charset=utf-8
status:
code: 200
message: OK
code: 401
message: Unauthorized
- request:
body: 'b''{"containerName": "job-00000000-0000-0000-0000-000000000001"}'''
headers:
Expand Down Expand Up @@ -80,15 +85,15 @@ interactions:
User-Agent:
- azsdk-python-storage-blob/12.19.1 Python/3.9.19 (Windows-10-10.0.22631-SP0)
x-ms-date:
- Fri, 19 Apr 2024 13:52:23 GMT
- Tue, 30 Apr 2024 13:58:48 GMT
x-ms-version:
- '2023-11-03'
method: GET
uri: https://mystorage.blob.core.windows.net/job-00000000-0000-0000-0000-000000000001?restype=container&sv=PLACEHOLDER&sig=PLACEHOLDER&se=2050-01-01T00%3A00%3A00Z&srt=co&ss=b&sp=racwl
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ContainerNotFound</Code><Message>The
specified container does not exist.\nRequestId:3c3919a8-a01e-0015-1560-923b73000000\nTime:2024-04-19T13:52:24.6340835Z</Message></Error>"
specified container does not exist.\nRequestId:7e994e97-601e-000a-3006-9b8877000000\nTime:2024-04-30T13:58:49.8429036Z</Message></Error>"
headers:
content-length:
- '223'
Expand All @@ -113,7 +118,7 @@ interactions:
User-Agent:
- azsdk-python-storage-blob/12.19.1 Python/3.9.19 (Windows-10-10.0.22631-SP0)
x-ms-date:
- Fri, 19 Apr 2024 13:52:24 GMT
- Tue, 30 Apr 2024 13:58:49 GMT
x-ms-version:
- '2023-11-03'
method: PUT
Expand Down Expand Up @@ -141,7 +146,7 @@ interactions:
User-Agent:
- azsdk-python-storage-blob/12.19.1 Python/3.9.19 (Windows-10-10.0.22631-SP0)
x-ms-date:
- Fri, 19 Apr 2024 13:52:24 GMT
- Tue, 30 Apr 2024 13:58:49 GMT
x-ms-version:
- '2023-11-03'
method: GET
Expand Down Expand Up @@ -234,7 +239,7 @@ interactions:
x-ms-blob-type:
- BlockBlob
x-ms-date:
- Fri, 19 Apr 2024 13:52:25 GMT
- Tue, 30 Apr 2024 13:58:50 GMT
x-ms-version:
- '2023-11-03'
method: PUT
Expand Down Expand Up @@ -303,7 +308,7 @@ interactions:
"beginExecutionTime": null, "cancellationTime": null, "quantumComputingData":
null, "errorData": null, "isCancelling": false, "tags": [], "name": "azure-quantum-job",
"id": "00000000-0000-0000-0000-000000000001", "providerId": "microsoft-qc",
"target": "microsoft.estimator", "creationTime": "2024-04-19T13:52:26.1429543+00:00",
"target": "microsoft.estimator", "creationTime": "2024-04-30T13:58:53.5070643+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -351,7 +356,7 @@ interactions:
"beginExecutionTime": null, "cancellationTime": null, "quantumComputingData":
null, "errorData": null, "isCancelling": false, "tags": [], "name": "azure-quantum-job",
"id": "00000000-0000-0000-0000-000000000001", "providerId": "microsoft-qc",
"target": "microsoft.estimator", "creationTime": "2024-04-19T13:52:26.1429543+00:00",
"target": "microsoft.estimator", "creationTime": "2024-04-30T13:58:53.5070643+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -399,7 +404,7 @@ interactions:
"beginExecutionTime": null, "cancellationTime": null, "quantumComputingData":
{"count": 1}, "errorData": null, "isCancelling": false, "tags": [], "name":
"azure-quantum-job", "id": "00000000-0000-0000-0000-000000000001", "providerId":
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-19T13:52:26.1429543+00:00",
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-30T13:58:53.5070643+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -447,7 +452,7 @@ interactions:
"beginExecutionTime": null, "cancellationTime": null, "quantumComputingData":
{"count": 1}, "errorData": null, "isCancelling": false, "tags": [], "name":
"azure-quantum-job", "id": "00000000-0000-0000-0000-000000000001", "providerId":
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-19T13:52:26.1429543+00:00",
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-30T13:58:53.5070643+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -495,7 +500,7 @@ interactions:
"beginExecutionTime": null, "cancellationTime": null, "quantumComputingData":
{"count": 1}, "errorData": null, "isCancelling": false, "tags": [], "name":
"azure-quantum-job", "id": "00000000-0000-0000-0000-000000000001", "providerId":
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-19T13:52:26.1429543+00:00",
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-30T13:58:53.5070643+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -543,7 +548,7 @@ interactions:
"beginExecutionTime": null, "cancellationTime": null, "quantumComputingData":
{"count": 1}, "errorData": null, "isCancelling": false, "tags": [], "name":
"azure-quantum-job", "id": "00000000-0000-0000-0000-000000000001", "providerId":
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-19T13:52:26.1429543+00:00",
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-30T13:58:53.5070643+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -591,7 +596,7 @@ interactions:
"beginExecutionTime": null, "cancellationTime": null, "quantumComputingData":
{"count": 1}, "errorData": null, "isCancelling": false, "tags": [], "name":
"azure-quantum-job", "id": "00000000-0000-0000-0000-000000000001", "providerId":
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-19T13:52:26.1429543+00:00",
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-30T13:58:53.5070643+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -639,7 +644,7 @@ interactions:
"beginExecutionTime": null, "cancellationTime": null, "quantumComputingData":
{"count": 1}, "errorData": null, "isCancelling": false, "tags": [], "name":
"azure-quantum-job", "id": "00000000-0000-0000-0000-000000000001", "providerId":
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-19T13:52:26.1429543+00:00",
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-30T13:58:53.5070643+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -684,11 +689,11 @@ interactions:
"errorBudget": 0.003}], "resumeAfterFailedItem": true}, "metadata": null,
"sessionId": null, "status": "Succeeded", "jobType": "QuantumComputing", "outputDataFormat":
"microsoft.resource-estimates.v1", "outputDataUri": "https://mystorage.blob.core.windows.net/job-00000000-0000-0000-0000-000000000001/rawOutputData?sv=PLACEHOLDER&sr=b&sig=PLACEHOLDER&se=2050-01-01T00%3A00%3A00Z&sp=r&rscd=attachment%3B%20filename%3Dazure-quantum-job-00000000-0000-0000-0000-000000000001.output.json",
"beginExecutionTime": "2024-04-19T13:52:30.4849197Z", "cancellationTime":
"beginExecutionTime": "2024-04-30T13:58:56.5574763Z", "cancellationTime":
null, "quantumComputingData": {"count": 1}, "errorData": null, "isCancelling":
false, "tags": [], "name": "azure-quantum-job", "id": "00000000-0000-0000-0000-000000000001",
"providerId": "microsoft-qc", "target": "microsoft.estimator", "creationTime":
"2024-04-19T13:52:26.1429543+00:00", "endExecutionTime": "2024-04-19T13:52:33.1903802Z",
"2024-04-30T13:58:53.5070643+00:00", "endExecutionTime": "2024-04-30T13:58:59.2925741Z",
"costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand All @@ -714,7 +719,7 @@ interactions:
User-Agent:
- azsdk-python-storage-blob/12.19.1 Python/3.9.19 (Windows-10-10.0.22631-SP0)
x-ms-date:
- Fri, 19 Apr 2024 13:52:34 GMT
- Tue, 30 Apr 2024 13:59:01 GMT
x-ms-range:
- bytes=0-33554431
x-ms-version:
Expand Down Expand Up @@ -1789,7 +1794,7 @@ interactions:
x-ms-blob-type:
- BlockBlob
x-ms-creation-time:
- Fri, 19 Apr 2024 13:52:26 GMT
- Tue, 30 Apr 2024 13:58:54 GMT
x-ms-lease-state:
- available
x-ms-lease-status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,21 @@ interactions:
uri: https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token
response:
body:
string: '{"token_type": "Bearer", "expires_in": 1745070756, "ext_expires_in":
1745070756, "refresh_in": 31536000, "access_token": "PLACEHOLDER"}'
string: '{"error": "invalid_client", "error_description": "AADSTS7000215: Invalid
client secret provided. Ensure the secret being sent in the request is the
client secret value, not the client secret ID, for a secret added to app ''00000000-0000-0000-0000-000000000000''.
Trace ID: 16170e86-6a4b-432c-9f56-1abaca3f7400 Correlation ID: f78d4850-bf38-455b-8d45-e720eb11d0ad
Timestamp: 2024-04-30 13:59:03Z", "error_codes": [7000215], "timestamp": "2024-04-30
13:59:03Z", "trace_id": "16170e86-6a4b-432c-9f56-1abaca3f7400", "correlation_id":
"f78d4850-bf38-455b-8d45-e720eb11d0ad", "error_uri": "https://login.microsoftonline.com/error?code=7000215"}'
headers:
content-length:
- '135'
- '636'
content-type:
- application/json; charset=utf-8
status:
code: 200
message: OK
code: 401
message: Unauthorized
- request:
body: 'b''{"containerName": "job-00000000-0000-0000-0000-000000000001"}'''
headers:
Expand Down Expand Up @@ -80,15 +85,15 @@ interactions:
User-Agent:
- azsdk-python-storage-blob/12.19.1 Python/3.9.19 (Windows-10-10.0.22631-SP0)
x-ms-date:
- Fri, 19 Apr 2024 13:52:37 GMT
- Tue, 30 Apr 2024 13:59:05 GMT
x-ms-version:
- '2023-11-03'
method: GET
uri: https://mystorage.blob.core.windows.net/job-00000000-0000-0000-0000-000000000001?restype=container&sv=PLACEHOLDER&sig=PLACEHOLDER&se=2050-01-01T00%3A00%3A00Z&srt=co&ss=b&sp=racwl
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ContainerNotFound</Code><Message>The
specified container does not exist.\nRequestId:a07b71ca-901e-000e-4560-920570000000\nTime:2024-04-19T13:52:38.3633081Z</Message></Error>"
specified container does not exist.\nRequestId:126eff9f-e01e-003b-7106-9b6964000000\nTime:2024-04-30T13:59:06.8202923Z</Message></Error>"
headers:
content-length:
- '223'
Expand All @@ -113,7 +118,7 @@ interactions:
User-Agent:
- azsdk-python-storage-blob/12.19.1 Python/3.9.19 (Windows-10-10.0.22631-SP0)
x-ms-date:
- Fri, 19 Apr 2024 13:52:38 GMT
- Tue, 30 Apr 2024 13:59:06 GMT
x-ms-version:
- '2023-11-03'
method: PUT
Expand Down Expand Up @@ -141,7 +146,7 @@ interactions:
User-Agent:
- azsdk-python-storage-blob/12.19.1 Python/3.9.19 (Windows-10-10.0.22631-SP0)
x-ms-date:
- Fri, 19 Apr 2024 13:52:38 GMT
- Tue, 30 Apr 2024 13:59:06 GMT
x-ms-version:
- '2023-11-03'
method: GET
Expand Down Expand Up @@ -234,7 +239,7 @@ interactions:
x-ms-blob-type:
- BlockBlob
x-ms-date:
- Fri, 19 Apr 2024 13:52:39 GMT
- Tue, 30 Apr 2024 13:59:07 GMT
x-ms-version:
- '2023-11-03'
method: PUT
Expand Down Expand Up @@ -282,7 +287,7 @@ interactions:
"beginExecutionTime": null, "cancellationTime": null, "quantumComputingData":
null, "errorData": null, "isCancelling": false, "tags": [], "name": "azure-quantum-job",
"id": "00000000-0000-0000-0000-000000000001", "providerId": "microsoft-qc",
"target": "microsoft.estimator", "creationTime": "2024-04-19T13:52:39.9665887+00:00",
"target": "microsoft.estimator", "creationTime": "2024-04-30T13:59:08.4692029+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -319,7 +324,7 @@ interactions:
"beginExecutionTime": null, "cancellationTime": null, "quantumComputingData":
{"count": 1}, "errorData": null, "isCancelling": false, "tags": [], "name":
"azure-quantum-job", "id": "00000000-0000-0000-0000-000000000001", "providerId":
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-19T13:52:39.9665887+00:00",
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-30T13:59:08.4692029+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -356,7 +361,7 @@ interactions:
"beginExecutionTime": null, "cancellationTime": null, "quantumComputingData":
{"count": 1}, "errorData": null, "isCancelling": false, "tags": [], "name":
"azure-quantum-job", "id": "00000000-0000-0000-0000-000000000001", "providerId":
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-19T13:52:39.9665887+00:00",
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-30T13:59:08.4692029+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -393,7 +398,7 @@ interactions:
"beginExecutionTime": null, "cancellationTime": null, "quantumComputingData":
{"count": 1}, "errorData": null, "isCancelling": false, "tags": [], "name":
"azure-quantum-job", "id": "00000000-0000-0000-0000-000000000001", "providerId":
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-19T13:52:39.9665887+00:00",
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-30T13:59:08.4692029+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -430,7 +435,7 @@ interactions:
"beginExecutionTime": null, "cancellationTime": null, "quantumComputingData":
{"count": 1}, "errorData": null, "isCancelling": false, "tags": [], "name":
"azure-quantum-job", "id": "00000000-0000-0000-0000-000000000001", "providerId":
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-19T13:52:39.9665887+00:00",
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-04-30T13:59:08.4692029+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -464,11 +469,11 @@ interactions:
"inputDataFormat": "qir.v1", "inputParams": {"errorBudget": 2}, "metadata":
null, "sessionId": null, "status": "Executing", "jobType": "QuantumComputing",
"outputDataFormat": "microsoft.resource-estimates.v1", "outputDataUri": "https://mystorage.blob.core.windows.net/job-00000000-0000-0000-0000-000000000001/outputData?sv=PLACEHOLDER&sr=b&sig=PLACEHOLDER&se=2050-01-01T00%3A00%3A00Z&sp=r&rscd=attachment%3B%20filename%3Dazure-quantum-job-00000000-0000-0000-0000-000000000001.output.json",
"beginExecutionTime": "2024-04-19T13:52:40.3933754Z", "cancellationTime":
"beginExecutionTime": "2024-04-30T13:59:08.8623853Z", "cancellationTime":
null, "quantumComputingData": {"count": 1}, "errorData": null, "isCancelling":
false, "tags": [], "name": "azure-quantum-job", "id": "00000000-0000-0000-0000-000000000001",
"providerId": "microsoft-qc", "target": "microsoft.estimator", "creationTime":
"2024-04-19T13:52:39.9665887+00:00", "endExecutionTime": null, "costEstimate":
"2024-04-30T13:59:08.4692029+00:00", "endExecutionTime": null, "costEstimate":
null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -502,13 +507,13 @@ interactions:
"inputDataFormat": "qir.v1", "inputParams": {"errorBudget": 2}, "metadata":
null, "sessionId": null, "status": "Failed", "jobType": "QuantumComputing",
"outputDataFormat": "microsoft.resource-estimates.v1", "outputDataUri": "https://mystorage.blob.core.windows.net/job-00000000-0000-0000-0000-000000000001/rawOutputData?sv=PLACEHOLDER&sr=b&sig=PLACEHOLDER&se=2050-01-01T00%3A00%3A00Z&sp=r&rscd=attachment%3B%20filename%3Dazure-quantum-job-00000000-0000-0000-0000-000000000001.output.json",
"beginExecutionTime": "2024-04-19T13:52:40.4980998Z", "cancellationTime":
"beginExecutionTime": "2024-04-30T13:59:09.1107386Z", "cancellationTime":
null, "quantumComputingData": {"count": 1}, "errorData": {"code": "InvalidInputError",
"message": "The error budget must be between 0.0 and 1.0, provided input was
`2`"}, "isCancelling": false, "tags": [], "name": "azure-quantum-job", "id":
"00000000-0000-0000-0000-000000000001", "providerId": "microsoft-qc", "target":
"microsoft.estimator", "creationTime": "2024-04-19T13:52:39.9665887+00:00",
"endExecutionTime": "2024-04-19T13:52:42.9628051Z", "costEstimate": null,
"microsoft.estimator", "creationTime": "2024-04-30T13:59:08.4692029+00:00",
"endExecutionTime": "2024-04-30T13:59:11.4415955Z", "costEstimate": null,
"itemType": "Job"}'
headers:
connection:
Expand Down
Loading
Loading