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.

error_profile_to_fidelities(backend)

Convert IQMFakeBackend error profile to fidelity metrics.

extract_fidelities_unified(backend)

Returns couplings and CZ-fidelities from calibration data URL for external station API.

generate_state_tomography_circuits(qc, ...)

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

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_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_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.

process_backend(backend)

Process the backend input to ensure it is an IQMBackendBase instance and extract the station name.

random_hamiltonian_path(graph, n_vertices)

Generates a random Hamiltonian path with n_vertices from a given NetworkX graph.

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 metadata from a list of Job 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_into_disjoint_pairs(pairs)

Split a Sequence of pairs of integers into a List of a minimal number of Lists of disjoint pairs.

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)

Decorator for calculating the amount of time a function takes to execute.

xrvariable_to_counts(dataset, identifier, ...)

Retrieve counts from xarray dataset.

Classes

ObservationType(value)

Enumeration representing relevant keys to fetch for each operation in the observations.

PhysicalLayout(value)

Physical layout type.

RoutingMethod(value)

Qiskit routing method options to use in transpilation.

Inheritance

Inheritance diagram of iqm.benchmarks.utils