Skip to content

v4.1#622

Merged
TysonRayJones merged 12 commits intomainfrom
devel
May 28, 2025
Merged

v4.1#622
TysonRayJones merged 12 commits intomainfrom
devel

Conversation

@TysonRayJones
Copy link
Member

No description provided.

TysonRayJones and others added 10 commits April 22, 2025 11:45
- moved and renamed isolated examples
- tidied example-related CMakeLists.txt
- updated example-related doc
- added dynamics example
- updated min_example to be C/C++ agnostic
- change compile workflow to run Windows first (since MSVC is the most pedantic compiler of those tested so should run and fail soonest)
Erich (build):
- adjusted install interface paths to use CMAKE_INSTALL_INCLUDEDIR
- added platform-agnostic RPATH handling via helper function setup_quest_rpath
- set RPATH origin for dynamic linking
- passed QuEST version info to CMake

Tyson (CI):
- run compiled examples to test for link-time errors
- temporarily disabled LCOV reporting to PRs

---------

Co-authored-by: Tyson Jones <tyson.jones.input@gmail.com>
so that external contributors (and importantly right now, example PRs) can contribute new, self-contained unit test code without needing to incorporate new headers
This resolves the issues highlighted in #611 while maintaining QuEST's header include structure in the source
including
- removing references to defunct `invalidQuESTInputError`
- essential doc needed to disambiguate function conventions (like relationship between function parameters and effected operation phases)
- renamed Doxygen keyword `@equivalent` to `@equivalences`
- ... `@notvalidated` to `@notyetvalidated`
- ... `@notdoced` to `@notyetdoced`
- ... `@nottested` to `@notyettested`
- changed some `@cpponly` functions into new `@cppvectoroverload`, and then hid the latter
- added links from doc to the example PR
- linked `C++`-overload doc to corresponding `C` function (using `@see`)
Since `bitValue` is an `int`, the expression `bitValue << bitIndex` can overflow when `bitIndex` equals/exceeds 32. This is solved by casting `bitValue` into a `qindex` before shifting.

(Tyson updated authorlists)
This required editing the source to exclude designated initialisers which are not supported in C++17 except through compiler extensions. Such extensions are enabled by default in Clang and GCC but require explicit enabling in e.g. MSVC. We've here made the decision to widen default-compiler support by making struct initialisation a little uglier.
When the passed PauliStr is identity and no control qubits are imposed, the function merely effects a change in global phase. For density matrices, this induces no change at all; the two constituent operations upon the Choi vector cancel one-another, wasting time and numerical accuracy. So, we abort in that scenario.

This is truly an insignificant runtime and accuracy optimisation, and this scenario is superfluously handled mostly to document the validity of the scenario (i.e. the use of gadgets to effect arbitrary phase changes)
Now, all standalone C and C++ files in the 'isolated' and 'automated' subdirectories of 'examples' will be executed by the compiler Github Action. The former is to just catch/log interface issues not reflected by the unit tests, while the latter empowers external contributors to include casual test code with their PRs which will be run cross-platform, cross-compiler and cross-precision. This is a much easier alternative to users attempting to include unit tests in their PRs,  and has been setup in preparation for unitaryHACK 2025.

 Also documented each examples subdir
@TysonRayJones TysonRayJones merged commit 2d1a6fb into main May 28, 2025
275 of 520 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants