Issue 10562: Change 'j' for imaginary unit into an 'i'
bugs.python.org
bugs.python.org
"That could work; it's a bit late to do this in 3.2, though. How about the following transition strategy for the complex output.
Python 3.3: Introduce PYTHONIMAGINARYSYMBOL environment variable (and possibly also a related command-line option to the interpreter?).
Python 3.4: Show a warning on startup if this environment variable isn't used.
Python 3.5: Make the environment variable mandatory.
Python 3.6: Make the environment variable optional again, but this time with the default output being 'i' rather than 'j'.
Python 3.7: Deprecate use of PYTHONIMAGINARYSYMBOL. (Warning on startup if it's set.)
Python 3.8: Error on startup if PYTHONIMAGINARYSYMBOL is set.
Python 3.9: Go back to ignoring PYTHONIMAGINARYSYMBOL."
"This deterministic approach has the advantage that migration of code from one imaginary symbol to another is as easy as:
sed -e 's/k/l/' -e 's/j/k/' -e 's/i/j/' -e 's/l/i/'
provided that you restrict yourself not to use the characters i, j, k or l in identifiers, keywords or strings in the source code."
Looking at it, it seems like it would be rather hard to introduce. Any symbol which isn't already a bit too close to a misdrawn version of a Greek or Roman letter (I see three letters which look like misdrawn πs) is pretty hard to draw without practice.
It already has:
PS. I've also posted this as a comment to the bug report.
PS - I agree, (and upvoted) to your comment. I like this approach http://bugs.python.org/issue10562#msg123135
...everyone seems to be forgetting that i == -j (either squared is 1). Physicists usually describe traveling waves (of whatever) as something proportional to exp(kx-iwt) where that's an omega, not a w, and electrical engineers for whatever reason prefer the notation exp(kx+jwt) (note the minus sign difference). Except ee's sometimes write exp(kx-jwt), depending on the convention in use at the time.
i == j, not i == -j in most applications. If you take the number z = a + ib and turn it into z = a - jb, and just take Im(z), you end up with two different answers otherwise.
'j' for *a* (not *the* </pedantry>) square root of -1 has...When you start talking about charge density, current, phase and frequency, you almost always start reverting back to engineering notation (i == j). In QM we used i. In Complex Analysis, we used i. In CM, with regards to oscillators/harmonic motion, we used i.
The wikipedia article on imaginary units talks about interchanging i and -j denoting the reversal of plane waves, but we never did that in advanced electrodynamics. However, I wouldn't be surprised if some people do, but as far as I know it's not that common. It's probably find for determining the EM field at some point for some time, but for the problems where you have to find the charge density on a surface of conductor induced by a EM wave, this notation would start to get confusing.
I'm personally -0.small on it
even though I don't understand it. Anyone?
Edit: much more amusing is Antoine’s comment “[...] Otherwise +11j from me”
import math
math.sqrt(-1)To actually answer your question, complex numbers make signal processing algorithms much more tractable, and also make it easy to visualize many commonplace quantities and phenomena in electrical engineering. Anytime a value has both a magnitude and a time- or phase-based aspect, chances are you can use complex numbers to represent it.
Put another way: just as negative numbers allow you to specify movement along an axis, complex numbers allow you to specify rotation around an axis. Both are obviously pretty fundamental.
Check out phasors: http://en.wikipedia.org/wiki/Phasor_(sine_waves). Complex numbers make phasor math simple and elegant.
The complex numbers form a ring that is isomorphic to the cross product of the ring of real numbers and itself....
C≅R×R
For those who haven't done abstract algebra:
This means your can map a complex number to (x,y), that every complex number maps to a unique (x,y), and that if you add or multiply two complex numbers and then convert the result to (x,y), you can convert the two complex numbers to (x,y) and then multiply getting the same answer. (it is also bijective, meaning it works both ways).
Importance: Complex numbers can be dealt with as coordinates and coordinates can be dealt with as complex numbers.
The addition does work as you suggest, so a more correct formal statement would be: the complex numbers form an additive group that is isomorphic to the cartesian product of the additive group of real numbers and itself; the complex numbers also happen to form a ring (indeed a field).
But I believe you are right.... curse you Hungerford for teaching rings and groups simultaneously....
17 = (4+i)(4-i)