TeamGraphix / graphix

measurement-based quantum computing (MBQC) compiler and simulator
https://graphix.readthedocs.io
Apache License 2.0
55 stars 20 forks source link

42 fast pattern operation with distributed command sequence #43

Closed masato-fuk closed 1 year ago

masato-fuk commented 1 year ago

Before submitting, please check the following:

Then, please fill in below:

Context (if applicable):

na

Description of the change:

Implemented LocalPattern and CommandNode. With these new classes, standardize and shift_signals have been significantly accelerated. Default backend for pattern operations is changed to LocalPattern class.

Related issue:

42

also see that checks (github actions) pass. If lint check keeps failing, try installing black==22.8.0 as behavior seems to vary across versions.

shinich1 commented 1 year ago

could you add benchmarking results (plots) to this PR, briefly explaining what benchmarking was done?

shinich1 commented 1 year ago

Also - do we know local standardization work with 'opt' transpiration? sorry for adding so many cases but it's worth adding in test (if not working and it's a pain to fix now, we can let it raise warning so that users know it's not desired way to code)

masato-fuk commented 1 year ago

I modified local pattern to support opt-transpilation and added a test for it. Please check bf1fb0d

shinich1 commented 1 year ago

@masato-fuk Do you want me to review now?

masato-fuk commented 1 year ago

I've completed all ToDos in this issue. So, would you review changes when you have a time? Benchmark scores of the new methods will be added in this conversation when I finishied benchmark with opt-transpilation and localpattern. Perhaps tonight.

masato-fuk commented 1 year ago

pattern_operation_benchmark Performance check of new methods(local pattern) compared with conventional methods(global pattern). the opt-transpilation method is still valid with local pattern operations. An additional benchmark of local pattern with much larger patterns will be uploaded soon.

masato-fuk commented 1 year ago

localpattern_std localpattern_signal The first graph is benchmark of local pattern standardization up to 50000 nodes. The second graph is benchmark of local pattern signal shifting up tp the same size. I'm not sure what happens around the several thousands of nodes region.

shinich1 commented 1 year ago

@masato-fuk please squash and merge, with commit message fast standardization method with localized command structure (#43)

shinich1 commented 1 year ago

@masato-fuk added standardize_and_shift_signals method. please check and squash and merge, if it looks ok.