<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Emi</title>
    <description>The latest articles on DEV Community by Emi (@bytefluxlab).</description>
    <link>https://dev.to/bytefluxlab</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3838526%2F5abe4c10-7082-4588-9999-97922663f59d.jpeg</url>
      <title>DEV Community: Emi</title>
      <link>https://dev.to/bytefluxlab</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bytefluxlab"/>
    <language>en</language>
    <item>
      <title>The Particle That Walks Through Walls — And Why Your Phone Depends On It</title>
      <dc:creator>Emi</dc:creator>
      <pubDate>Mon, 23 Mar 2026 17:31:16 +0000</pubDate>
      <link>https://dev.to/bytefluxlab/the-particle-that-walks-through-walls-and-why-your-phone-depends-on-it-53ij</link>
      <guid>https://dev.to/bytefluxlab/the-particle-that-walks-through-walls-and-why-your-phone-depends-on-it-53ij</guid>
      <description>&lt;p&gt;Imagine throwing a ball at a wall.&lt;br&gt;
The ball doesn't have enough energy to climb over the wall.&lt;br&gt;
So it bounces back. Obviously. Every time. This is not a controversial statement.&lt;br&gt;
Now imagine the ball is an electron.&lt;br&gt;
Sometimes it goes through the wall anyway.&lt;br&gt;
Not over. Not around. Through the wall itself.&lt;br&gt;
This is quantum tunneling. It is not science fiction. It is not a metaphor. It is a measurable, reproducible physical phenomenon — and it is happening right now, billions of times per second, inside the device you are reading this on.&lt;/p&gt;

&lt;p&gt;The wall is a probability, not a fact&lt;br&gt;
In classical physics, a particle either has enough energy to cross a barrier or it doesn't. The wall is real. The outcome is certain.&lt;br&gt;
In quantum mechanics, nothing is certain until it is measured.&lt;br&gt;
A particle exists as a wave function — a mathematical object that encodes the probability of finding the particle at every point in space. This wave function doesn't stop at barriers. It penetrates them. It decays exponentially inside the barrier — but if the barrier is thin enough, the wave function emerges on the other side with a non-zero value.&lt;br&gt;
Non-zero value means non-zero probability.&lt;br&gt;
Non-zero probability means: sometimes, the particle is on the other side.&lt;br&gt;
That's it. That's the whole trick.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F433bjlh5v6217rwyw31i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F433bjlh5v6217rwyw31i.png" alt=" " width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;"The wave function approaching the barrier."&lt;/p&gt;

&lt;p&gt;How thin is thin enough?&lt;br&gt;
The transmission probability follows an exponential law:&lt;br&gt;
T ≈ e^(-2κL)&lt;br&gt;
Where L is the barrier width and κ depends on how much energy the particle is missing.&lt;br&gt;
The exponential means: double the barrier width, and the probability doesn't halve — it drops by orders of magnitude. This is why tunneling only matters at atomic scales. A tennis ball tunneling through a wall has a probability so small it would take longer than the age of the universe to observe it once.&lt;br&gt;
But electrons are light. And in modern transistors, the barrier layers are only a few nanometers thick.&lt;br&gt;
At that scale, tunneling is not a rare event. It is routine.&lt;/p&gt;

&lt;p&gt;The Sun is powered by the impossible&lt;br&gt;
Here is something that should bother you.&lt;br&gt;
The core of the Sun is hot — around 15 million degrees. But even at that temperature, protons don't have enough kinetic energy to overcome the electromagnetic repulsion between them and fuse.&lt;br&gt;
The Sun should not be able to fuse hydrogen. The nuclear reactions that power it should not be happening.&lt;br&gt;
And yet they are.&lt;br&gt;
The protons tunnel through the Coulomb barrier. The probability is small — any given pair of protons will almost certainly bounce off each other. But there are an incomprehensible number of protons in the Sun's core, and they're colliding constantly.&lt;br&gt;
The Sun shines because of quantum tunneling.&lt;/p&gt;

