qat.utils.hardware_model module

apply_setup_to_echo_hardware(qubit_count, connectivity, qubit_indices=None)
Return type:

QuantumHardwareModel

check_type_legacy_or_pydantic(hw_model)
ensure_connected_connectivity(connectivity, qubit_indices)

Ensures that all qubit_indices are connected together.

Looks at only the selected qubit indices and ensures that they are all part of a single connected graph. This does not mean an all-to-all connection. E.g. While the connectivity dict below has all qubits linked, in the subset of indices {1, 2, 3} qubit 0 is not linked with the other two.

connectivity = {
    0: {1, 2},
    1: {0},
    2: {0, 3},
    3: {2},
}
qubit_indices = {1, 2, 3}
new_connectivity = ensure_connected_connectivity(connectivity, qubit_indices)
# new_connectivity == {
#     0: {1, 2},
#     1: {0, 2},
#     2: {0, 1, 3},
#     3: {2}
# }
Parameters:
  • connectivity (dict) – Base connectivity dictionary.

  • qubit_indices (list | set) – Selected qubits to ensure are a connected graph.

Return type:

dict

generate_connectivity_data(n_qubits, n_logical_qubits, seed=42)
generate_hw_model(n_qubits, seed=42)
generate_random_linear(qubit_indices)
hash_calibration_file(file_path, algorithm='md5', chunk_size=8192)

Compute the hash of a calibration file.

Return type:

str

pick_subconnectivity(connectivity, n, seed=42)
random_connectivity(n, max_degree=3, seed=42)

Generates a random undirected graph but enforcing that the resulting graph is connected.

random_directed_connectivity(n, max_degree=3, seed=42)

Generates a random directed graph but enforcing that the resulting graph is connected.

random_error_mitigation(physicaal_indices, seed=None)
Return type:

ErrorMitigation

random_quality_map(connectivity, seed=42, min_quality=0.0, max_quality=1.0)