kosmos.circuit_runner.qiskit_result

Functions

calculate_expectation_values(counts: dict[str, int]) numpy.ndarray

Calculate Z-basis expectation values for each qubit from counts.

Parameters:

counts (dict[str, int]) – Mapping from bitstring to number of shots.

Returns:

Array of expectation values (one per qubit).

Return type:

np.ndarray

job_expectation_values(job: qiskit_ibm_runtime.RuntimeJobV2) list[numpy.ndarray]

Calculate expectation values from job results.

Parameters:

job (RuntimeJob) – The job to get results for.

Returns:

A list of arrays, where each array contains the expectation

values for one circuit in the job.

Return type:

list[np.ndarray]