quantumlib / Cirq

A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Apache License 2.0
4.23k stars 1.01k forks source link

General measurements #3241

Open balopat opened 4 years ago

balopat commented 4 years ago

Problem: From the simulation point of view general Kraus operators can correspond to measurement results, and currently this is only partially supported. Finally measurements often require some post processing, for example by including invert masks in measurements one can often produce smaller circuits. This latter problem either needs to be serializable, or restricted to use on client side (Cirq) code. A further generalization that is necessary is to be able to change the dimension of a quantum system. This needs to be compatible with the qubit allocation and deallocation feature.

Depends on: Qubit allocation / deallocation / move

Rough requirements:

95-martin-orion commented 3 years ago

It's now possible to attach measurement keys to arbitrary channels and use them to capture the "selected" operator within that channel. However, channels with more than two operators may misbehave due to the expectation of boolean measurement results; additional work is required to make sure this works as expected.

vcatherine commented 2 years ago

This is a #3240 duplicate. Can we close this @mpharrigan (you were the last to close that one)? We are trying to clean up the issues.

95-martin-orion commented 2 years ago

This is a #3240 duplicate.

Was this meant to point to a different issue? I see qubit (de-)allocation and generalized measurements as two distinct pieces of work. We could still close this issue if we decide that #4194 is sufficient for it, but there remains follow-up work that still needs to be done (qudit and non-square channel support, proper handling for channels with 3+ operators).

mpharrigan commented 2 years ago

This is not a duplicate. As stated, this issue depends on that one; or at least that was the original idea with non-square kraus operators.

MichaelBroughton commented 2 years ago

@95-martin-orion @daxfohl is this closed out now with our latest work on measurement ?

95-martin-orion commented 2 years ago

@95-martin-orion @daxfohl is this closed out now with our latest work on measurement ?

The core of this is complete, but it extends out to broader concepts (qudits / non-square ops) that remain open. I think those can safely be punted to post-1.0.