Eliminate special cases from update_and_substitute#138
Merged
utensil merged 1 commit intopygae:masterfrom Dec 6, 2019
Merged
Conversation
Member
Author
1a4b6a6 to
3116778
Compare
eric-wieser
commented
Dec 5, 2019
Comment on lines
133
to
139
| "B = \u001b[0;34mX\u001b[0m^\u001b[0;34mY\u001b[0m - (\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mX\u001b[0m^\u001b[0;34me\u001b[0m + (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mY\u001b[0m^\u001b[0;34me\u001b[0m\n", | ||
| "B**2 = 3*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m) + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mY\u001b[0m^\u001b[0;34me\u001b[0m - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*((\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m) + \u001b[0;34mY\u001b[0m^\u001b[0;34me\u001b[0m) - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mX\u001b[0m^\u001b[0;34me\u001b[0m + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*((\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m) + \u001b[0;34mX\u001b[0m^\u001b[0;34me\u001b[0m) + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*\u001b[0;34mX\u001b[0m^\u001b[0;34mY\u001b[0m - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m) + \u001b[0;34mX\u001b[0m^\u001b[0;34mY\u001b[0m)\n", | ||
| "B**2 = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)\n", | ||
| "#L = X^Y^e is a non-euclidian line\n", | ||
| "B = L*e = \u001b[0;34mX\u001b[0m^\u001b[0;34mY\u001b[0m - (\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mX\u001b[0m^\u001b[0;34me\u001b[0m + (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mY\u001b[0m^\u001b[0;34me\u001b[0m\n", | ||
| "B*e*B.rev() = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(-(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m) + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))*\u001b[0;34me\u001b[0m\n", | ||
| "B**2 = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m) - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))\n", | ||
| "B**2 = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)\n", | ||
| "L**2 = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)\n", |
Member
Author
There was a problem hiding this comment.
These lines from from:
Note that the two B**2 printouts now match, rather than being different :)
eric-wieser
commented
Dec 5, 2019
| assert str(B) == 'X^Y - (Y.e)*X^e + (X.e)*Y^e' | ||
| Bsq = B*B | ||
| assert str(Bsq) == '(X.Y)*((X.Y) - 2*(X.e)*(Y.e))' | ||
| assert str(Bsq) == '(X.Y)**2 - 2*(X.Y)*(X.e)*(Y.e)' |
Member
Author
There was a problem hiding this comment.
Seems like a harmless change that the parentheses end up expanded now.
The tables now contain scalars, so this should work for all cases Note that as a result of this, some multiplications now end up slightly more expanded
3116778 to
1b92992
Compare
Codecov Report
@@ Coverage Diff @@
## master #138 +/- ##
==========================================
- Coverage 67.66% 67.53% -0.14%
==========================================
Files 8 8
Lines 4803 4796 -7
==========================================
- Hits 3250 3239 -11
- Misses 1553 1557 +4
Continue to review full report at Codecov.
|
Member
Author
|
Your rebased messed up my base-juggling strategy in the other pr... Will rebase that one instead. |
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.

The tables now contain scalars, so this should work for all cases
Split from #134
Consequence: