microsoft / qsharp

Azure Quantum Development Kit, including the Q# programming language, resource estimator, and Quantum Katas
https://microsoft.github.io/qsharp/
MIT License
426 stars 86 forks source link

Support logical `not` in `@Config` attribute #1564

Closed swernli closed 4 months ago

swernli commented 4 months ago

This change adds support for logical not inside of @Config attributes and makes it work as expected with the additive native of the attributes. So to specify an item that should only be available when compiling with Adaptive and IntegerComputations, but not with HigherLevelConstructs like dynamic strings, you can write:

@Config(Adaptive)
@Config(IntegerComputations)
@Config(not HigherLevelConstructs)
operation Foo() : Unit { }
github-actions[bot] commented 4 months ago

Benchmark for 75f5ed9

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 335.7±3.46µs | **328.5±8.90µs** | **-2.14%** | | Array literal evaluation | **192.8±0.72µs** | 196.7±3.97µs | **+2.02%** | | Array update evaluation | 417.1±2.09µs | **413.0±4.76µs** | **-0.98%** | | Core + Standard library compilation | 20.1±1.19ms | 19.4±0.96ms | -3.48% | | Deutsch-Jozsa evaluation | 5.1±0.04ms | **5.0±0.05ms** | **-1.96%** | | Large file parity evaluation | 34.0±0.70ms | 34.2±0.44ms | +0.59% | | Large input file compilation | 13.0±0.44ms | 12.9±0.30ms | -0.77% | | Large input file compilation (interpreter) | 50.2±1.33ms | 49.5±1.31ms | -1.39% | | Large nested iteration | 33.0±0.17ms | **32.6±0.37ms** | **-1.21%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1588.1±83.54µs | 1590.5±96.95µs | +0.15% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | **7.8±0.12ms** | 8.0±0.21ms | **+2.56%** | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1445.3±55.95µs | 1434.5±60.29µs | -0.75% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | **28.3±0.37ms** | 28.7±0.82ms | **+1.41%** | | Teleport evaluation | 88.7±5.24µs | 88.7±3.95µs | 0.00% |
github-actions[bot] commented 4 months ago

Benchmark for 161c14d

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | **334.6±5.33µs** | 337.4±1.70µs | **+0.84%** | | Array literal evaluation | **192.3±0.68µs** | 201.5±3.34µs | **+4.78%** | | Array update evaluation | **418.3±5.09µs** | 426.2±15.33µs | **+1.89%** | | Core + Standard library compilation | 19.3±0.38ms | 19.5±1.01ms | +1.04% | | Deutsch-Jozsa evaluation | 5.0±0.04ms | 5.0±0.04ms | 0.00% | | Large file parity evaluation | **33.9±0.08ms** | 34.0±0.36ms | **+0.29%** | | Large input file compilation | 12.9±0.31ms | 12.9±0.21ms | 0.00% | | Large input file compilation (interpreter) | 48.9±0.98ms | 48.6±0.87ms | -0.61% | | Large nested iteration | **33.2±0.25ms** | 33.5±1.03ms | **+0.90%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1571.4±56.85µs | 1574.7±62.36µs | +0.21% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.8±0.09ms | **7.7±0.08ms** | **-1.28%** | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1432.2±53.87µs | 1427.9±61.84µs | -0.30% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | **28.0±0.33ms** | 28.3±0.18ms | **+1.07%** | | Teleport evaluation | 88.1±3.79µs | 88.2±5.45µs | +0.11% |
github-actions[bot] commented 4 months ago