&lt;p&gt;I built a simulation&lt;br&gt;
I wanted to understand this more concretely. So I solved the time-dependent Schrödinger equation numerically — the equation that describes how wave functions evolve — and built an interactive simulation.&lt;br&gt;
You fire a wave packet at a barrier. You watch it hit. Part of it reflects. Part of it — a small, eerie part — appears on the other side.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4i9mkkigqcsytjea7yy5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4i9mkkigqcsytjea7yy5.png" alt=" " width="800" height="361"&gt;&lt;/a&gt;&lt;br&gt;
"Reflected wave (left) and tunneled wave (right). Same particle. Same barrier."&lt;/p&gt;

&lt;p&gt;The simulation lets you change the barrier height and width in real time. Increase the barrier — the tunneled wave shrinks. Make it thinner — it grows. The exponential relationship is visible directly.&lt;br&gt;
What I found is that building this forced me to confront something I had glossed over when reading about tunneling: the wave function doesn't "try" to get through and sometimes succeed. The wave function is everywhere simultaneously, including inside and beyond the barrier. The question is not whether it penetrates — it always does. The question is how much of it makes it through.&lt;br&gt;
The particle isn't sneaking through a gap in the wall. The wall was never as solid as it appeared.&lt;/p&gt;

&lt;p&gt;What this means for your phone&lt;br&gt;
Modern transistors — the switches that perform every computation in every processor — work by controlling electron flow through thin semiconductor layers.&lt;br&gt;
As transistors have gotten smaller, quantum tunneling has become a serious engineering problem. When the insulating layers are only a few atoms thick, electrons tunnel through them even when they're supposed to be blocked. This creates leakage current, wastes energy, and generates heat.&lt;br&gt;
Every processor generation, engineers have to work harder to manage tunneling effects that classical physics said shouldn't exist.&lt;br&gt;
The quantum weirdness that powers the Sun is also the quantum weirdness that limits how small your phone's chip can get.&lt;/p&gt;

&lt;p&gt;The deeper strangeness&lt;br&gt;
There is something about tunneling that I keep thinking about.&lt;br&gt;
The particle doesn't "go through" the wall in any classical sense. It doesn't drill a hole. It doesn't find a weak spot. The wave function simply extends beyond the barrier, and there is a probability of finding the particle there.&lt;br&gt;
What is the particle doing while it's "inside" the barrier?&lt;br&gt;
According to standard quantum mechanics — nothing. The question is meaningless. The particle doesn't have a trajectory. It has a wave function. And the wave function is doing exactly what wave functions do: spreading, decaying, emerging.&lt;br&gt;
The wall was never a wall. It was always a probability gradient.&lt;br&gt;
And that is strange enough to be worth sitting with.&lt;/p&gt;

&lt;p&gt;Try it yourself&lt;br&gt;
🔗 Live demo: &lt;a href="https://emineugurlu.github.io/double-slit-simulation/" rel="noopener noreferrer"&gt;https://emineugurlu.github.io/double-slit-simulation/&lt;/a&gt;&lt;br&gt;
💻 GitHub: &lt;a href="https://github.com/emineugurlu/double-slit-simulation" rel="noopener noreferrer"&gt;https://github.com/emineugurlu/double-slit-simulation&lt;/a&gt;&lt;br&gt;
Fire a wave packet. Watch it tunnel. Adjust the sliders. The physics is real — the numbers come from the actual Schrödinger equation.&lt;/p&gt;

&lt;p&gt;The series so far&lt;/p&gt;

&lt;p&gt;✅ Double-Slit Experiment — wave-particle duality&lt;br&gt;
✅ Wave Interference — the physics behind the fringes&lt;br&gt;
✅ Quantum Tunneling — particles through walls&lt;/p&gt;

&lt;p&gt;Next: Schrödinger's Equation — visualizing the wave function in a potential well.&lt;/p&gt;

&lt;p&gt;Your phone works because electrons do the impossible. The Sun shines because protons do the impossible. We built civilization on quantum weirdness we still don't fully understand. I think that's extraordinary.&lt;/p&gt;

