Is your feature request related to a use case or problem? Please describe.
Elementary objects in cirq (e.g. quantum gates) are represented as classes with overspecified properties. In other words, they directly provide information that can be computed from other information already available. For example, a quantum gate may provide an implementation of _apply_unitary_ as well as _unitary_ and/or _decompose_. At the same time, we ensure consistency of this information using a number of utilities implemented in cirq.testing. This is a nice approach as it shifts the cost of computation from the user to testing.
With the addition of superoperator and Choi representations of channels to cirq, we will soon have redundant specifications of channels. This calls for suitable consistency checks to be implemented in cirq.testing.
Describe the solution you'd like
We should check that for each channel Kraus, Choi and superoperator representations describe the same channel. We should also implement consistency checks between existing channel-related protocols unitary, kraus and mixture. In addition, the new testing utilities could verify other related properties such as:
all unital single-qubit channels have a mixture representation (which would have prevented #4578),
all Kraus representations are minimal (i.e. return the number of Kraus operators equal to the rank of the Choi matrix).
[optional] Describe alternatives/workarounds you've considered
[optional] Additional context (e.g. screenshots)
What is the urgency from your perspective for this issue? Is it blocking important work?
P3 - I'm not really blocked by it, it is an idea I'd like to discuss / suggestion based on principle
Is your feature request related to a use case or problem? Please describe.
Elementary objects in cirq (e.g. quantum gates) are represented as classes with overspecified properties. In other words, they directly provide information that can be computed from other information already available. For example, a quantum gate may provide an implementation of
_apply_unitary_
as well as_unitary_
and/or_decompose_
. At the same time, we ensure consistency of this information using a number of utilities implemented incirq.testing
. This is a nice approach as it shifts the cost of computation from the user to testing.With the addition of superoperator and Choi representations of channels to cirq, we will soon have redundant specifications of channels. This calls for suitable consistency checks to be implemented in
cirq.testing
.Describe the solution you'd like
We should check that for each channel Kraus, Choi and superoperator representations describe the same channel. We should also implement consistency checks between existing channel-related protocols
unitary
,kraus
andmixture
. In addition, the new testing utilities could verify other related properties such as:[optional] Describe alternatives/workarounds you've considered
[optional] Additional context (e.g. screenshots)
What is the urgency from your perspective for this issue? Is it blocking important work?
P3 - I'm not really blocked by it, it is an idea I'd like to discuss / suggestion based on principle