-
Notifications
You must be signed in to change notification settings - Fork 342
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
Add unit test for validating trotterization order #1120
Add unit test for validating trotterization order #1120
Conversation
Semaphore is complaining about scipy. Probably needs to be added to requirements.txt. Is there any sane way to avoid the scipy dependency? Scipy is useful enough that I don't feel that bad about adding it to dependencies (I'm a little surprised we didn't already depend on it), but if there is a not-too-onerous way to avoid pulling it in just for this test, that might be preferable. |
Thanks for pointing the dependency out. I took it for granted that it was one of the prerequisites. I think I can work around it, though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to google "matrix exponential" so I'm probably not the best person to review the math here, but otherwise lgtm.
xs = 10**np.logspace(-1, -6, 10) | ||
for order in [1, 2, 3, 4]: | ||
ys = [error(order, float(x)) for x in xs] | ||
p = np.polyfit(np.log10(xs), np.log10(ys), 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this needs is a CHANGELOG entry and it's ready to merge.
Add unit test validating the order of the trotterization schemes.