&lt;p&gt;Non-zero value means non-zero probability.&lt;br&gt;
Non-zero probability means: sometimes, the particle is on the other side.&lt;br&gt;
That's it. That's the whole trick.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>simulation</category>
      <category>physics</category>
      <category>quantum</category>
    </item>
    <item>
      <title>"I Built a Quantum Physics Simulator in JavaScript — And It Broke My Brain"</title>
      <dc:creator>Emi</dc:creator>
      <pubDate>Sun, 22 Mar 2026 16:36:48 +0000</pubDate>
      <link>https://dev.to/bytefluxlab/i-built-a-quantum-physics-simulator-in-javascript-and-it-broke-my-brain-3h5l</link>
      <guid>https://dev.to/bytefluxlab/i-built-a-quantum-physics-simulator-in-javascript-and-it-broke-my-brain-3h5l</guid>
      <description>&lt;h1&gt;
  
  
  I Built a Quantum Physics Simulator in JavaScript — And It Broke My Brain
&lt;/h1&gt;

&lt;p&gt;I'm going to tell you something strange.&lt;/p&gt;

&lt;p&gt;An electron can pass through two holes at the same time.&lt;/p&gt;

&lt;p&gt;Not metaphorically. Not "as if it does." Physically, literally, through both holes simultaneously.&lt;/p&gt;

&lt;p&gt;And I wrote a simulation to prove it.&lt;/p&gt;




&lt;h2&gt;
  
  
  You've heard of this experiment. You probably got it wrong.
&lt;/h2&gt;

&lt;p&gt;The double-slit experiment is usually described like this: "Electrons behave like waves."&lt;/p&gt;

&lt;p&gt;Okay. But what does that actually mean?&lt;/p&gt;

&lt;p&gt;It means: fire an electron. Let it pass through two slits. Look at the screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Expected:&lt;/strong&gt; two bands.&lt;br&gt;
&lt;strong&gt;Reality:&lt;/strong&gt; dozens of thin stripes. An interference pattern.&lt;/p&gt;

&lt;p&gt;Fine. Wave behavior. Got it.&lt;/p&gt;

&lt;p&gt;But here's the part that actually matters.&lt;/p&gt;

&lt;p&gt;Fire electrons &lt;strong&gt;one at a time&lt;/strong&gt;. One electron. Wait. Another. Wait.&lt;/p&gt;

&lt;p&gt;After hundreds of electrons — look at the screen.&lt;/p&gt;

&lt;p&gt;The interference pattern is still there.&lt;/p&gt;

&lt;p&gt;A single electron interfered with itself.&lt;/p&gt;

&lt;p&gt;Then turn on the detector — just to see which slit it went through.&lt;/p&gt;

&lt;p&gt;The interference pattern vanishes. Instantly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The act of looking changed the result.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F46xofygnooumgtjfx4wi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F46xofygnooumgtjfx4wi.png" alt=" " width="800" height="362"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Coding Made It Click
&lt;/h2&gt;

&lt;p&gt;To compute the interference pattern, you need this formula:&lt;/p&gt;

&lt;p&gt;I(y) = (ψ1 + ψ2)^2&lt;/p&gt;

&lt;p&gt;Add first, then square. The order matters.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add first → both waves interact → interference happens&lt;/li&gt;
&lt;li&gt;Square first → each slit is independent → no interference&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the simulation, for each pixel we compute:&lt;/p&gt;

&lt;p&gt;ψ = A · e^(-(Δy²) / (2σ²)) · e^(i · 2πr / λ)&lt;/p&gt;

&lt;p&gt;When physicists say "the electron passes through both slits at once," this is exactly what they mean mathematically. ψ₁ and ψ₂ exist simultaneously and interact.&lt;/p&gt;

&lt;p&gt;I only truly understood this when I had to write it in code.&lt;/p&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;For each electron, I do two things.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Compute where it will land:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;computeScreenIntensity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;slits&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;re&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;im&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;slits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;slit&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;L&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;L&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;slit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;phase&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PI&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;lambda&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;envelope&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dy&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;dy&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;sigma&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;sigma&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="nx"&gt;re&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;envelope&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;phase&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;im&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;envelope&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;phase&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;re&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;re&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;im&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;im&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// |ψ|² — probability density&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;ψ₁ + ψ₂ interaction produces interference. High value = electron lands here more often.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;2. Sample from that probability (rejection sampling):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;random&lt;/span&gt; &lt;span class="nx"&gt;point&lt;/span&gt;
  &lt;span class="nx"&gt;prob&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;computeIntensity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;maxIntensity&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;prob&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The electron doesn't land randomly. It lands &lt;em&gt;probabilistically&lt;/em&gt; — guided by the wave function.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The pattern doesn't appear instantly. Each electron adds one dot. After hundreds of hits, the interference pattern slowly emerges — exactly like the real experiment.&lt;/p&gt;




