exa.core.util.topology.is_valid_homomorphism

exa.core.util.topology.is_valid_homomorphism#

is_valid_homomorphism(rev_mapping, layout_graph, chip_graph)#

Check if the mapping corresponds to a valid injective homomorphism between two graphs.

Parameters:
  • rev_mapping (dict[str, str]) – Mapping of logical qubit labels to physical qubits

  • layout_graph (Graph) – Logical qubit graph representing the experiment.

  • chip_graph (Graph) – Graph representing the chip topology.

Returns:

True if the mapping given is an injective homomorphism from the logical qubit graph to the chip graph.

Return type:

bool