Skip to content

Task results

QuEraTaskResults

Bases: BaseModel

export_as_probabilities

export_as_probabilities()

converts from shot results to probabilities

Returns:

Name Type Description
TaskProbabilities TaskProbabilities

The task results as probabilties

Source code in src/bloqade/submission/ir/task_results.py
def export_as_probabilities(self) -> TaskProbabilities:
    """converts from shot results to probabilities

    Returns:
        TaskProbabilities: The task results as probabilties
    """
    counts = dict()
    nshots = len(self.shot_outputs)
    for shot_result in self.shot_outputs:
        pre_sequence_str = "".join(str(bit) for bit in shot_result.pre_sequence)

        post_sequence_str = "".join(str(bit) for bit in shot_result.post_sequence)

        configuration = (pre_sequence_str, post_sequence_str)
        # iterative average
        current_count = counts.get(configuration, 0)
        counts[configuration] = current_count + 1

    probabilities = [(config, count / nshots) for config, count in counts.items()]
    return TaskProbabilities(probabilities=probabilities)

QuEraTaskStatusCode

Bases: str, Enum

An Enum representing the various states a task can be in within the QuEra system.

Attributes:

Name Type Description
Created

The task has been created but not yet started.

Running

The task is currently running.

Completed

The task has completed successfully.

Failed

The task has failed.

Cancelled

The task has been cancelled.

Executing

The task is currently being executed.

Enqueued

The task is in the queue waiting to be executed.

Accepted

The task has been accepted for execution.

Unaccepted

The task has not been accepted for execution.

Partial

The task has partially completed.

Unsubmitted

The task has not been submitted for execution.