&lt;h2&gt;
  
  
  One Line of Code Kills the Pattern
&lt;/h2&gt;

&lt;p&gt;When the detector is on, the code does one thing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;activeSlits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;slits&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Only one slit is active. ψ₁ + ψ₂ becomes just ψ₁. No interaction. No interference.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The pattern disappears — not because of some mysterious quantum magic, but because the math changes.&lt;/p&gt;

&lt;p&gt;Both amplitudes need to be present at the same time for interference to exist. Remove one. Pattern gone.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2ipvyq82jq124pe58qm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2ipvyq82jq124pe58qm.png" alt=" " width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;"Left: detector off (wave). Right: detector on (particle)."&lt;/p&gt;




&lt;h2&gt;
  
  
  The Question That Has No Answer
&lt;/h2&gt;

&lt;p&gt;Okay. The detector turns on, the pattern disappears. Why?&lt;/p&gt;

&lt;p&gt;Physics says: "The wave function collapsed."&lt;/p&gt;

&lt;p&gt;But &lt;em&gt;why&lt;/em&gt; did it collapse?&lt;/p&gt;

&lt;p&gt;This is where physicists still disagree — loudly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Copenhagen:&lt;/strong&gt; Before measurement, position didn't exist. Now it does. Don't ask why.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bohm:&lt;/strong&gt; The electron always had a position. An invisible pilot wave was guiding it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Many Worlds:&lt;/strong&gt; The wave function never collapsed. The universe split in two. You're living in one branch.&lt;/p&gt;

&lt;p&gt;Which one is correct?&lt;/p&gt;

&lt;p&gt;Nobody knows.&lt;/p&gt;

&lt;p&gt;And I think the absence of an answer is more interesting than any answer could be.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Wave Interference Simulation
&lt;/h2&gt;

&lt;p&gt;To make the physics behind the double-slit visible, I built a second simulation.&lt;/p&gt;

&lt;p&gt;Two point sources. Waves spreading outward. They meet and interfere.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;phase&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PI&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;lambda&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;time&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;total&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;phase&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// superposition of two waves&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;time&lt;/code&gt; increases every frame — waves animate. Green = constructive. Pink = destructive.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Each slit in the double-slit experiment &lt;em&gt;is&lt;/em&gt; a wave source. The fringes you see on the screen are exactly what two interfering waves produce.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhiq75bm7anb4cs2axz4q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhiq75bm7anb4cs2axz4q.png" alt=" " width="800" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;"Wave interference simulation — two sources, infinite patterns."&lt;/p&gt;

&lt;p&gt;The wave interference simulation makes this intuitive in a way that equations never could.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;

&lt;p&gt;🔗 &lt;strong&gt;Live demo:&lt;/strong&gt; &lt;a href="https://emineugurlu.github.io/double-slit-simulation/" rel="noopener noreferrer"&gt;https://emineugurlu.github.io/double-slit-simulation/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;💻 &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/emineugurlu/double-slit-simulation" rel="noopener noreferrer"&gt;https://github.com/emineugurlu/double-slit-simulation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Toggle the detector. Watch the pattern collapse.&lt;/p&gt;

&lt;p&gt;Drag the detector strength slider slowly — watch the pattern fade gradually. That's &lt;strong&gt;decoherence&lt;/strong&gt; in real time.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;Quantum tunneling is coming — a particle passing through a barrier it classically has no right to cross.&lt;/p&gt;

&lt;p&gt;The phenomenon that makes modern electronics possible.&lt;/p&gt;

&lt;p&gt;If you want to see it when it drops — follow me here. I'll be building it the same way: physics first, then code, then simulation.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If this made you think, or if you want to argue about interpretations of quantum mechanics — drop a comment. I'm here for it.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>simulation</category>
      <category>quantum</category>
      <category>physics</category>
    </item>
  </channel>
</rss>
