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

Circuit UX improvements, use simulator by default #1361

Merged
merged 12 commits into from
Apr 17, 2024

Conversation

minestarks
Copy link
Member

@minestarks minestarks commented Apr 4, 2024

  • When using the Circuit command, fall back to "trace" mode (i.e. run with simulator) when circuit contains a result comparison, instead of showing an error.
  • Zoom to fit larger circuits.
  • Other minor UX tweaks to make the overall experience smoother. See GIFs below
Simple circuit

circuit-entanglement-unrestricted

Zooming to fit larger circuit

circuit-bell-state-unrestricted-zoom-in-out

Falling back to Trace mode for dynamic circuits

circuit-qrng-unrestricted-trace-zoom-to-fit

Debugging

circuit-bell-state-debugging

Debugging with a large, slow to render circuit

circuit-shor-debugging-rendering

Too large to render

circuit-shor-unrestricted-trace-too-many-gates

Empty circuit

circuit-array-no-gates

Switching between target profiles Base and Unrestricted

circuit-bell-state-unrestricted-base

Base profile compiler error

circuit-bernstein-base-compiler-error

Runtime failure

circuit-runtime-fail

Copy link

github-actions bot commented Apr 4, 2024

Benchmark for 4806041

Click to view benchmark
Test Base PR %
Array append evaluation 337.4±2.64µs 357.0±1.98µs +5.81%
Array literal evaluation 179.5±0.81µs 232.5±1.12µs +29.53%
Array update evaluation 420.8±2.15µs 432.3±4.74µs +2.73%
Core + Standard library compilation 17.8±0.66ms 17.7±0.78ms -0.56%
Deutsch-Jozsa evaluation 5.1±0.15ms 5.1±0.08ms 0.00%
Large file parity evaluation 34.0±0.51ms 33.7±0.58ms -0.88%
Large input file compilation 12.1±0.53ms 12.0±0.25ms -0.83%
Large input file compilation (interpreter) 48.2±1.27ms 48.0±1.42ms -0.41%
Large nested iteration 33.0±0.35ms 34.1±0.32ms +3.33%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1484.7±30.12µs 1489.0±43.16µs +0.29%
Perform Runtime Capabilities Analysis (RCA) on large file sample 7.8±0.16ms 7.7±0.09ms -1.28%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1418.7±60.71µs 1400.6±31.24µs -1.28%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 21.5±0.39ms 21.1±0.32ms -1.86%
Teleport evaluation 83.6±4.12µs 82.1±5.06µs -1.79%

Copy link

github-actions bot commented Apr 5, 2024

Benchmark for a1f1266

Click to view benchmark
Test Base PR %
Array append evaluation 352.0±3.48µs 348.7±2.27µs -0.94%
Array literal evaluation 196.3±2.67µs 203.9±3.12µs +3.87%
Array update evaluation 436.2±3.78µs 433.7±4.32µs -0.57%
Core + Standard library compilation 18.3±0.53ms 18.1±0.30ms -1.09%
Deutsch-Jozsa evaluation 5.0±0.03ms 5.0±0.06ms 0.00%
Large file parity evaluation 33.8±0.49ms 33.6±0.31ms -0.59%
Large input file compilation 12.1±0.48ms 11.9±0.29ms -1.65%
Large input file compilation (interpreter) 48.1±1.09ms 47.9±1.03ms -0.42%
Large nested iteration 34.5±1.04ms 34.3±0.74ms -0.58%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1529.9±179.89µs 1496.6±56.81µs -2.18%
Perform Runtime Capabilities Analysis (RCA) on large file sample 8.1±0.20ms 7.9±0.15ms -2.47%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1415.2±79.61µs 1411.8±79.44µs -0.24%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 21.7±0.17ms 21.8±0.32ms +0.46%
Teleport evaluation 79.8±3.50µs 81.2±5.21µs +1.75%

Copy link

github-actions bot commented Apr 8, 2024

