wilsonia / spins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spins Laboratory Simulation

This project is a re-write of Daniel V. Schroeder's spins laboratory simulation, which supplements the first three chapters of David McIntyre's introductory Quantum Mechanics textbook.

The program simulates the results of consecutive ideal measurements of electron spin. Mirroring the textbook, experimental setups are visualized as tree graphs with Stern-Gerlach analyzers as nodes. Experimental setups are configured by the student so that they may reckon with complementary physical variables. This simulation is a useful tool when using a spins-first approach to teaching quantum mechanics.

Demo

A live demo is available (work in progress).

Motivation

This re-write is an extension of my Bachelor's thesis research in Stern-Gerlach experiments and the consistent histories approach to quantum mechanics.

It accomplishes several goals:

  • Simplifies computation of probabilities by using the consistent histories approach
  • Increases readability of code
  • Imports/exports experiment configurations
  • Eliminates a counting error in Schroeder's simulation
  • Simplifies user interface
  • Updates tech stack

Stack

The simulation is written in Javascript adhering to the ES6 specification. The project uses node.js for development and dependency management and webpack for bundling the program for browser execution. Several packages were used to reduce code volume and simplify control flow:

Installing

  1. Install nodejs version >= v12.21.0
  2. Clone the project
git clone git@github.com:wilsonia/spins.git
  1. Navigate to the project and install dependencies
cd ./spins
npm install

Building and executing

  1. Bundle with webpack
npm run build
  1. Open index.html in a browser. You may need to allow CORS in Firefox.

mathjs

mathjs is cloned locally rather than installed via npm. This is so the maxSearchSize parameter may be increased for the matrix exponential approximation function expm. Unfortunately this parameter is not configurable, and increasing it is necessary for computing the magnet propagator.

TODO

  • Spin-1

About

License:Other


Languages

Language:JavaScript 97.1%Language:HTML 2.9%