schrodinger.application.matsci.qb_sdk.job module¶
- class schrodinger.application.matsci.qb_sdk.job.QubecJob(job_id: str, experiment: Optional[str] = None, backend_type: Optional[str] = None, backend: Optional[dict] = None, problem: Optional[dict] = None, **parameters)[source]¶
Bases:
object
Class representing a running or completed job on the QUBEC platform
- Attributes:
job_id (str): The unique ID assigned by QUBEC to the job experiment (str): A string representing the desired quantum algorithm to run backend_type (str): A string representing the type of quantum backend to use backend (dict): A dictionary with relevant backend information problem (dict): dictionary with problem definition parameters (dict): Any additional parameters which has been sent to the QUBEC
job submission engine
status (str): The status of the job result (dict): A dictionary with partial or full results of the job error (str): A string with an error message if any problem occurred during job submission
- __init__(job_id: str, experiment: Optional[str] = None, backend_type: Optional[str] = None, backend: Optional[dict] = None, problem: Optional[dict] = None, **parameters) None [source]¶
Initialize an instance of the QubecJob class representing a running or completed job on the QUBEC platform
- Args:
job_id (str): The unique ID assigned by QUBEC to the job experiment (str): A string representing the desired quantum algorithm to run backend_type (str): A string representing the type of quantum backend to use backend (dict): A dictionary with relevant backend information problem (dict): dictionary with problem definition **parameters (dict): Any additional parameters which has been sent to the QUBEC
job submission engine
- wait_completion(timeout=86400) None [source]¶
Wait until the job has completed by periodically querying the results in the backend. If the session has expired, the token will be refreshed
- Args:
timeout (int): A timeout after which stopping to listen for job progresses
- Raises:
- QubecSdkError if any error occured while querying for QUBEC job
progress in the backend
- cancel() dict [source]¶
Send a remote cancellation request of the job
- Returns:
A dictionary with the cancellation API response
- Raises:
QubecSdkError if the cancellation request failed
- get_result(use_cached: bool = False) dict [source]¶
Get the available results of the current job
- Args:
use_cached (bool): If true, do not perform any request and used cached result values
- Returns:
A dictionary with the job results
- get_status(use_cached: bool = False) Optional[str] [source]¶
Get the current status of the job Args:
use_cached (bool): If true, do not perform any request and used cached result values
- Returns:
A string with the job status
- static from_id(job_id: str) schrodinger.application.matsci.qb_sdk.job.QubecJob [source]¶