From d068f9b96bd432ef8a05ef8e952a200d8babaef2 Mon Sep 17 00:00:00 2001 From: jon donovan Date: Wed, 11 May 2022 12:28:22 -0700 Subject: [PATCH 1/2] IonQ: Explicitly select lang We were planning on making this arg optional, but it shouldn't hurt to also send it explicitly --- cirq-ionq/cirq_ionq/ionq_client.py | 2 +- cirq-ionq/cirq_ionq/ionq_client_test.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cirq-ionq/cirq_ionq/ionq_client.py b/cirq-ionq/cirq_ionq/ionq_client.py index 472dc65095a..a5cd4c770ea 100644 --- a/cirq-ionq/cirq_ionq/ionq_client.py +++ b/cirq-ionq/cirq_ionq/ionq_client.py @@ -118,7 +118,7 @@ def create_job( """ actual_target = self._target(target) - json: Dict[str, Any] = {'target': actual_target, 'body': serialized_program.body} + json: Dict[str, Any] = {'target': actual_target, 'lang': 'json', 'body': serialized_program.body} if name: json['name'] = name # We have to pass measurement keys through the metadata. diff --git a/cirq-ionq/cirq_ionq/ionq_client_test.py b/cirq-ionq/cirq_ionq/ionq_client_test.py index ce054a227a4..28aa553b794 100644 --- a/cirq-ionq/cirq_ionq/ionq_client_test.py +++ b/cirq-ionq/cirq_ionq/ionq_client_test.py @@ -102,6 +102,7 @@ def test_ionq_client_create_job(mock_post): expected_json = { 'target': 'qpu', + 'lang': 'json', 'body': {'job': 'mine'}, 'name': 'bacon', 'shots': '200', From c7099349bc19f87731a5bd37fd794e9586dd52d8 Mon Sep 17 00:00:00 2001 From: jon donovan Date: Wed, 11 May 2022 12:29:23 -0700 Subject: [PATCH 2/2] fmt --- cirq-ionq/cirq_ionq/ionq_client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cirq-ionq/cirq_ionq/ionq_client.py b/cirq-ionq/cirq_ionq/ionq_client.py index a5cd4c770ea..e225963ca78 100644 --- a/cirq-ionq/cirq_ionq/ionq_client.py +++ b/cirq-ionq/cirq_ionq/ionq_client.py @@ -118,7 +118,11 @@ def create_job( """ actual_target = self._target(target) - json: Dict[str, Any] = {'target': actual_target, 'lang': 'json', 'body': serialized_program.body} + json: Dict[str, Any] = { + 'target': actual_target, + 'lang': 'json', + 'body': serialized_program.body, + } if name: json['name'] = name # We have to pass measurement keys through the metadata.