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

Don't store circuit params automatically #1010

Merged
merged 13 commits into from
Aug 23, 2023
1 change: 0 additions & 1 deletion qiskit_ibm_runtime/qiskit_runtime_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,6 @@ def run(
client_params=self._client_params,
job_id=response["id"],
program_id=program_id,
params=inputs,
user_callback=callback,
result_decoder=result_decoder,
image=qrt_options.image,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
upgrade:
- |
Circuits and other input parameters will no longer be automatically stored in runtime jobs. They can still be retrieved
with :meth:`qiskit_ibm_runtime.RuntimeJob.inputs`.
8 changes: 8 additions & 0 deletions test/integration/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,14 @@ def test_updating_job_tags(self, service):
job.update_tags(new_job_tag)
self.assertTrue(job.tags, new_job_tag)

@run_integration_test
def test_circuit_params_not_stored(self, service):
"""Test that circuits are not automatically stored in the job params."""
job = self._run_program(service)
job.wait_for_final_state()
self.assertFalse(job._params)
self.assertTrue(job.inputs)

def _assert_complex_types_equal(self, expected, received):
"""Verify the received data in complex types is expected."""
if "serializable_class" in received:
Expand Down
2 changes: 2 additions & 0 deletions test/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def from_json(cls, json_str):
return cls(**json.loads(json_str))

def __eq__(self, other):
if isinstance(other, str):
return self.value == self.from_json(other).value
return self.value == other.value


Expand Down
2 changes: 1 addition & 1 deletion test/unit/mock/fake_runtime_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def to_dict(self):
"project": self._project,
"backend": self._backend_name,
"state": {"status": self._status, "reason": self._reason},
"params": [self._params],
"params": self._params,
"program": {"id": self._program_id},
"image": self._image,
}
Expand Down