quri_parts.core.estimator.sampling.pauli module#

quri_parts.core.estimator.sampling.pauli.general_pauli_expectation_estimator(counts: Mapping[int, int | float], pauli: PauliLabel, reconstructor_factory: Callable[[PauliLabel], Callable[[int], int]]) float#

An implementation of PauliExpectationEstimator for a given PauliReconstructorFactory.

quri_parts.core.estimator.sampling.pauli.general_pauli_sum_expectation_estimator(counts: Mapping[int, int | float], pauli_set: Set[PauliLabel], coefs: Mapping[PauliLabel, complex], reconstructor_factory: Callable[[PauliLabel], Callable[[int], int]]) complex#

Estimate expectation value of a weighted sum of commutable Pauli operators from measurement counts and Pauli reconstructor.

Note that this function calculates the sum for only Pauli operators contained in both of pauli_set and coefs.

quri_parts.core.estimator.sampling.pauli.general_pauli_covariance_estimator(counts: Mapping[int, int | float], pauli1: PauliLabel, pauli2: PauliLabel, reconstructor_factory: Callable[[PauliLabel], Callable[[int], int]]) float#

An implementation of PauliCovarianceEstimator for a given PauliReconstructorFactory.

quri_parts.core.estimator.sampling.pauli.general_pauli_sum_sample_variance(counts: Mapping[int, int | float], pauli_set: Set[PauliLabel], coefs: Mapping[PauliLabel, complex], reconstructor_factory: Callable[[PauliLabel], Callable[[int], int]]) float#

Calculate sample variance of a weighted sum of commutable Pauli operators from measurement counts and Pauli reconstructor.

Note that this function calculates the variance of sum for only Pauli operators contained in both of pauli_set and coefs.

quri_parts.core.estimator.sampling.pauli.trivial_pauli_expectation_estimator(counts: Mapping[int, int | float], pauli: PauliLabel) float#

An implementation of PauliExpectationEstimator, which assumes a “trivial” measurement of the Pauli string.

The “trivial” measurement of a Pauli string refers to a measurement in computational basis preceded by single qubit rotations to map each Pauli matrix on each qubit to \(Z\). For example, if the Pauli string contains \(X\) (\(Y\)) at a qubit index \(i\), then (an \(S^\dagger\) gate and) an Hadamard gate is applied on the qubit \(i\) before performing the \(Z\) measurements on all qubits.

quri_parts.core.estimator.sampling.pauli.trivial_pauli_covariance_estimator(counts: Mapping[int, int | float], pauli1: PauliLabel, pauli2: PauliLabel) float#

An implementation of PauliCovarianceEstimator, which assumes a “trivial” measurement of the Pauli string.

The “trivial” measurement of a Pauli string refers to a measurement in computational basis preceded by single qubit rotations to map each Pauli matrix on each qubit to \(Z\). For example, if the Pauli string contains \(X\) (\(Y\)) at a qubit index \(i\), then (an \(S^\dagger\) gate and) an Hadamard gate is applied on the qubit \(i\) before performing the \(Z\) measurements on all qubits.