prerat Profile picture
social media influencee

Sep 21, 2021, 22 tweets

intro to "bouncy numbers"! 🧵

(I have been wanting to explain this for a while, and I don't think my current explaining approach is perfect, but it's good to start with something!)

there's a punchline, but I'm gonna start by introducing "bouncy numbers" as their own thing

1/

a regular number sits on the number line and it sits still.

for example, here is the number 1.

(see, no bouncing!)

a "bouncy" number moves as if it were attached to an (ideal) spring.

here's a "bouncy" 1.

notice how it starts on the number line at 1, then swing over through 0 and eventually to -1, then swings back and starts over.

bouncy numbers have two important properties:

1. magnitude: what is the furthest distance it reaches towards the positive side?

2. phase: at what *time* does it reach that furthest positive distance?

if bouncy numbers only had magnitude, they'd be just like regular numbers.

here's an example of two "bouncy" numbers that are slightly out of phase.

they both have a magnitude of 1 - that's the furthest positive number that they each bounce to - but they hit that furthest extension at *different* times.

if one bouncy number is maximally positive while another is maximally negative, then they have *opposite* phases.

you can add bouncy numbers!

if they have the same phase (in sync), then you just add their magnitudes and the sum will also have that same phase.

but what if you want to add two bouncy numbers with *different* phases?

you can still add bouncy numbers with different phases.

just move the whole number line from one bouncy number (green) and "glue" its center to the tip of the other bouncy number (blue)

now that whole (green) number line bounces!

then just watch the green tip - that's the sum

one more example:

if you add two numbers with the same magnitude and opposite phases, you'll get zero!

zero is the only bouncy number that doesn't actually bounce :(

so what's the deal with "bouncy" numbers?

well, they're the same thing as the complex numbers!

you can write a complex number as a+bi, but you can *also* write that same complex number as a magnitude and a phase. it's polar coordinates!

en.wikipedia.org/wiki/Polar_coo…

but still, why the bouncing?

usually, we visualize complex numbers in two dimensions: the real part as the horizontal axis, and the imaginary part as the vertical axis

the problem with the normal way is it that takes two dimensions to represent a single number!

a common use case for complex numbers is in linear algebra - where a vector has a complex number for each of several dimensions

for a regular, real-valued vector space, a vector is just an arrow pointing somewhere in space. it has a magnitude and a direction.

with "bouncy" numbers, we can get "bouncy" vectors!

a "bouncy" vector has a magnitude, a direction, *and* a phase.

you can take any real vector, make it "bounce" through the origin as if on an ideal spring (i.e. simple harmonic motion), and you now have a "bouncy" vector!

you can write a real vector using one number for each dimension as coordinates

same thing with bouncy vectors, but each dimension gets a bouncy number coordinate!

when you add two "bouncy" numbers, you always get another similar-looking "bouncy" number



that's not the case for "bouncy" vectors, though! you can get something different-looking than just a bounce along a straight line!

if you add two "bouncy" vectors that have different directions *and* different phases, you get something exciting

it's no longer a boring straight-line bounce - now it spins around the origin!

tangent: i was thinking about this "bouncy vector" thing in the middle of the night, and i asked @mousr8 what you would get if you added the blue and green vectors above (i wasnt sure) and she said "an ellipse!" and turns out all bouncy vectors are ellipses (line = flat ellipse)

another neat thing is that the projection of a bouncy vector is exactly what you think it'd be.

e.g. the vertical component of the circle above is the bouncing vertical "shadow," and the horizontal component is the bouncing horizontal "shadow"

if you don't have animation software available, you can still draw "bouncy" numbers and "bouncy" vectors.

just draw the path of the bounce, and put an arrow where the dot is at time t=0 (pointing in the direction it will travel)

you can use a 2d "bouncy" vector to represent a qubit!

i started thinking about this because i was upset that the bloch sphere didn't let me visualize the global phase (and it didn't seem at all straightforward to get to a 4-d complex qubit pair)

en.wikipedia.org/wiki/Bloch_sph…

ok this is it for now.

i wrote this up because i saw tim's "brain crack" tweet and this is what i thought of, so thanks tim!

I wanted to keep this thread formula-free, so it's not so scary for people with less math experience

but I will probably do a follow up thread soon with formulas

real quick tho, for those curious:
the "bouncy" animation for any complex z is just Re{ z * e^(it) } for t=[0,2π).

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling