Skip to content
DocumentationExperimentsTeam

Converters Reference

module converters


function tn_from_uai_file

def tn_from_uai_file(file_path: str)tuple[str, list]

Parses a UAI file and returns the einsum format string and tensors representing the graphical model.

Args:

  • file_path (str): The path to the UAI file.

Returns:

  • tuple[str, list]: A tuple containing the format string and a list of tensors.

function tn_from_dimacs_file

def tn_from_dimacs_file(file_path: str, clause_split_threshold=3)tuple[str, list]

Converts a DIMACS (weighted) model counting file to a tensor network.

Args:

  • file_path (str): The path to the DIMACS file.
  • clause_split_threshold (int, optional): The threshold for splitting clauses. Defaults to 3.

Returns:

  • tuple[str, list]: A tuple containing the equation and the list of tensors.