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]], non_identity_pauli_label: str) dict[str, dict[str, float]]#

Helper function that updates the input Pauli expectations dictionary of dictionaries.

Order: projections -> {pauli string: expectation}.

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

  • projected_counts (dict[str, dict[str, int]]) – Corresponding projected counts dictionary of dictionaries.

  • non_identity_pauli_label (str) – 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:

expectation}).

Return type:

Dictionary of dictionaries of updated Pauli expectations (projections -> {pauli string