qiskit_superstaq.superstaq_job
Classes
This class represents a Superstaq job instance. |
Module Contents
- class qiskit_superstaq.superstaq_job.SuperstaqJob(backend: qiskit_superstaq.SuperstaqBackend, job_id: str)
Bases:
qiskit.providers.JobV1This class represents a Superstaq job instance.
- cancel(index: int | None = None, **kwargs: object) None
Cancel the current job if it is not in a terminal state.
- Parameters:
index – An optional index of the specific sub-job to cancel.
kwargs – Extra options needed to fetch jobs.
- Raises:
SuperstaqServerException – If unable to get the status of the job from the API or cancellations were unsuccessful.
- compiled_circuits(index: int) qiskit.QuantumCircuit
- compiled_circuits(index: None = None) list[qiskit.QuantumCircuit]
Gets the compiled circuits that were processed for this job.
- Parameters:
index – An optional index of the specific circuit to retrieve.
- Returns:
A single compiled circuit or list of compiled circuits.
- input_circuits(index: int) qiskit.QuantumCircuit
- input_circuits(index: None = None) list[qiskit.QuantumCircuit]
Gets the original circuits that were submitted for this job.
- Parameters:
index – An optional index of the specific circuit to retrieve.
- Returns:
The input circuit or list of submitted input circuits.
- pulse_gate_circuits(index: int) qiskit.QuantumCircuit
- pulse_gate_circuits(index: None = None) list[qiskit.QuantumCircuit]
Gets the pulse gate circuit(s) returned by this job.
- Parameters:
index – An optional index of the pulse gate circuit to retrieve.
- Returns:
A single pulse gate circuit or list of pulse gate circuits.
- result(index: int | None = None, timeout: float | None = None, wait: float = 5, qubit_indices: collections.abc.Sequence[int] | None = None) qiskit.result.Result
Retrieves the result data associated with a Superstaq job.
- Parameters:
index – An optional index to retrieve a specific result from a result list.
timeout – An optional parameter that fixes when result retrieval times out. Units are in seconds.
wait – An optional parameter that sets the interval to check for Superstaq job results. Units are in seconds. Defaults to 5.
qubit_indices – The qubit indices to return the results of individually.
- Returns:
A qiskit result object containing job information.
- status(index: int | None = None) qiskit.providers.jobstatus.JobStatus
Query for the equivalent qiskit job status.
- Parameters:
index – An optional index to retreive a specific job status.
- Returns:
The equivalent qiskit.providers.jobstatus.JobStatus type.
- abstract submit() None
Unsupported submission call.
- Raises:
NotImplementedError – If a job is submitted via SuperstaqJob.
- to_dict() dict[str, general_superstaq.typing.Job]
Refreshes and returns job information.
Note
The contents of this dictionary are not guaranteed to be consistent over time. Whenever possible, users should use the specific SuperstaqJob methods to retrieve the desired job information instead of relying on particular entries in the output of this method.
- Returns:
A dictionary containing updated job information.
- ALL_STATES = ('Done', 'Cancelled', 'Failed', 'Queued', 'Submitted', 'Running')
- PROCESSING_STATES = ('Queued', 'Submitted', 'Running')
- TERMINAL_STATES = ('Done', 'Cancelled', 'Failed')