Open pablolh opened 1 year ago
Some resource to read on float errors: https://en.wikipedia.org/wiki/Floating-point_error_mitigation
IMHO this goes into domain on - computer algebra system (CAS) - its a slippery slope to add to a library; what could be done is perhaps if you had a Mathematic or similar CAS you can pump in the expressions and get results back.
As I just ran into the problem where I do a bell pair and measure a qubit and end up with the following pure state (artificially increased the precision):
This would be a nice feature to have symbolic computation into QX-simulator, so as to avoid rounding issues and get a meaningful output to the user.
This should handle square roots and fractions on top of the usual multiplication and substraction, as well as some simplification methods. Example of expected output for a non-measured bell pair:
An example of library which could help do this would be SymbolicC++
This functionality would coexist with the current normal computation and would be toggled by a flag. It will probably be much slower than normal floating-point based computation, but much nicer to interpret the output.
On the side, we can look into how to mitigate approximation errors for floating-point computation, which involves diving into the exciting world of floats.