Benchmark for c1e20aa

Click to view benchmark
Test Base PR %
Array append evaluation 352.7±3.55µs 347.8±3.82µs -1.39%
Array literal evaluation 192.8±2.32µs 195.9±2.88µs +1.61%
Array update evaluation 431.1±1.96µs 429.8±5.19µs -0.30%
Core + Standard library compilation 19.2±0.82ms 20.0±1.15ms +4.17%
Deutsch-Jozsa evaluation 5.1±0.05ms 5.0±0.05ms -1.96%
Large file parity evaluation 33.8±0.14ms 34.0±0.92ms +0.59%
Large input file compilation 12.4±0.48ms 13.5±0.66ms +8.87%
Large input file compilation (interpreter) 48.3±1.26ms 49.7±1.27ms +2.90%
Large nested iteration 34.4±0.58ms 34.0±0.78ms -1.16%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1534.2±128.41µs 1532.4±115.08µs -0.12%
Perform Runtime Capabilities Analysis (RCA) on large file sample 8.2±0.16ms 8.3±0.21ms +1.22%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1442.4±89.16µs 1458.5±156.64µs +1.12%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 22.3±0.39ms 22.5±0.27ms +0.90%
Teleport evaluation 80.7±3.76µs 80.6±3.83µs -0.12%

Copy link

github-actions bot commented Apr 8, 2024

Benchmark for fd33d85

Click to view benchmark
Test Base PR %
Array append evaluation 355.3±2.90µs 338.9±3.26µs -4.62%
Array literal evaluation 196.5±4.45µs 182.2±6.01µs -7.28%
Array update evaluation 436.9±2.03µs 440.1±2.59µs +0.73%
Core + Standard library compilation 17.2±0.55ms 20.3±0.90ms +18.02%
Deutsch-Jozsa evaluation 5.1±0.04ms 5.0±0.07ms -1.96%
Large file parity evaluation 33.9±1.30ms 33.6±0.08ms -0.88%
Large input file compilation 11.5±0.25ms 12.6±0.64ms +9.57%
Large input file compilation (interpreter) 46.0±1.53ms 48.2±1.26ms +4.78%
Large nested iteration 34.6±0.28ms 35.0±0.42ms +1.16%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1493.2±43.81µs 1529.5±128.64µs +2.43%
Perform Runtime Capabilities Analysis (RCA) on large file sample 7.8±0.30ms 8.0±0.15ms +2.56%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1404.9±40.89µs 1424.9±89.51µs +1.42%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 21.4±0.26ms 22.3±0.29ms +4.21%
Teleport evaluation 81.9±3.60µs 80.9±3.90µs -1.22%

@minestarks minestarks marked this pull request as ready for review April 8, 2024 17:42
vscode/src/circuit.ts Outdated Show resolved Hide resolved
vscode/src/circuit.ts Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Apr 9, 2024

Benchmark for 4e84217

Click to view benchmark
Test Base PR %
Array append evaluation 333.2±1.95µs 342.9±2.08µs +2.91%
Array literal evaluation 183.1±4.44µs 192.2±0.68µs +4.97%
Array update evaluation 419.1±2.34µs 428.4±2.04µs +2.22%
Core + Standard library compilation 19.7±0.93ms 18.3±0.89ms -7.11%
Deutsch-Jozsa evaluation 5.0±0.05ms 5.0±0.05ms 0.00%
Large file parity evaluation 33.7±0.13ms 33.6±0.31ms -0.30%
Large input file compilation 13.9±0.70ms 12.0±0.51ms -13.67%
Large input file compilation (interpreter) 50.1±1.17ms 49.3±1.57ms -1.60%
Large nested iteration 32.7±0.35ms 33.7±0.32ms +3.06%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1520.4±74.23µs 1523.0±99.96µs +0.17%
Perform Runtime Capabilities Analysis (RCA) on large file sample 8.1±0.18ms 8.0±0.21ms -1.23%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1469.2±166.34µs 1426.0±56.47µs -2.94%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 22.6±0.30ms 21.9±0.44ms -3.10%
Teleport evaluation 80.1±3.66µs 80.4±3.89µs +0.37%

