iqm.benchmarks.entanglement.graph_states.update_pauli_expectations

iqm.benchmarks.entanglement.graph_states.update_pauli_expectations#

iqm.benchmarks.entanglement.graph_states.update_pauli_expectations(pauli_expectations: Dict[str, Dict[str, float]], projected_counts: Dict[str, Dict[str, int]], nonId_pauli_label: str) Dict[str, Dict[str, float]]#

Helper function that updates the input Pauli expectations dictionary of dictionaries (projections -> {pauli string: expectation}).

Parameters:
  • pauli_expectations (Dict[str, Dict[str, float]]) – The Pauli expectations dictionary of dictionaries to update. * Outermost keys are projected bitstrings; innermost are pauli strings and values are expectation values.

  • projected_counts (Dict[str, Dict[str, int]]) – The corresponding projected counts dictionary of dictionaries.

  • nonId_pauli_label (str) – The Pauli label to update expectations of, that should not contain identities. * Pauli expectations corresponding to I are inferred and updated from counts corresponding to strings containing Z instead.

Returns:

The updated Pauli expectations dictionary of dictionaries (projections -> {pauli string: expectation}).

Return type:

Dict[str, Dict[str, float]]