qiskit_superstaq.superstaq_job
Classes
This class represents a Superstaq job instance. |
|
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')
- class qiskit_superstaq.superstaq_job.SuperstaqJobV3(client: general_superstaq.superstaq_client._SuperstaqClientV3, job_id: uuid.UUID | str)
Bases:
general_superstaq.job.Job,qiskit.providers.JobV1This class represents a Superstaq job instance.
- combined_result(*, timeout: float | None = None, wait: float = 5, qubit_indices: collections.abc.Sequence[int] | None = None) qiskit.result.Result
Create a results object combining the counts from all circuits.
- Parameters:
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 combined job information.
- Raises:
ValueError – If this job’s circuits don’t have the same number of measurements.
- 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.
- final_logical_to_physical(index: None = None) list[dict[int, int]]
- final_logical_to_physical(index: int) dict[int, int]
Mapping of logical qubits to physical qubits at the end of the circuit(s).
Here “logical” refers to qubits in the submitted input circuit(s), while “physical” refers to those in the compiled circuits (which correspond to those on the hardware itself).
- Parameters:
index – An optional index of the specific circuit to retrieve.
- Returns:
A single logical to physical map (if index is passed) or list of maps for all input circuits.
- initial_logical_to_physical(index: None = None) list[dict[int, int]]
- initial_logical_to_physical(index: int) dict[int, int]
Mapping of logical qubits to physical qubits at the start of the circuit(s).
Here “logical” qubits refer to qubits in the input circuit, while “physical” refers to those in the compiled circuits (and on the hardware itself).
- Parameters:
index – An optional index of the specific circuit to retrieve.
- Returns:
A single logical to physical map (if index is passed) or list of maps for all input 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.
- 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
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.
- endianness
- shots