This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Description
To provide support on hardware for the common operation of "measure a list of qubits and produce a list of Results" that can be supported without need for full array runtime support, we need to define a new version of Microsoft.Quantum.Measurement.MultiM that is compatible with compilation for hardware targets. By introducing a new operation, Microsoft.Quantum.Measurement.MeasureEachZ, we can achieve two goals: have a runtime-defined measurement utility that QIR generation can replace with specific patterns supported on hardware, and define an operation with updating naming that follows the style guide that can eventually be used as a replacement when deprecating the libraries-defined MultiM operation. The signature of MeasureEachZ should be the same as MultiM, namely:
operation MeasureEachZ(targets : Qubit[]) : Result[] { ... }
For the hardware compatibility, this function should be loop based and build up the Result array using copy update, instead of using ForEach, so that it can be compiled into hardware-supported QIR patterns.