Skip to content

Commit

Permalink
Update cirq libraries. (#605)
Browse files Browse the repository at this point in the history
* update cirq libraries

* Add missing get_results method to the _IonqClient wrapper
  • Loading branch information
ArthurKamalov authored Jun 25, 2024
1 parent 3a2f2f1 commit cdf55c8
Show file tree
Hide file tree
Showing 107 changed files with 9,539 additions and 6,837 deletions.
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"]



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.

188 changes: 93 additions & 95 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,8 +26,8 @@ interactions:
uri: https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token
response:
body:
string: '{"token_type": "Bearer", "expires_in": 1746121155, "ext_expires_in":
1746121155, "refresh_in": 31536000, "access_token": "PLACEHOLDER"}'
string: '{"token_type": "Bearer", "expires_in": 1746170943, "ext_expires_in":
1746170943, "refresh_in": 31536000, "access_token": "PLACEHOLDER"}'
headers:
content-length:
- '135'
Expand Down Expand Up @@ -80,15 +80,15 @@ interactions:
User-Agent:
- azsdk-python-storage-blob/12.19.1 Python/3.9.19 (Windows-10-10.0.22631-SP0)
x-ms-date:
- Wed, 01 May 2024 17:39:16 GMT
- Thu, 02 May 2024 07:29:04 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:a0e2a620-101e-0000-66ee-9b2cc0000000\nTime:2024-05-01T17:39:18.8182471Z</Message></Error>"
specified container does not exist.\nRequestId:15e5a52b-b01e-0044-0d62-9ca6ff000000\nTime:2024-05-02T07:29:07.3597649Z</Message></Error>"
headers:
content-length:
- '223'
Expand All @@ -113,7 +113,7 @@ interactions:
User-Agent:
- azsdk-python-storage-blob/12.19.1 Python/3.9.19 (Windows-10-10.0.22631-SP0)
x-ms-date:
- Wed, 01 May 2024 17:39:17 GMT
- Thu, 02 May 2024 07:29:05 GMT
x-ms-version:
- '2023-11-03'
method: PUT
Expand Down Expand Up @@ -141,7 +141,7 @@ interactions:
User-Agent:
- azsdk-python-storage-blob/12.19.1 Python/3.9.19 (Windows-10-10.0.22631-SP0)
x-ms-date:
- Wed, 01 May 2024 17:39:18 GMT
- Thu, 02 May 2024 07:29:05 GMT
x-ms-version:
- '2023-11-03'
method: GET
Expand Down Expand Up @@ -234,7 +234,7 @@ interactions:
x-ms-blob-type:
- BlockBlob
x-ms-date:
- Wed, 01 May 2024 17:39:19 GMT
- Thu, 02 May 2024 07:29:06 GMT
x-ms-version:
- '2023-11-03'
method: PUT
Expand Down Expand Up @@ -303,7 +303,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-05-01T17:39:21.1423165+00:00",
"target": "microsoft.estimator", "creationTime": "2024-05-02T07:29:08.8887373+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -351,7 +351,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-05-01T17:39:21.1423165+00:00",
"target": "microsoft.estimator", "creationTime": "2024-05-02T07:29:08.8887373+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -399,7 +399,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-05-01T17:39:21.1423165+00:00",
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-05-02T07:29:08.8887373+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -447,7 +447,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-05-01T17:39:21.1423165+00:00",
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-05-02T07:29:08.8887373+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -495,7 +495,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-05-01T17:39:21.1423165+00:00",
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-05-02T07:29:08.8887373+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -543,7 +543,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-05-01T17:39:21.1423165+00:00",
"microsoft-qc", "target": "microsoft.estimator", "creationTime": "2024-05-02T07:29:08.8887373+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
Expand Down Expand Up @@ -586,18 +586,19 @@ interactions:
space-efficient"}], "errorBudget": 0.001}, {"constraints": {"maxDuration":
"20s"}, "errorBudget": 0.002}, {"constraints": {"maxPhysicalQubits": 10000},
"errorBudget": 0.003}], "resumeAfterFailedItem": true}, "metadata": null,
"sessionId": null, "status": "Waiting", "jobType": "QuantumComputing", "outputDataFormat":
"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": 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-05-01T17:39:21.1423165+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
"beginExecutionTime": "2024-05-02T07:29:09.9106141Z", "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-05-02T07:29:08.8887373+00:00", "endExecutionTime": "2024-05-02T07:29:12.147985Z",
"costEstimate": null, "itemType": "Job"}'
headers:
connection:
- keep-alive
content-length:
- '2221'
- '2274'
content-type:
- application/json; charset=utf-8
transfer-encoding:
Expand All @@ -618,54 +619,6 @@ interactions:
- azsdk-python-quantum/0.0.1 Python/3.9.19 (Windows-10-10.0.22631-SP0)
method: GET
uri: https://eastus.quantum.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Quantum/workspaces/myworkspace/jobs/00000000-0000-0000-0000-000000000001?api-version=2022-09-12-preview&test-sequence-id=7
response:
body:
string: '{"containerUri": "https://mystorage.blob.core.windows.net/job-00000000-0000-0000-0000-000000000001?sv=PLACEHOLDER&sr=c&sig=PLACEHOLDER&se=2050-01-01T00%3A00%3A00Z&sp=rcwl",
"inputDataUri": "https://mystorage.blob.core.windows.net/job-00000000-0000-0000-0000-000000000001/inputData?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.input.json",
"inputDataFormat": "qir.v1", "inputParams": {"items": [{"qubitParams": {"name":
"qubit_maj_ns_e4", "instructionSet": "majorana", "tGateTime": "10 ns", "twoQubitJointMeasurementErrorRate":
{"process": 5e-05, "readout": 7e-05}, "tGateErrorRate": 0.03, "idleErrorRate":
2e-05}, "distillationUnitSpecifications": [{"displayName": "S", "numInputTs":
1, "numOutputTs": 15, "failureProbabilityFormula": "15.0 * inputErrorRate
+ 356.0 * cliffordErrorRate", "outputErrorRateFormula": "35.0 * inputErrorRate
^ 3 + 7.1 * cliffordErrorRate", "physicalQubitSpecification": {"numUnitQubits":
12, "durationInQubitCycleTime": 45}, "logicalQubitSpecification": {"numUnitQubits":
12, "durationInQubitCycleTime": 45}}, {"name": "15-1 RM"}, {"name": "15-1
space-efficient"}], "errorBudget": 0.001}, {"constraints": {"maxDuration":
"20s"}, "errorBudget": 0.002}, {"constraints": {"maxPhysicalQubits": 10000},
"errorBudget": 0.003}], "resumeAfterFailedItem": true}, "metadata": null,
"sessionId": null, "status": "Waiting", "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": 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-05-01T17:39:21.1423165+00:00",
"endExecutionTime": null, "costEstimate": null, "itemType": "Job"}'
headers:
connection:
- keep-alive
content-length:
- '2221'
content-type:
- application/json; charset=utf-8
transfer-encoding:
- chunked
status:
code: 200
message: OK
- request:
body: null
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- azsdk-python-quantum/0.0.1 Python/3.9.19 (Windows-10-10.0.22631-SP0)
method: GET
uri: https://eastus.quantum.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Quantum/workspaces/myworkspace/jobs/00000000-0000-0000-0000-000000000001?api-version=2022-09-12-preview&test-sequence-id=8
response:
body:
string: '{"containerUri": "https://mystorage.blob.core.windows.net/job-00000000-0000-0000-0000-000000000001?sv=PLACEHOLDER&sr=c&sig=PLACEHOLDER&se=2050-01-01T00%3A00%3A00Z&sp=rcwl",
Expand All @@ -684,17 +637,17 @@ 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-05-01T17:39:26.2320505Z", "cancellationTime":
"beginExecutionTime": "2024-05-02T07:29:09.9106141Z", "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-05-01T17:39:21.1423165+00:00", "endExecutionTime": "2024-05-01T17:39:28.5415479Z",
"2024-05-02T07:29:08.8887373+00:00", "endExecutionTime": "2024-05-02T07:29:12.147985Z",
"costEstimate": null, "itemType": "Job"}'
headers:
connection:
- keep-alive
content-length:
- '2278'
- '2277'
content-type:
- application/json; charset=utf-8
transfer-encoding:
Expand All @@ -714,7 +667,7 @@ interactions:
User-Agent:
- azsdk-python-storage-blob/12.19.1 Python/3.9.19 (Windows-10-10.0.22631-SP0)
x-ms-date:
- Wed, 01 May 2024 17:39:28 GMT
- Thu, 02 May 2024 07:29:12 GMT
x-ms-range:
- bytes=0-33554431
x-ms-version:
Expand Down Expand Up @@ -1789,7 +1742,7 @@ interactions:
x-ms-blob-type:
- BlockBlob
x-ms-creation-time:
- Wed, 01 May 2024 17:39:21 GMT
- Thu, 02 May 2024 07:29:09 GMT
x-ms-lease-state:
- available
x-ms-lease-status:
Expand Down
Loading

0 comments on commit cdf55c8

Please sign in to comment.