-
Notifications
You must be signed in to change notification settings - Fork 10
Fix of implementation of SyrecSynthesis::increase operation #286
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
Fix of implementation of SyrecSynthesis::increase operation #286
Conversation
…crease() operation
…/increment assignments
… increase and increaseWithCarry functions into one function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
@burgholzer This PR would be ready for a review if the required patch coverage was hit. Are there any recommendations for how we can increase the patch coverage of a PR where the offending lines are only partially covered (in which the not hit condition should only be triggered in exceptional cases, i.e. if a bug in the implementation exists) if we are only trying to test the public interfaces of the |
Okay. I checked all the other PRs and merged where appropriate. Now this can be updated and should also be ready for review then. |
…simulationt tests to load data from json
Pull request was deleted and closed by mistake due to an incorrect deletion of a local branch thus the PR is reopened. |
@@ -59,6 +59,94 @@ | |||
this->performTestExecutionForCircuitLoadedFromJson(RELATIVE_PATH_TO_TEST_CASE_DATA_JSON_FILE, this->getNameOfCurrentlyExecutedTest()); | |||
} | |||
|
|||
TYPED_TEST_P(BaseSimulationTestFixture, AddAssignWithRightHandSideEqualToVariable) { | |||
this->performTestExecutionForCircuitLoadedFromJson(RELATIVE_PATH_TO_TEST_CASE_DATA_JSON_FILE, this->getNameOfCurrentlyExecutedTest()); |
Check notice
Code scanning / CodeQL
Unused static variable Note test
} | ||
|
||
TYPED_TEST_P(BaseSimulationTestFixture, AddAssignWithRightHandSideEqualToConstant) { | ||
this->performTestExecutionForCircuitLoadedFromJson(RELATIVE_PATH_TO_TEST_CASE_DATA_JSON_FILE, this->getNameOfCurrentlyExecutedTest()); |
Check notice
Code scanning / CodeQL
Unused static variable Note test
} | ||
|
||
TYPED_TEST_P(BaseSimulationTestFixture, AddAssignWithRightHandSideEqualToShiftExpression) { | ||
this->performTestExecutionForCircuitLoadedFromJson(RELATIVE_PATH_TO_TEST_CASE_DATA_JSON_FILE, this->getNameOfCurrentlyExecutedTest()); |
Check notice
Code scanning / CodeQL
Unused static variable Note test
} | ||
|
||
TYPED_TEST_P(BaseSimulationTestFixture, AddAssignWithRightHandSideEqualToUnaryExpression) { | ||
this->performTestExecutionForCircuitLoadedFromJson(RELATIVE_PATH_TO_TEST_CASE_DATA_JSON_FILE, this->getNameOfCurrentlyExecutedTest()); |
Check notice
Code scanning / CodeQL
Unused static variable Note test
} | ||
|
||
TYPED_TEST_P(BaseSimulationTestFixture, AddAssignWithRightHandSideEqualToNestedExpression) { | ||
this->performTestExecutionForCircuitLoadedFromJson(RELATIVE_PATH_TO_TEST_CASE_DATA_JSON_FILE, this->getNameOfCurrentlyExecutedTest()); |
Check notice
Code scanning / CodeQL
Unused static variable Note test
} | ||
|
||
TYPED_TEST_P(BaseSimulationTestFixture, AddAssignOfBitOfValueOfDimensionOfVariable) { | ||
this->performTestExecutionForCircuitLoadedFromJson(RELATIVE_PATH_TO_TEST_CASE_DATA_JSON_FILE, this->getNameOfCurrentlyExecutedTest()); |
Check notice
Code scanning / CodeQL
Unused static variable Note test
} | ||
|
||
TYPED_TEST_P(BaseSimulationTestFixture, IncrementAssignOfVariable) { | ||
this->performTestExecutionForCircuitLoadedFromJson(RELATIVE_PATH_TO_TEST_CASE_DATA_JSON_FILE, this->getNameOfCurrentlyExecutedTest()); |
Check notice
Code scanning / CodeQL
Unused static variable Note test
} | ||
|
||
TYPED_TEST_P(BaseSimulationTestFixture, IncrementAssignOfBitOfVariable) { | ||
this->performTestExecutionForCircuitLoadedFromJson(RELATIVE_PATH_TO_TEST_CASE_DATA_JSON_FILE, this->getNameOfCurrentlyExecutedTest()); |
Check notice
Code scanning / CodeQL
Unused static variable Note test
} | ||
|
||
TYPED_TEST_P(BaseSimulationTestFixture, IncrementValueOfDimensionOfVariable) { | ||
this->performTestExecutionForCircuitLoadedFromJson(RELATIVE_PATH_TO_TEST_CASE_DATA_JSON_FILE, this->getNameOfCurrentlyExecutedTest()); |
Check notice
Code scanning / CodeQL
Unused static variable Note test
} | ||
|
||
TYPED_TEST_P(BaseSimulationTestFixture, IncrementBitOfValueOfDimensionOfVariable) { | ||
this->performTestExecutionForCircuitLoadedFromJson(RELATIVE_PATH_TO_TEST_CASE_DATA_JSON_FILE, this->getNameOfCurrentlyExecutedTest()); |
Check notice
Code scanning / CodeQL
Unused static variable Note test
Merging the changes made in this PR and #297 will result in a merge conflict and will need to be resolved manually after one of the PRs was review and merge into the main branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏼 nice work on the documentation of the individual steps!
@burgholzer Can a manual merge (via a squash of the commits) into the main branch be performed since the required patch coverage is/will not be reached by this PR? |
611e72b
into
munich-quantum-toolkit:main
Description
With this PR the counter-examples found in 🐛 Simulated results of line-aware synthesized circuit not matching expected values #254 can be correctly synthesized due to bugfixes in the
SyrecSynthesis::increase
operation. Additionally, further tests of the binary+
operation as well as the assignment operations+=
and++=
are added that check that a simulation of these operations returns the correct results (the expected synthesis costs are not defined).Various algorithms that can be used fix the errors of
SyrecSynthesis::increase
were proposed in 🐛 Simulated results of line-aware synthesized circuit not matching expected values #254 but since the pre-PR implementation already followed one of these algorithms (with the algorithm of "Quantum Addition Circuits and Unbounded Fan-Out" (Takahashi et al.) being the closest match) no complete reimplementation was needed.Some simulation tests could not be added in the PR due to errors in the
LineAwareSynthesis
(e.g., see 🐛 Index out of range error when checking for overlapping qubit indices in operands of expression #280)A breaking change in the internal
SyrecSynthesis
interface was added due to the unification of theSyrecSynthesis::increase
andSyrecSynthesis::increaseWithCarry
into one function.Fixes #254
Checklist: