Description
Required prerequisites
- Consult the security policy. If reporting a security vulnerability, do not report the bug using this form. Use the process described in the policy to report the issue.
- Make sure you've read the documentation. Your issue may be addressed there.
- Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
- If possible, make a PR with a failing test to give us a starting point to work on!
Describe the bug
At IQM we are now implementing the use of an dynamic quantum architecture as discussed earlier in the issues #865 and #1589. This does not use the provided static files for the quantum architecture but gets the current architecture from the target QPU and writes a quantum architecture file on the fly. This is then passed to the LLVM just like the static file is used in the current main line.
In testing we now see that the qubits designations sent in the request to the target always start counting linear from 1 although qubit 2 for example is not available on the physical machine. In analyzing the debug logs from the LLVM we see that there is a vector named "mapping_v2p" which has an always linear enumeration although we believe this should reflect the physical qubits which were selected during the LLVM pass.
We now need help from a knowledgeable person to confirm our analysis and if found to be an issue to fix this or help us with fixing it.
Steps to reproduce the bug
Issue was crosschecked on v0.11.0 release branch. (commit f75546c)
There the following patch is applied:
diff --git a/unittests/backends/iqm/IQMTester.cpp b/unittests/backends/iqm/IQMTester.cpp
index b081f8a0..83c16beb 100644
--- a/unittests/backends/iqm/IQMTester.cpp
+++ b/unittests/backends/iqm/IQMTester.cpp
@@ -23,7 +23,8 @@
std::string backendStringTemplate =
"iqm;emulate;false;qpu-architecture;{};url;"
- "http://localhost:62443"; // add architecture
+ "http://localhost:62443;mapping_file;Orcus.txt"; // add architecture
+// "http://localhost:62443"; // add architecture
CUDAQ_TEST(IQMTester, executeOneMeasuredQubitProgram) {
std::string arch = "Apollo";
After building the project with "Debug" flag the attached file Orcus.txt is placed into the folder "build/unittests/backends/iqm/". (Please note that this has to be repeated after every re-build as this is just a hack to keep the example simple.)
Then ctest is started from the top level directory with ctest --verbose --test-dir build -R iqm
The observation on the mock-iqm-server is that the test "executeLoopOverQubitsProgram" is failing. When running on a real IQM server even more tests fail. For the details please see the attached logs.
logs.qbit-mapping.tar.gz
Expected behavior
Expected that:
- the ctests for IQM target pass with both mock-server and physical machine
- the mapping of qubit numbering is shown in debug output
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression
Environment
- CUDA-Q version: v0.11.0
- Python version: docker image
- C++ compiler: docker image
- Operating system: 5.15.167.4-microsoft-standard-WSL2
Suggestions
No response