% States of a two-level atom (Sec. II.G) % Excited |e> and ground |g> states as 2-dimensional column vectors, and a % normalized superposition |psi> = alpha|e> + beta|g>, |alpha|^2+|beta|^2 = 1. clear; % Clear memory clc; % Clear the command window/screen es = [1;0] % excited state |e> gs = [0;1] % ground state |g> alpha = sqrt(0.4); % superposition coefficient beta = sqrt(0.6); % superposition coefficient Psi = alpha*es + beta*gs % superposition state (norm = 1)