Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize MatrixGate to channels #3349

Closed
dkafri opened this issue Sep 21, 2020 · 10 comments
Closed

Generalize MatrixGate to channels #3349

dkafri opened this issue Sep 21, 2020 · 10 comments
Assignees
Labels
area/channels area/noise-models area/simulation kind/feature-request Describes new functionality triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on

Comments

@dkafri
Copy link
Collaborator

dkafri commented Sep 21, 2020

Is your feature request related to a use case or problem? Please describe.
I want to be able to algorithmically define arbitrary channel operations (e.g. with Kraus operators) without having to define my own custom Gate or Operation class.

Describe the solution you'd like
Basically something equivalent to MatrixGate, but which takes a tuple of Kraus operators instead of a single unitary.

[optional] Describe alternatives/workarounds you've considered
Creating a custom subclass that does the same thing (what I'm doing now).
Generalizing MatrixGate to allow for Kraus operators

[optional] Additional context (e.g. screenshots)
This is useful in the context of noise modeling when you have qubit-specific noise models corresponding to different numerical parameters.

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

@dkafri dkafri added the kind/feature-request Describes new functionality label Sep 21, 2020
@balopat balopat added area/channels area/noise-models area/simulation triage/discuss Needs decision / discussion, bring these up during Cirq Cynque labels Sep 21, 2020
@balopat balopat added triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on and removed triage/discuss Needs decision / discussion, bring these up during Cirq Cynque labels Oct 14, 2020
@balopat
Copy link
Contributor

balopat commented Oct 14, 2020

Discussed on Cirq Cynq: this sounds reasonable, and we could also even add this functionality for mixtures too.

@artvandalay404
Copy link

I can tackle this if it is needed. Thanks!

@balopat
Copy link
Contributor

balopat commented Oct 23, 2020

Thank you for volunteering - go for it @satw1knandala!

@artvandalay404
Copy link

artvandalay404 commented Oct 30, 2020

Question about this @balopat @dkafri - can this be achieved by creating a class that just creates several matrix gates by looping through the tuple of kraus operators? something like a wrapper that manages all the different matrix gates at once? let me know if there might be a more cirq style architecture for this. thanks!

@dkafri
Copy link
Collaborator Author

dkafri commented Oct 30, 2020

I am not a Cirq expert, but I think the simplest thing would be to subclass cirq.Gate. The custom class can be initialized with the Kraus operator matrices, which can then be returned for the call to _channel_(). Additionally, for the implementation of on you will want to check that the matrix dimensions match the qubit dimensions.

@dabacon
Copy link
Collaborator

dabacon commented Nov 23, 2020

@satw1knandala I think you don't want to mix matrix gates and these channel matrix gates. The reason is that matrix gates should be unitary gates, and there is a sort of expectation that it describes such an object. The matrices in the Krauss operators are not necessarily (usually) unitary, so this would likely lead to confusion. I think just passing a tuple of the matrices makes sense here and not delegation.

@verult
Copy link
Collaborator

verult commented Mar 28, 2022

cc @MichaelBroughton @tanujkhattar

@dstrain115
Copy link
Collaborator

Why does this need to be done before Cirq 1.0? It looks like it is new functionality that is low priority. I don't see any backwards breaking functionality here unless I am missing something. @MichaelBroughton

@verult
Copy link
Collaborator

verult commented Apr 7, 2022

Ack, I wasn't sure whether it's confirmed that it will be separate from MatrixGate at first, but reading the issue again it does seem like the recommendation leans towards implementing it separately. Moving to after 1.0 but @MichaelBroughton lmk if you think otherwise.

@dabacon
Copy link
Collaborator

dabacon commented Jun 6, 2022

This exists and is called KraussChannel. Introduced in #4194

@dabacon dabacon closed this as completed Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/channels area/noise-models area/simulation kind/feature-request Describes new functionality triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on
Projects
None yet
Development

No branches or pull requests

6 participants