quri_parts.core.measurement package#

PauliMeasurementCircuitGeneration#

PauliMeasurementCircuitGeneration represents a function that generates a circuit (a gate list) for measuring mutually commuting Pauli operators.

alias of Callable[[Set[PauliLabel]], Sequence[QuantumGate]]

PauliReconstructor#

PauliReconstructor represents a function that reconstructs a value of a Pauli operator from a measurement result of its measurement circuit.

alias of Callable[[int], int]

PauliReconstructorFactory#

PauliReconstructorFactory represents a factory function that returns a PauliReconstructor for a given Pauli operator.

alias of Callable[[PauliLabel], Callable[[int], int]]

class CommutablePauliSetMeasurement(*args, **kwargs)#

Bases: Protocol

Represents a measurement scheme for a set of commutable Pauli operators.

abstract property pauli_set: core.operator.pauli.CommutablePauliSet#

A set of commutable Pauli operators subject to the measurement.

abstract property measurement_circuit: Sequence[QuantumGate]#

A circuit required to measure the given commutable Pauli operators at once.

abstract property pauli_reconstructor_factory: core.measurement.interface.PauliReconstructorFactory#

A factory of PauliReconstructor that reconstructs a value of a Pauli operator from a measurement result of the measurement circuit.

class CommutablePauliSetMeasurementTuple(pauli_set, measurement_circuit, pauli_reconstructor_factory)#

Bases: NamedTuple

Parameters:
  • pauli_set (core.operator.pauli.CommutablePauliSet) –

  • measurement_circuit (Sequence[QuantumGate]) –

  • pauli_reconstructor_factory (core.measurement.interface.PauliReconstructorFactory) –

pauli_set: CommutablePauliSet#

Alias for field number 0

measurement_circuit: Sequence[QuantumGate]#

Alias for field number 1

pauli_reconstructor_factory: PauliReconstructorFactory#

Alias for field number 2

CommutablePauliSetMeasurementFactory#

Represents a function that performs grouping of Pauli operators into groups of commutable Pauli operators and returns measurement schemes for them.

alias of Callable[[Union[Operator, Iterable[PauliLabel]]], Iterable[CommutablePauliSetMeasurement]]

bitwise_commuting_pauli_measurement_circuit(pauli_set)#

An implementation of PauliMeasurementCircuitGeneration, which generates a circuit (a gate list) for a “trivial” measurement of bitwise- commuting Pauli strings.

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.

Parameters:

pauli_set (core.operator.pauli.CommutablePauliSet) –

Return type:

Sequence[QuantumGate]

bitwise_pauli_reconstructor_factory(pauli)#

A factory of a function that reconstructs a value of the given Pauli operator from a result of a “trivial” measurement of bitwise-commuting Pauli strings.

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.

Parameters:

pauli (PauliLabel) –

Return type:

core.measurement.interface.PauliReconstructor

bitwise_commuting_pauli_measurement(paulis)#

Groups the given Pauli operators into sets of bitwise commuting Pauli operators and returns measurement schemes for them.

Parameters:

paulis (Operator | Iterable[PauliLabel]) –

Return type:

Collection[CommutablePauliSetMeasurement]

individual_pauli_measurement(paulis)#

Returns measurement schemes for Pauli operators where each operator is measured individually (i.e. no grouping).

Parameters:

paulis (Operator | Iterable[PauliLabel]) –

Return type:

Collection[CommutablePauliSetMeasurement]

Submodules#