diff --git a/qiskit_ibm_provider/job/ibm_composite_job.py b/qiskit_ibm_provider/job/ibm_composite_job.py index 7a62650b2..11e1a6038 100644 --- a/qiskit_ibm_provider/job/ibm_composite_job.py +++ b/qiskit_ibm_provider/job/ibm_composite_job.py @@ -374,16 +374,13 @@ def _async_submit(self, sub_job: SubJob) -> None: @_requires_submit def properties( - self, refresh: bool = False, datetime: Optional[python_datetime] = None + self, refresh: bool = False ) -> Optional[Union[List[BackendProperties], BackendProperties]]: """Return the backend properties for this job. Args: refresh: If ``True``, re-query the server for the backend properties. Otherwise, return a cached version. - datetime: By specifying `datetime`, this function returns an instance - of the :class:`BackendProperties` - whose timestamp is closest to, but older than, the specified `datetime`. Note: This method blocks until all sub-jobs are submitted. @@ -401,7 +398,7 @@ def properties( self._properties = [] properties_ts = [] for job in self._get_circuit_jobs(): - props = job.properties(refresh, datetime) + props = job.properties(refresh) if props.last_update_date not in properties_ts: self._properties.append(props) properties_ts.append(props.last_update_date) diff --git a/qiskit_ibm_provider/job/ibm_job.py b/qiskit_ibm_provider/job/ibm_job.py index 07455d3d0..beb860756 100644 --- a/qiskit_ibm_provider/job/ibm_job.py +++ b/qiskit_ibm_provider/job/ibm_job.py @@ -68,23 +68,18 @@ def __init__( # Append suffix to key to avoid conflicts. self._data[key + "_"] = value - def properties( - self, refresh: bool = False, datetime: Optional[python_datetime] = None - ) -> Optional[BackendProperties]: + def properties(self, refresh: bool = False) -> Optional[BackendProperties]: """Return the backend properties for this job. Args: refresh: If ``True``, re-query the server for the backend properties. Otherwise, return a cached version. - datetime: By specifying `datetime`, this function returns an instance - of the :class:`BackendProperties` - whose timestamp is closest to, but older than, the specified `datetime`. Returns: - The backend properties used for this job, or ``None`` if - properties are not available. + The backend properties used for this job, at the time the job was run, + or ``None`` if properties are not available. """ - return self._backend.properties(refresh, datetime) + return self._backend.properties(refresh, self.creation_date()) @abstractmethod def result( diff --git a/releasenotes/notes/job-properties-creation-date-658a3ad4bfcb923b.yaml b/releasenotes/notes/job-properties-creation-date-658a3ad4bfcb923b.yaml new file mode 100644 index 000000000..d7739ce39 --- /dev/null +++ b/releasenotes/notes/job-properties-creation-date-658a3ad4bfcb923b.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + When retrieving the backend properties of a job with + :meth:`~qiskit_ibm_provider.job.IBMJob.properties`, the job creation date is now + used to get the specific backend properties used when the job was run. +