feature: Decomposition of 1- and 2-qubit unitary gates.
Issue #, if available:
Description of changes: Support the decomposition of 1- and 2-qubit unitary gates.
Testing done:
test/unit_tests/braket/circuits/synthesis/test_invariants.py: 10 manual test cases. All functions covered.
test/unit_tests/braket/circuits/synthesis/test_one_qubit_decomposition.py: 5 manual test cases and 10k randomly generated test cases (reduced the random test cases to ~1000 for speed). All functions covered.
test/unit_tests/braket/circuits/synthesis/test_predicates.py: 10+ manual test cases and 10k randomly generated test cases (reduced the random test cases to ~1000 for speed). All functions covered.
test/unit_tests/braket/circuits/synthesis/test_two_q_decomposition.py: 10+ manual test cases and 10k randomly generated test cases (reduced the random test cases to ~1000 for speed). All functions covered.
test/unit_tests/braket/circuits/synthesis/test_util.py: 30+ manual test cases. All functions covered.
More than 30k tests cases run, 1457 test cases in total in the current files.
Merge Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.
General
- [x] I have read the CONTRIBUTING doc
- [ ] I used the commit message format described in CONTRIBUTING
- [ ] I have updated any necessary documentation, including READMEs and API docs (if appropriate)
Tests
- [x] I have added tests that prove my fix is effective or that my feature works (if appropriate)
- [x] I have checked that my tests are not configured for a specific region or account (if appropriate)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Codecov Report
Merging #277 (1b3fa2d) into main (d9baf46) will not change coverage. The diff coverage is
100.00%.
@@ Coverage Diff @@
## main #277 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 63 68 +5
Lines 4201 4652 +451
Branches 578 632 +54
==========================================
+ Hits 4201 4652 +451
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/braket/circuits/quantum_operator_helpers.py | 100.00% <100.00%> (ø) |
|
| src/braket/circuits/synthesis/constants.py | 100.00% <100.00%> (ø) |
|
| src/braket/circuits/synthesis/invariants.py | 100.00% <100.00%> (ø) |
|
| ...aket/circuits/synthesis/one_qubit_decomposition.py | 100.00% <100.00%> (ø) |
|
| ...aket/circuits/synthesis/two_qubit_decomposition.py | 100.00% <100.00%> (ø) |
|
| src/braket/circuits/synthesis/util.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update d9baf46...1b3fa2d. Read the comment docs.
Closing PR since there has been no activity on this for a while. Please feel free to reopen if you wish to continue working on this. Thanks!