QuantumSavory / QuantumSavory.jl

A full stack simulator of quantum hardware, from the low-level analog physics to high-level network dynamics. Includes discrete event simulator, symbolic representation for quantum object, and works with many backend simulators.
https://quantumsavory.github.io/QuantumSavory.jl/
MIT License
30 stars 11 forks source link

Implementing Cutoff protocol, related synchronization communication tags, and general Improvements to protocol stability #120

Closed ba2tro closed 1 day ago

ba2tro commented 3 months ago

Based on #114 and continued from #107

Besides the documentation work from #107 , the following changes are introduced to add decoherence to the protocols

This deals with the deadlocks and the plots from the grid example look pretty cool:

https://github.com/QuantumSavory/QuantumSavory.jl/assets/46929125/3fdd66a8-667f-488b-9781-cb6f5b416d2b

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 80.39216% with 20 lines in your changes missing coverage. Please review.

Project coverage is 72.92%. Comparing base (6e99352) to head (a56e783). Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
ext/QuantumSavoryMakie/QuantumSavoryMakie.jl 0.00% 4 Missing :warning:
src/ProtocolZoo/ProtocolZoo.jl 86.66% 4 Missing :warning:
src/ProtocolZoo/cutoff.jl 77.77% 4 Missing :warning:
src/ProtocolZoo/swapping.jl 90.24% 4 Missing :warning:
src/queries.jl 55.55% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #120 +/- ## ========================================== - Coverage 72.94% 72.92% -0.03% ========================================== Files 39 41 +2 Lines 1693 1732 +39 ========================================== + Hits 1235 1263 +28 - Misses 458 469 +11 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ba2tro commented 3 months ago

Now we have a DecoherenceProtocol at each node that throws away qubits past their retention while tagging the slot with a new EntanglementDelete tag. The EntanglementDelete tag is also sent as a message to the node which was entangled with the deleted qubit. This logic to handle the different cases arising from this message is added to the code in EntanglementTracker

Krastanov commented 3 months ago

The two example files have a lot in common. Could you make a setup.jl file that contains everything that is common so it is easier to see the difference?

Krastanov commented 3 months ago

There is a conflict with queries.jl now. I think the only change you had actually made to that file is to add iscoherent. It probably will be easiest to just checkout the master version of the file and manually add iscoherent instead of going through each merge difference (I think that had already led to some weirdness in the previous merge conflict resolution).

Krastanov commented 3 months ago

I set up a CHANGELOG file, so that it is easier to keep track of updates and breaks. We can follow the same style as in QuantumClifford.jl

Krastanov commented 2 months ago

Is this ready for review? There seems to be a couple of unaddressed comments still. I will convert it to a draft to make it easier for me to track what I am supposed to review.

Krastanov commented 2 months ago

Is there a separate commit for the renaming of the swapper protocol and for the changes in the swapper protocol? It is very difficult to figure out what is happening because the renaming and the changes are rendered together. Could you talk through what the changes to that protocol are (besides renaming)? Are any of the changes breaking (which would require double checking manually that the examples still work)?

Krastanov commented 2 months ago

findswappablequbits has a bunch of new arguments that are not documented and I am not sure what they mean

Krastanov commented 2 months ago

This is great and the visualizations look awesome! I made some small refactoring changes (and one big one, after noticing how close the two Swapper protocols are). I added a bunch of TODOs that I will turn into issues.

Please check the commits I pushed (I tried to have them separate by topic so they are easy to follow) and let me know if something is amiss.

An appropriate priority at this point would be to create a comparison study of these two protocols (not just two separate demos, but a scientific study that spans various parameters)

Krastanov commented 2 months ago

Looking at the buildkite failure, this seems to still suffer from the race condition in the swapper/tracker. Could you fix that here as well today (Wed), so that we can merge it?

Krastanov commented 1 month ago

The documentation seems to be failing to build still.

Krastanov commented 1 month ago

request a review when these are fixed -- I should be able to see it on my queue

Krastanov commented 4 weeks ago

@Abhishek-1Bhatt , just a bump on the documentation issues

ba2tro commented 4 weeks ago

https://github.com/QuantumSavory/QuantumSavory.jl/actions/runs/10334602640/job/28608236059?pr=120#step:6:1186 Looks like this is creating a persistent task during the precompilation causing the gh action CIs to fail the aqua tests.

I get another similar warning locally:

WARNING: Method definition traceout!(QuantumOpticsBase.Operator{BL, BR, T} where T where BR where BL, Any) in module QuantumOpticsBase at /home/ba2tripleO/.julia/packages/QuantumOpticsBase/QN1iB/src/operators_dense.jl:31 overwritten in module QuantumSavory at /home/ba2tripleO/.julia/dev/QuantumSavory/src/backends/quantumoptics/quantumoptics.jl:21.
ERROR: Method overwriting is not permitted during Module precompilation. Use `__precompile__(false)` to opt-out of precompilation.
ba2tro commented 4 weeks ago

I see there's work going on in qobase, the docs are building now(other than the random xvfb errors that happen now and then).There was an @ref that doesn't have a doctrine in qsymbolics

Krastanov commented 4 weeks ago

you are getting these warnings because https://github.com/QuantumSavory/QuantumSavory.jl/pull/143 is in progress. Do not worry about them.

ba2tro commented 2 weeks ago

@Krastanov this is ready to be merged

Krastanov commented 1 day ago

Woohoo! Thanks for taking care of this and shepherding it through the review process. I made a few changes, some related to minor stylistic documentation personal preferences, some related to the stability of the tests that were failing. Please check them out to make sure I did not miss anything.

I made a related issue #147 for a few minor things that would be nice to fix, but were not blocking.

ba2tro commented 1 day ago

Thanks a lot for pushing it through!