Commit 7dd3899
Reworked adders and tests (#878)
Added and reworked all adders and helper operations. Adders supported:
* General in-place adder `IncByLE`. Implemented via TTK adder. Specific
implementations:
* `RippleCarryTTKIncByLE`
* `RippleCarryCGIncByLE`
* `FourierTDIncByLE`
* General `IncByI`. Implemented via
`IncByIUsingIncByLE(RippleCarryTTKIncByLE)`.
* General `IncByL` implemented via
`IncByLUsingIncByLE(RippleCarryTTKIncByLE)`.
* General out-of-place adder `AddLE`. Implementated via CG adder.
Specific implementations:
* `RippleCarryCGAddLE`
* `LookAheadDKRSAddLE`
* Helper function `IncByLEUsingAddLE` to use two out-of-place adders to
add in-place.
* Helper function `IncByIUsingIncByLE` to increase by Int using an
in-place adder.
* Helper function `IncByLUsingIncByLE` to increase by BigInt using an
in-place adder.
TTK adder updated to reduce simulation time by ~7%, CG adder updated to
reduce simulation time by ~30%.
Added and unified tests.
All adders are now in the Microsoft.Qunatum.**Unstable**.Arithmetic
namespace to signify that they will change in future and will be moved
to a separate library when we have support for it.
Note that we will entirely remove Microsoft.Qunatum.Arithmetic namespace
from the standard library by moving a few remaining operations to a
different namespace where they fit better. This will be in a separate
PR.
---------
Co-authored-by: Dmitry Vasilevsky <[email protected]>1 parent 5c45282 commit 7dd3899
File tree
13 files changed
+1319
-1242
lines changed- compiler/qsc_frontend/src
- library
- std
- tests/src
- resources
- samples/algorithms
13 files changed
+1319
-1242
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | 400 | | |
405 | 401 | | |
406 | 402 | | |
| |||
445 | 441 | | |
446 | 442 | | |
447 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
448 | 452 | | |
449 | 453 | | |
450 | 454 | | |
| |||
0 commit comments