Cirq icon indicating copy to clipboard operation
Cirq copied to clipboard

Derive _kraus_ from _apply_channel_

Open daxfohl opened this issue 3 years ago • 2 comments

Is your feature request related to a use case or problem? Please describe.

Follow up from https://github.com/quantumlib/Cirq/pull/5917#discussion_r995097628

Describe the solution you'd like

Similarly to how unitary_protocol has _strat_unitary_from_apply_unitary, we should have kraus_protocol be able to infer the Kraus values from the _apply_channel_ implementation as a fallback option.

The implementation would call apply_channel on an identity tensor, which will give the superoperator representation of that channel. Then qis.superoperator_to_kraus can be used to get the Kraus values. See assert_has_consistent_apply_channel in the linked PR above as a reference.

Calculating a superoperator is expensive (16^N), so this should likely be the last strategy to try when all else fails.

(good first issue, good for learning) I'll leave this open a while for someone that wants to contribute.

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

daxfohl avatar Oct 13 '22 21:10 daxfohl

Cirq cync decision: This seems like a good idea to add this, but is low priority based on the fact there's probably not that many channels it currently applies to. We could also use this opportunity to generally improve the kraus protocol.

dstrain115 avatar Apr 26 '23 17:04 dstrain115

i can take a look into this.

iamsusiep avatar Jun 22 '25 16:06 iamsusiep