QuTech-Delft / OpenQL

OpenQL: A Portable Quantum Programming Framework for Quantum Accelerators. https://dl.acm.org/doi/10.1145/3474222
https://openql.readthedocs.io
Other
100 stars 44 forks source link

Swap decomposition #443

Closed jvansomeren closed 2 years ago

jvansomeren commented 2 years ago

This branch was set up to repair a bug which turned out not to be in the OpenQL code. The bug was in a private config file. In the course of debugging, several improvements were done to the debugging support (QL_DOUTs, multi-line debugging). And a test was updated to compare with a golden output.

But we might conclude that OpenQL doesn't test adequately on the contents of strings such as "cz q0 q3" in the config file. Note that this string is wrong, the comma between the operands is missing.

wvlothuizen commented 2 years ago

But we might conclude that OpenQL doesn't test adequately on the contents of strings such as "cz q0 q3" in the config file. Note that this string is wrong, the comma between the operands is missing.

It would be great to also add a solution for that, or file an issue, preferentially with any diagnosis performed on where things go wrong.

jvansomeren commented 2 years ago

Yes, that would be great. Solving it must be done in a separate PR.

But to add a test that shows it now, requires a modified config file. I can imagine adding a test in the repository: tests/wrong_config_file.py that reads tests/wrong_config_file.json that will certainly fail, but I don’t like to pollute the repository with this.

After solving the issue, we probably can make a test (or set of tests) that each check a particular problem in the config file and fail on that. That failing is then OK, not failing is not OK. This requires some python scripting.

Analyzing the full extend of the problem to make it an issue, is also some work. Things that I doubt now, are (all in the old config file):

In the decomposition section:

In the instructions section:

That these are not diagnosed when present, I still need to verify. I was testing with a config file where all of these were present. Then replaced all the spaces between operands by “,”, and this helped.

Any suggestions?

At least I can file an issue based on the analysis and text above.

Op 1 apr. 2022, om 16:56 heeft Wouter Vlothuizen @.**@.>> het volgende geschreven:

But we might conclude that OpenQL doesn't test adequately on the contents of strings such as "cz q0 q3" in the config file. Note that this string is wrong, the comma between the operands is missing.

It would be great to also add a solution for that, or file an issue, preferentially with any diagnosis performed on where things go wrong.

— Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_QuTech-2DDelft_OpenQL_pull_443-23issuecomment-2D1086000425&d=DwMCaQ&c=XYzUhXBD2cD-CornpT4QE19xOJBbRy-TBPLK0X9U2o8&r=kNdT9ewT6pQdYFkBLR_5-ZqsrSTk7k5Hdd7MSC_Vnzg&m=oQeTtjsuCnrZQlnlwiCTmgPzaIPRxI8oA03mk3rr7ns&s=DfE1kObBuGwYk8mZiNPo2kSA1gg-QNXYKl8FBGegMVw&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AEDTBNUDJFC722GHW5P3FFLVC4FCTANCNFSM5SI3J7IA&d=DwMCaQ&c=XYzUhXBD2cD-CornpT4QE19xOJBbRy-TBPLK0X9U2o8&r=kNdT9ewT6pQdYFkBLR_5-ZqsrSTk7k5Hdd7MSC_Vnzg&m=oQeTtjsuCnrZQlnlwiCTmgPzaIPRxI8oA03mk3rr7ns&s=mwKSLbCF0EV_csEVlIh-KRyfD0H2mMFcVhronY-TvmE&e=. You are receiving this because you authored the thread.Message ID: @.***>