qiskit_superstaq.superstaq_job ============================== .. py:module:: qiskit_superstaq.superstaq_job Classes ------- .. autoapisummary:: qiskit_superstaq.superstaq_job.SuperstaqJob qiskit_superstaq.superstaq_job.SuperstaqJobV3 Module Contents --------------- .. py:class:: SuperstaqJob(backend: qiskit_superstaq.SuperstaqBackend, job_id: str) Bases: :py:obj:`qiskit.providers.JobV1` This class represents a Superstaq job instance. .. py:method:: cancel(index: int | None = None, **kwargs: object) -> None Cancel the current job if it is not in a terminal state. :param index: An optional index of the specific sub-job to cancel. :param kwargs: Extra options needed to fetch jobs. :raises ~general_superstaq.SuperstaqServerException: If unable to get the status of the job from the API or cancellations were unsuccessful. .. py:method:: compiled_circuits(index: int) -> qiskit.QuantumCircuit compiled_circuits(index: None = None) -> list[qiskit.QuantumCircuit] Gets the compiled circuits that were processed for this job. :param index: An optional index of the specific circuit to retrieve. :returns: A single compiled circuit or list of compiled circuits. .. py:method:: input_circuits(index: int) -> qiskit.QuantumCircuit input_circuits(index: None = None) -> list[qiskit.QuantumCircuit] Gets the original circuits that were submitted for this job. :param index: An optional index of the specific circuit to retrieve. :returns: The input circuit or list of submitted input circuits. .. py:method:: 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. :param index: An optional index of the pulse gate circuit to retrieve. :returns: A single pulse gate circuit or list of pulse gate circuits. .. py:method:: 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. :param index: An optional index to retrieve a specific result from a result list. :param timeout: An optional parameter that fixes when result retrieval times out. Units are in seconds. :param wait: An optional parameter that sets the interval to check for Superstaq job results. Units are in seconds. Defaults to 5. :param qubit_indices: The qubit indices to return the results of individually. :returns: A qiskit result object containing job information. .. py:method:: status(index: int | None = None) -> qiskit.providers.jobstatus.JobStatus Query for the equivalent qiskit job status. :param index: An optional index to retreive a specific job status. :returns: The equivalent `qiskit.providers.jobstatus.JobStatus` type. .. py:method:: submit() -> None :abstractmethod: Unsupported submission call. :raises NotImplementedError: If a job is submitted via `SuperstaqJob`. .. py:method:: 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. .. py:attribute:: ALL_STATES :value: ('Done', 'Cancelled', 'Failed', 'Queued', 'Submitted', 'Running') .. py:attribute:: PROCESSING_STATES :value: ('Queued', 'Submitted', 'Running') .. py:attribute:: TERMINAL_STATES :value: ('Done', 'Cancelled', 'Failed') .. py:class:: SuperstaqJobV3(client: general_superstaq.superstaq_client._SuperstaqClientV3, job_id: uuid.UUID | str) Bases: :py:obj:`general_superstaq.job.Job`, :py:obj:`qiskit.providers.JobV1` This class represents a Superstaq job instance. .. py:method:: 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. :param timeout: An optional parameter that fixes when result retrieval times out. Units are in seconds. :param wait: An optional parameter that sets the interval to check for Superstaq job results. Units are in seconds. Defaults to 5. :param 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. .. py:method:: compiled_circuits(index: int) -> qiskit.QuantumCircuit compiled_circuits(index: None = None) -> list[qiskit.QuantumCircuit] Gets the compiled circuits that were processed for this job. :param index: An optional index of the specific circuit to retrieve. :returns: A single compiled circuit or list of compiled circuits. .. py:method:: 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). :param 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. .. py:method:: 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). :param 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. .. py:method:: input_circuits(index: int) -> qiskit.QuantumCircuit input_circuits(index: None = None) -> list[qiskit.QuantumCircuit] Gets the original circuits that were submitted for this job. :param index: An optional index of the specific circuit to retrieve. :returns: The input circuit or list of submitted input circuits. .. py:method:: 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. :param index: An optional index to retrieve a specific result from a result list. :param timeout: An optional parameter that fixes when result retrieval times out. Units are in seconds. :param wait: An optional parameter that sets the interval to check for Superstaq job results. Units are in seconds. Defaults to 5. :param qubit_indices: The qubit indices to return the results of individually. :returns: A qiskit result object containing job information. .. py:method:: status(index: int | None = None) -> qiskit.providers.JobStatus Query for the equivalent qiskit job status. :param index: An optional index to retreive a specific job status. :returns: The equivalent `qiskit.providers.jobstatus.JobStatus` type. .. py:method:: submit() -> None :abstractmethod: Unsupported submission call. :raises NotImplementedError: If a job is submitted via `SuperstaqJob`. .. py:attribute:: endianness .. py:attribute:: shots