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

Kraus protocol restructured and serial concatenation implemented #4823

Closed
wants to merge 48 commits into from

Conversation

Zshan0
Copy link
Contributor

@Zshan0 Zshan0 commented Jan 11, 2022

As mentioned #4822, the kraus protocol has been re-structured. The original task (#4486) has been split into two tasks to handle serial concatenation for kraus and mixture protocol.

The serial concatenation is handled by converting the decomposed operations into their superoperator form with the help of cirq.Moment().expand().kraus (#4550).

Zshan0 and others added 30 commits September 5, 2021 13:30
Added serial concatanation and wrote a test for the same

Fixed small error

Fixed small error
Also added consistency checks for kraus with unitary and mixture
Need to add serial concatenation to mixture
Kraus needs additional tests
Mixture serial concatenation pending
Need to fix tests and check
Also Added check for combinatorial explosion as requested.
@Zshan0 Zshan0 requested review from cduck, vtomole and a team as code owners January 11, 2022 18:18
@Zshan0 Zshan0 requested a review from maffoo January 11, 2022 18:18
@CirqBot CirqBot added the size: L 250< lines changed <1000 label Jan 11, 2022
@Zshan0
Copy link
Contributor Author

Zshan0 commented Jan 12, 2022

With the newly proposed structure of kraus and has_kraus, some issues are required to be handled.

  • Re-structuring of has_kraus results in the protocol taking alternative methods rather than returning the first answer. Pairing this fact with allow_decompose = True, it returns True for moments with a large number of qubits.
  • kraus uses superoperator intermediate, which means that a large number of qubits could lead to MemoryError due to the exponential size of superoperators.
  • Handling a large number of qubits in _has_kraus_ is overwritten in this new flow.
  • Example test case that fails due to above reason:
    cirq-core/cirq/ops/moment_test.py::test_kraus_too_big

Possible approaches

  • Explicit check on the size of the resulting superoperator in has_kraus and kraus. The example that causes MemoryError has 9 qubits.
  • Check for the number of qubits in the simulation each kraus calls.
  • Changing the flow or setting allow_decompose to be False would fix this issue but would make recursive decomposition less obvious

@vtomole
Copy link
Collaborator

vtomole commented Jan 12, 2022

Discussion from Cirq sync:

  • We should not use superoperator representations for unitaries
  • We should remove the check that the limit is on 10 qubits because it miscommunicates that this is something we check for when in reality, we can't assume how much memory a user's machine has.

@tanujkhattar tanujkhattar self-assigned this Jan 12, 2022
@Zshan0
Copy link
Contributor Author

Zshan0 commented Jan 23, 2022

To complete the restructuring, #4876 must be merged.

@Zshan0 Zshan0 marked this pull request as draft January 23, 2022 17:26
@github-actions github-actions bot added the Stale label Feb 15, 2024
@github-actions github-actions bot closed this Mar 17, 2024
@mhucka mhucka added the status/stale This has been closed due to inactivity for an extended period of time. label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: L 250< lines changed <1000 status/stale This has been closed due to inactivity for an extended period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants