iqm.benchmarks.utils

iqm.benchmarks.utils#

General utility functions

Functions

bootstrap_counts(original_counts[, ...])

Returns num_bootstrap_samples resampled copies of the original_counts.

count_2q_layers(circuit_list)

Calculate the number of layers of parallel 2-qubit gates in a list of circuits.

count_native_gates(backend_arg, ...)

Count the number of IQM native gates of each quantum circuit in a list.

extract_fidelities(cal_url)

Returns couplings and CZ-fidelities from calibration data URL

generate_state_tomography_circuits(qc, ...)

Generate all quantum circuits required for a quantum state tomography experiment.

get_Pauli_expectation(counts, pauli_label)

Gets an estimate of a Pauli expectation value for a given set of counts and a Pauli measurement label.

get_active_qubits(qc)

Extract active qubits from a quantum circuit.

get_iqm_backend(backend_label)

Get the IQM backend object from a backend name (str).

get_measurement_mapping(circuit)

Extracts the final measurement mapping (qubits to bits) of a quantum circuit.

get_neighbors_of_edges(edges, graph)

Given a Sequence of edges and a graph, return all neighboring nodes of the edges.

get_tomography_matrix(pauli_expectations)

Reconstructs a density matrix from given Pauli expectations.

marginal_distribution(prob_dist_or_counts, ...)

Compute the marginal distribution over specified bits (indices).

median_with_uncertainty(observations)

Computes the median of a Sequence of float observations and returns value and propagated uncertainty.

perform_backend_transpilation(qc_list, ...)

Transpile a list of circuits to backend specifications.

reduce_to_active_qubits(circuit[, ...])

Reduces a quantum circuit to only its active qubits.

remove_directed_duplicates_to_list(cp_map)

Remove duplicate edges from a coupling map and returns as a list of edges (as a list of pairs of vertices).

retrieve_all_counts(iqm_jobs[, identifier])

Retrieve the counts from a list of IQMJob objects.

retrieve_all_job_metadata(iqm_jobs)

Retrieve the counts from a list of IQMJob objects.

set_coupling_map(qubits, backend[, ...])

Set a coupling map according to the specified physical layout.

sort_batches_by_final_layout(...)

Sort batches of circuits according to the final measurement mapping in their corresponding backend.

split_sequence_in_chunks(sequence_in, split_size)

Split a given Sequence into chunks of a given split size, return as a List of Sequences.

submit_execute(sorted_transpiled_qc_list, ...)

Submit function to execute lists of quantum circuits on the specified backend,

timeit(f)

Calculates the amount of time a function takes to execute

xrvariable_to_counts(dataset, identifier, ...)

Retrieve counts from xarray dataset.