Systematising environment variables#653
Merged
TysonRayJones merged 8 commits intodevelfrom Jun 25, 2025
Merged
Conversation
This allows it to be changed post-compilation/installation, pre-execution, as per the machination in #645 Additionally inserted whitespaces into cmake error message about MacOS multithreading to make the advised commands clearer
which previously made use of stold() to validate that a user-given string contained a number which can be parsed as a qreal. This enabled a bug where users using FLOAT_PRECISION=1 or 2 could specify a number (e.g. in createInlinePauliStrSum) which is well-formed but exceeds the maximum or minimum storable qreal. By using stold() (the long-double version of "string to float"), the validation was too lenient and permitted literals of numbers which can fit into a long-double-qreal but not the current smaller-precision qreal. We now instead use a string-to-float function specific to the precision of qreal (stof(), stod() or stold()) so that the "can store number as qreal" validation always runs correctly. We further refactored number parsing in parser.cpp to "trust" the regex and throw an internal error (rather than a user-blaming validation error) when the string-to-float functions fail when the regex assured otherwise. This
and changed DEFAULT_VALIDATION_EPSILON from a macro to an env-var
since float underflow is now detected - confirming the bug (qcomp literals underflowing to zero without a validation message) was silently occurring in our tests!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
as per the discussions in #645