@minestarks minestarks requested a review from idavis April 12, 2024 21:18
wasm/src/lib.rs Outdated Show resolved Hide resolved
npm/qsharp/ux/data.ts Outdated Show resolved Hide resolved
Copy link

Benchmark for 559edf7

Click to view benchmark
Test Base PR %
Array append evaluation 346.8±10.37µs 333.3±2.40µs -3.89%
Array literal evaluation 189.3±0.55µs 170.8±1.92µs -9.77%
Array update evaluation 427.7±10.63µs 413.2±1.83µs -3.39%
Core + Standard library compilation 19.1±0.73ms 19.6±1.01ms +2.62%
Deutsch-Jozsa evaluation 5.1±0.04ms 5.0±0.05ms -1.96%
Large file parity evaluation 33.9±0.11ms 33.5±0.61ms -1.18%
Large input file compilation 12.6±0.51ms 12.7±0.55ms +0.79%
Large input file compilation (interpreter) 49.1±1.13ms 49.7±1.13ms +1.22%
Large nested iteration 33.9±0.37ms 32.7±0.23ms -3.54%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1526.2±115.54µs 1517.8±72.09µs -0.55%
Perform Runtime Capabilities Analysis (RCA) on large file sample 8.1±0.15ms 8.0±0.15ms -1.23%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1431.8±93.64µs 1428.9±78.67µs -0.20%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 21.8±0.29ms 21.9±0.37ms +0.46%
Teleport evaluation 80.9±3.60µs 80.1±4.46µs -0.99%

npm/qsharp/ux/circuit.tsx Outdated Show resolved Hide resolved
npm/qsharp/ux/circuit.tsx Outdated Show resolved Hide resolved
npm/qsharp/ux/circuit.tsx Outdated Show resolved Hide resolved
npm/qsharp/ux/circuit.tsx Outdated Show resolved Hide resolved
vscode/src/circuit.ts Outdated Show resolved Hide resolved
Copy link

Benchmark for eba8b27

Click to view benchmark
Test Base PR %
Array append evaluation 331.6±6.27µs 356.6±6.68µs +7.54%
Array literal evaluation 170.6±1.24µs 189.6±1.49µs +11.14%
Array update evaluation 411.7±4.11µs 435.7±2.63µs +5.83%
Core + Standard library compilation 18.0±0.93ms 18.0±0.73ms 0.00%
Deutsch-Jozsa evaluation 5.1±0.06ms 5.1±0.05ms 0.00%
Large file parity evaluation 33.9±1.50ms 33.8±1.40ms -0.29%
Large input file compilation 11.3±0.19ms 11.8±0.35ms +4.42%
Large input file compilation (interpreter) 44.1±1.84ms 47.4±2.27ms +7.48%
Large nested iteration 32.7±0.23ms 35.5±1.71ms +8.56%
Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample 1496.2±34.46µs 1494.1±47.11µs -0.14%
Perform Runtime Capabilities Analysis (RCA) on large file sample 8.1±0.40ms 7.7±0.08ms -4.94%
Perform Runtime Capabilities Analysis (RCA) on teleport sample 1407.9±27.47µs 1431.2±257.51µs +1.65%
Perform Runtime Capabilities Analysis (RCA) on the core and std libraries 21.1±0.18ms 21.6±0.86ms +2.37%
Teleport evaluation 80.9±3.54µs 80.4±5.11µs -0.62%

@minestarks minestarks added this pull request to the merge queue Apr 17, 2024
Merged via the queue into main with commit becec5e Apr 17, 2024
17 checks passed
@minestarks minestarks deleted the minestarks/circuits-tweaks branch April 17, 2024 17:19
@minestarks
Copy link
Member Author

Related #1085

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants