JobsServicer#

class JobsServicer#

Bases: object

User job management APIs.

Module: iqm.station_control.client.iqm_server.proto.job_pb2_grpc

Methods

CancelJobV1

Cancel a queued job by JobLookup.

GetJobPayloadV1

Get job payload as GRPC data chunk streams by JobLookup .

GetJobResultsV1

Get job result as GRPC data chunk streams by JobLookup.

GetJobV1

Get job details by JobLookup.

SubmitJobV1

Submits a new job to the quantum computer.

SubscribeToJobV1

Subscribes to the job changes.

SubmitJobV1(request, context)#

Submits a new job to the quantum computer. If the submit succeeds, returns the handle for the submitted job.

## Errors In case of an error, a GRPC error status is returned with some optional additional details. The possible error cases are described below:

### Invalid payload This error is returned if the given job payload is not accepted by the target quantum computer. Note that different quantum computers might accept different payloads. ` Code = "INVALID_ARGUMENT" Metadata.error_code = "invalid_payload" Details = https://protobuf.dev/reference/protobuf/google.protobuf/#value { "errors": [<list-of-error-messages>] } `

### Job type not supported This error is returned if the target quantum computer does not support the given job type (circuit, pulse). ` Code = "INVALID_ARGUMENT" Metadata.error_code = "job_type_not_supported" `

### User job quota exceeded This error is returned if the user has already submitted the maximum allowed amount of jobs to the queue. Quota can be freed by either waiting for existing jobs to finish or manually cancelling them (either via the API or the web). ` Code = "RESOURCE_EXHAUSTED" Metadata.error_code = "quota_exceeded" `

### Account does not have any active or upcoming timeslots This error is returned if the job is submitted with the use_timeslot flag enabled, but the user’s account does not have active or upcoming timeslots booked. ` Code = "FAILED_PRECONDITION" Metadata.error_code = "no_booked_timeslots" `

### Timeslot is required to execute job This error is returned if the target quantum computer requires timeslot to execute jobs but use_timeslot was unset (or set to false). ` Code = "FAILED_PRECONDITION" Metadata.error_code = "timeslot_required" `

### Quantum computer not found This error is returned if the qc_id does not match any existing quantum computer. ` Code = "NOT_FOUND" Metadata.error_code = "not_found" `

GetJobV1(request, context)#

Get job details by JobLookup. Returns the job if the user job exists. User needs to be authorised to access the job data, i.e. the job must be created by the user.

## Errors In case of an error, a GRPC error status is returned with some optional additional details. The possible error cases are described below:

### Job not found This error is returned if the JobLookup does not match any existing job. ` Code = "NOT_FOUND" Metadata.error_code = "not_found" `

### Quantum computer not found This error is returned if quantum computer associated with the job does not match any existing quantum computer. ` Code = "NOT_FOUND" Metadata.error_code = "not_found" `

SubscribeToJobV1(request, context)#

Subscribes to the job changes. Returns a stream that emits the job at subscription moment and after that the changed job every time when the job state changes. The stream will end automatically when the job is considered as “final” and won’t be updated anymore in the future (cancelled, interrupted, failed, completed).

The stream may also emit empty Keepalive messages to indicate that job is still being processed but hasn’t been updated. Clients may ignore these keepalive messages.

## Errors

### Job not found If the job does not exist with the given lookup, the following error is returned upon the subscription. ` Code = "NOT_FOUND" Metadata.error_code = "not_found" `

### Job deleted during the subscription If the job gets deleted during the open subscription, the subscription stream will emit the following error and close immediately after that. ` Code = "ABORTED" Metadata.error_code = "job_deleted" `

### Server cancellation If server wants to cancel the subscription (e.g. due to restarts or maintenance), the subscription stream will emit the following error and close immediately after that. ` Code = "ABORTED" Metadata.error_code = "server_cancel" `

GetJobPayloadV1(request, context)#

Get job payload as GRPC data chunk streams by JobLookup . Returns the job input data if the user job exists. User needs to be authorised to access the job.

## Errors In case of an error, a GRPC error status is returned with some optional additional details. The possible error cases are described below:

### Job not found This error is returned if the JobLookup does not match any existing job. ` Code = "NOT_FOUND" Metadata.error_code = "not_found" `

### Job payload not found This error is returned if the job payload is not found. ` Code = "NOT_FOUND" Metadata.error_code = "not_found" `

GetJobResultsV1(request, context)#

Get job result as GRPC data chunk streams by JobLookup. Returns the job measurements data if the user job exists. User needs to be authorised to access the job.

## Errors In case of an error, a GRPC error status is returned with some optional additional details. The possible error cases are described below:

### Job not found This error is returned if the JobLookup does not match any existing job. ` Code = "NOT_FOUND" Metadata.error_code = "not_found" `

### Job results not found This error is returned if the job results is not found. ` Code = "NOT_FOUND" Metadata.error_code = "not_found" `

CancelJobV1(request, context)#

Cancel a queued job by JobLookup. Returns the updated job when cancelled. User needs to be authorised to access the job.

## Errors In case of an error, a GRPC error status is returned with some optional additional details. The possible error cases are described below:

### Job not found This error is returned if the JobLookup does not match any existing user job. ` Code = "NOT_FOUND" Metadata.error_code = "not_found" `

### Can’t cancel job from QC because it’s already in final state This error is returned if the job measurements is not found. ` Code = "FAILED_PRECONDITION" Metadata.error_code = "job_not_submitted_to_qc" `

### Quantum computer not found This error is returned if quantum computer associated with the job does not match any existing quantum computer. ` Code = "NOT_FOUND" Metadata.error_code = "not_found" `