generate_summation_terms(subcircuits, complete_path_map, num_cuts)[source]

Generate all summation terms for the final reconstructions.

Final CutQC reconstruction result = Sum(summation_terms).

summation_terms (list): [summation_term_0, summation_term_1, …] –> 4^#cuts elements.

summation_term[subcircuit_idx] = subcircuit_entry_idx.
E.g. summation_term = {0:0,1:13,2:7} = Kron(subcircuit_0_entry_0, subcircuit_1_entry_13, subcircuit_2_entry_7).
subcircuit_entries[subcircuit_idx][init_label,meas_label] = subcircuit_entry_idx, kronecker_term.
kronecker_term (list): (coefficient, subcircuit_instance_idx).
Add coefficient*subcircuit_instance to subcircuit_entry.

subcircuit_instances[subcircuit_idx][init,meas] = subcircuit_instance_idx.

  • subcircuits (-) – the list of subcircuits

  • complete_path_map (-) – the paths of all the qubits through the circuit DAGs

  • num_cuts (-) – the number of cuts

Return type:

Tuple[List[Dict[int, int]], Dict[int, Dict[Tuple[str, str], Tuple[int, Sequence[Tuple[int, int]]]]], Dict[int, Dict[Tuple[Tuple[str, ...], Tuple[Any, ...]], int]]]


a tuple containing:

  • (dict): dictionary containing information on the summation terms

  • (dict): dictionary containing the subcircuits entry information

  • (dict): dictionary containing subcircuit instances