Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbolic computation in the simulator #126

Open
pablolh opened this issue Feb 7, 2023 · 2 comments
Open

Symbolic computation in the simulator #126

pablolh opened this issue Feb 7, 2023 · 2 comments

Comments

@pablolh
Copy link

pablolh commented Feb 7, 2023

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):

Final quantum state
00       0.999999999999999777955395074969 + 0.000000000000000000000000000000*i    (p = 0.999999999999999555910790149937)

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:

00     1/sqrt(2) + 0*i
11     1/sqrt(2) + 0*i

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.

@pablolh
Copy link
Author

pablolh commented Feb 7, 2023

Some resource to read on float errors: https://en.wikipedia.org/wiki/Floating-point_error_mitigation

@arcturusannamalai
Copy link

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.

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

No branches or pull requests

2 participants