Benchmark for c668e17

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 340.1±7.95µs | 337.4±5.02µs | -0.79% | | Array literal evaluation | **175.5±2.72µs** | 200.6±2.10µs | **+14.30%** | | Array update evaluation | **403.3±8.83µs** | 420.4±4.34µs | **+4.24%** | | Core + Standard library compilation | 18.5±0.17ms | 18.4±0.29ms | -0.54% | | Deutsch-Jozsa evaluation | **4.9±0.14ms** | 5.1±0.10ms | **+4.08%** | | Large file parity evaluation | **32.8±0.73ms** | 33.9±0.10ms | **+3.35%** | | Large input file compilation | 12.2±0.27ms | 12.2±0.08ms | 0.00% | | Large input file compilation (interpreter) | 44.7±0.52ms | 44.9±0.43ms | +0.45% | | Large nested iteration | **32.4±0.68ms** | 33.0±0.17ms | **+1.85%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1555.8±34.68µs | 1561.3±119.17µs | +0.35% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.6±0.08ms | 7.6±0.15ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1415.0±40.54µs | 1415.4±29.46µs | +0.03% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | **27.7±0.27ms** | 27.9±0.13ms | **+0.72%** | | Teleport evaluation | 87.5±4.32µs | 89.3±3.42µs | +2.06% |
github-actions[bot] commented 4 months ago

Change in memory usage detected by benchmark.

Memory Report for f7cd499f0488d30ecc96c1424a8f0ef10c2db83f

Test This Branch On Main Difference
compile core + standard lib 16616885 bytes 16619429 bytes -2544 bytes
github-actions[bot] commented 4 months ago

Benchmark for f7cd499

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 309.5±4.89µs | 310.5±4.69µs | +0.32% | | Array literal evaluation | 170.8±2.85µs | 170.7±2.37µs | -0.06% | | Array update evaluation | 385.4±9.16µs | 383.2±5.11µs | -0.57% | | Core + Standard library compilation | 17.3±0.58ms | 17.2±0.29ms | -0.58% | | Deutsch-Jozsa evaluation | 4.8±0.10ms | 4.7±0.13ms | -2.08% | | Large file parity evaluation | 31.6±0.44ms | 31.9±0.97ms | +0.95% | | Large input file compilation | 11.4±0.21ms | 11.4±0.22ms | 0.00% | | Large input file compilation (interpreter) | **41.5±0.63ms** | 42.2±0.90ms | **+1.69%** | | Large nested iteration | 30.6±0.46ms | 30.5±0.47ms | -0.33% | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1448.5±35.14µs | 1452.6±32.97µs | +0.28% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.2±0.14ms | 7.2±0.18ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1314.7±35.88µs | 1316.9±32.92µs | +0.17% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 26.1±0.47ms | 26.1±0.44ms | 0.00% | | Teleport evaluation | 84.1±6.23µs | **80.1±2.96µs** | **-4.76%** |
github-actions[bot] commented 4 months ago

Change in memory usage detected by benchmark.

Memory Report for 114787fb209dd94d60d6735aec8f3960d12dbded

Test This Branch On Main Difference
compile core + standard lib 16616885 bytes 16619429 bytes -2544 bytes
github-actions[bot] commented 4 months ago

Benchmark for 114787f

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 330.4±1.75µs | 329.8±2.06µs | -0.18% | | Array literal evaluation | **184.5±0.69µs** | 186.8±0.64µs | **+1.25%** | | Array update evaluation | 411.0±9.81µs | 410.0±2.70µs | -0.24% | | Core + Standard library compilation | 18.5±0.27ms | 18.6±0.45ms | +0.54% | | Deutsch-Jozsa evaluation | 5.1±0.06ms | 5.1±0.04ms | 0.00% | | Large file parity evaluation | **33.8±0.11ms** | 34.1±0.21ms | **+0.89%** | | Large input file compilation | 12.5±0.13ms | **12.3±0.41ms** | **-1.60%** | | Large input file compilation (interpreter) | 46.1±0.85ms | 46.4±2.03ms | +0.65% | | Large nested iteration | 33.1±1.22ms | **32.5±0.13ms** | **-1.81%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1560.5±34.98µs | 1563.2±34.57µs | +0.17% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.7±0.07ms | 7.7±0.09ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1418.3±27.90µs | 1430.1±63.04µs | +0.83% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 28.0±0.37ms | 28.1±0.81ms | +0.36% | | Teleport evaluation | 90.8±3.72µs | **87.1±3.60µs** | **-4.07%** |