JakuJ / quantum-explorer

Bachelor's project: Compiler Explorer for Q#
https://qexplorer.herokuapp.com
GNU General Public License v3.0
3 stars 0 forks source link

Gate substitution #80

Closed JakuJ closed 3 years ago

JakuJ commented 3 years ago

Summary

This PR introduces an ability to toggle whether the composer should show user-defined operations as gates, or rather show the intrinsics they call underneath. I used Bootstrap Toggle for this. I've also added custom gates for measurement operations that also reset the state.

Closes #75

Examples

With toggle off:

Zrzut ekranu 2021-01-6 o 18 23 31

With toggle on:

Zrzut ekranu 2021-01-6 o 18 23 12

New "Reset" gate:

Zrzut ekranu 2021-01-6 o 18 27 51
codecov[bot] commented 3 years ago

Codecov Report

Merging #80 (0328a88) into develop (26a724e) will increase coverage by 0.58%. The diff coverage is 95.37%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #80      +/-   ##
===========================================
+ Coverage    91.35%   91.93%   +0.58%     
===========================================
  Files           39       39              
  Lines          983     1042      +59     
===========================================
+ Hits           898      958      +60     
+ Misses          85       84       -1     
Flag Coverage Δ
unittests 91.93% <95.37%> (+0.58%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
Compiler/QsCompiler.cs 88.37% <ø> (ø)
Explorer/Components/Composer/Drawing/Line.razor 75.00% <ø> (ø)
Explorer/Components/Composer/Grid.razor 74.62% <ø> (+1.09%) :arrow_up:
Explorer/Components/Visualizer.razor 94.93% <ø> (ø)
Explorer/Pages/_Host.cshtml 0.00% <ø> (ø)
Common/QuantumGate.cs 54.54% <50.00%> (+4.54%) :arrow_up:
Explorer/Components/Composer/Gate.razor 53.33% <50.00%> (-3.81%) :arrow_down:
Explorer/Components/Composer/Composer.razor 78.26% <66.66%> (+2.17%) :arrow_up:
Common/ScopedTimer.cs 100.00% <100.00%> (ø)
Compiler.AzureFunction/AzureFunctionCompiler.cs 100.00% <100.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 26a724e...0328a88. Read the comment docs.