Repository navigation
The real and the imaginary part are functions, Re and Im - #2185
Merged
Merged
Conversation
Re(z) and Im(z) are Entity.Ref and Entity.Imf, written as Mathematica, Maple and ISO 80000-2
write them, and accepted as SymPy's re and im and MATLAB's real and imag; they print Re and Im
and draw upright, \operatorname{Re}. Both are real, Im(3 + 4i) being 4 and not 4i, and
real-linear: carried through sums, differences, and products and quotients by a real number.
The conjugate keeps the real part and turns the imaginary one. Not through a product of two
symbols or through i, which mix the parts. What is known to be real is its own real part, and
has a value exactly where that has one; its imaginary part is not taken as 0, since a codomain
says what a node's values are and not where it has one. Both differentiate along the real line.
re and im were left as products while the library had neither, two letters being short enough
to be a variable's name. They are the functions now, and the name without a bracket is still a
variable; that change of reading is recorded as breaking. The MCP server's examples of a silent
product move to beta(z), and its misspelling hints for re and im are gone.
Part of #2145.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2185 +/- ##
==========================================
+ Coverage 86.45% 86.47% +0.01%
==========================================
Files 297 297
Lines 65448 65596 +148
Branches 19215 19224 +9
==========================================
+ Hits 56582 56721 +139
- Misses 4808 4811 +3
- Partials 4058 4064 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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 last part of #2145: the real and the imaginary part.
Names. On #2145 Happypig375 asked for the capitalised spelling. Checked against the sources, it is the written convention, and SymPy is the outlier:
Re zIm zRe[z]Im[z]Re(z)Im(z)re(z)im(z)real(z)imag(z)So
Re(z)andIm(z)print as written there, and draw upright,\operatorname{Re}\left(z\right), as ISO writes them, rather than with the fraktur\Re. SymPy'sreandimand MATLAB'srealandimagare accepted on input, since those users type them.ToSympyemitssympy.reandsympy.im. The nodes areEntity.RefandEntity.Imf, and they are alsoMathS.ReandMathS.Im.What they do
Im(3 + 4i)is4, not4i.Re(a) Re(b) - Im(a) Im(b), or throughi, which turns one part into the other.Re(conj(z))isRe(z), andIm(conj(z))is-Im(z).Re(abs(z))isabs(z). Its imaginary part is not taken as0. That is the lesson of The complex conjugate and the principal argument are functions #2181's BoundCheck finding: a codomain says what a node's values are, not where it has one, andIm(prime(x))has no value atx = -3.Re(f)'beingRe(f'). An equation in either is left unsolved, since where a part has a value is a line.A change of reading.
re(x)andim(x)were left as products since #733, while the library had neither function: two letters is short enough to be somebody's variable. They are the functions now, and the name without a bracket is still a variable. The breaking entry records it, andMissingFunctionNamesRefusedTestandSyntaxDocumentedTestnow pin that the bare names stay variables. The MCP server's example of a silent product moves fromim(z)tobeta(z), and its misspelling hints forreandimare gone.Docs/Usage/Syntax.md's "Refused by name" paragraph, which still listedconjugatefrom before #2181, is corrected.re(z)re * zRe(z)im(3 + 4i), simplified(3 + 4i) * im4re * xre * xre * xMeasured
SyntaxDocumentedTestpinningre(x)andim(x)as products, which the amended commit's rows replace.Part of #2145. With this, every function #2145 asks for is in, and the unit-circle rewriting it mentions waits for #2148.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura