Skip to content

hal.utils.disk_utils

create_path

create_path(
    directory_path, measurement_name, create_directory=False
)

Create a dated output directory for a measurement.

The directory will be named like YYYYMMDD_HhMmSs_ and will contain layers and grid_view subfolders.

create_tuple

create_tuple(tuple_str)

Convert string representation of a tuple to an actual tuple using ast.literal_eval.

extract_code_parameters

extract_code_parameters(csv_file_path)

Extract code parameters from a CSV file used for website/demo generation.

load_parity_check_matrices

load_parity_check_matrices(root_dir)

Load parity check matrices from subfolders named like 'n_k_d' under root_dir.

Each folder should contain 'hx.csv' and 'hz.csv'. The function loads these CSV files and returns a list of tuples: (n, k, d, hx, hz, parity_matrix).

process_single_code

process_single_code(code_params, x, y)

Construct polynomials for a single code parameter set.

Returns a dict with name, lattice vectors, coefficient tuples, and polynomials poly_a, poly_b.