-
Notifications
You must be signed in to change notification settings - Fork 21
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
Complex-valued variables #121
Merged
Merged
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
b46b905
First step to implement complex variables functionality
projekter a5cb35d
Move monomial function to correct file
projekter 91583e2
Rename ordvar to ordinary_variable
projekter b3d8d73
Specialized complex routines for MonomialVector
projekter 0cd4cfd
fix
projekter 098ee29
coefficienttype -> coefficient_type
blegat 43a0a61
Remove incorrect method
blegat b93b6bc
Merge branch 'bl/coefficient_type' of https://github.com/JuliaAlgebra…
projekter e417490
Merge branch 'master' of https://github.com/JuliaAlgebra/DynamicPolyn…
projekter 214d169
Add a (sometimes working) implementation for incomplete substitution
projekter c5c1c99
Fix old syntax
projekter 25ac2cf
Merge branch 'master' of https://github.com/JuliaAlgebra/DynamicPolyn…
projekter 31a8d4c
Format
projekter a19c0b0
Remove TODO
projekter 0bf8175
Merge branch 'master' of https://github.com/JuliaAlgebra/DynamicPolyn…
projekter 6b055bd
Add complex kind parameter to VT("name") constructor
projekter a61aaa2
Remove iscomplex
projekter f87fb62
Remove dev dependency of MP, 0.5.3 has landed
projekter 71ffcb5
Merge branch 'master' of https://github.com/JuliaAlgebra/DynamicPolyn…
projekter f9873bf
Merge remote-tracking branch 'upstream/master'
projekter da7fd62
Add ComplexKind docstring
projekter f8d3214
Rename ComplexKind instances
projekter 7e07585
typo
projekter 8cf9c12
change substitution rules
projekter 6c230f6
Rename polycvar macro
projekter a6e1d80
Error for partial substitutions
projekter f9337ff
Format
projekter e0ad44d
Complex substitution test cases
projekter 0845707
More strict substitution rules: only allow ordinary variable
projekter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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, could you add some tests for these edge cases ?
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 added a few testcases. Note that I did not use the substitution syntax without explicit variable specification. This is because
variables(p)
would list all variables, complex, conjugates, real, and imaginary parts separately. So you'd have to specify values for all of them (unnecessarily - and this would even be more restrictive as then:z + real(z)
, called with arguments(1+2im, 1)
would trigger the new error, becausez
occurs but a value is assigned toreal(z)
). Either the whole variable assignment would need to be redesigned or we just say that for complex variables, you should always explicitly specify a substitution rule.(But even then, substitution rules could be redundant;
[z, real(z)] => [1+2im, 1]
is also a valid rule. Should we check whether the rules are self-consistent? Given that variables occuring twice are also not checked, I think the current lax behavior is fine.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.
Indeed, that's an issue. We should only allow
COMPLEX_PART
to used in substitutions then. In this PR, I think we should target the simplest implementation that's bullet proof. We can try to make something more complicated but I'd rather do it in a separate PR if there is a use case for it. So I'd just restrictz
to be aCOMPLEX_PART
wheneverz => ...
is usedThere 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.
This simplifies the substitution process significantly. I don't know whether I like it, but there's some sense to it.
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.
We can revisit in a follow up PR without being breaking. We'll be able to recover your implementation easily from this branch.