The applet on this page uses the Bloch sphere to visualize the evolution of a quantum twolevel system whose Hamiltonian is
 (1) 
In this expression, σ is a “lowering” operator given by σ = (σ_{x}  iσ_{y})∕2, and σ^{†} = (σ_{x} + iσ_{y})∕2. The operators σ_{x}, σ_{y} and σ_{z} are given by the Pauli matrices. The constant Δ is entered in the “detuning” ﬁeld below, and the “Rabi frequency” Ω(t) is an arbitrary complex function that is entered below also in the appropriate ﬁeld.

The ﬁelds labeled “Phi” and “Theta” are used to specify the initial state as a point on the surface of the Bloch sphere. The constant “π” can be entered as “Pi” in any ﬁeld. The imaginary unit i can be entered as a plain lowercase “i”. Any algebraic expression involving these constants and ordinary functions such as trigonometric and hyperbolic functions is acceptable in the Rabi frequency ﬁeld (only note that the “time” variable must be called “t”). There is also a function “rect(t)” that is deﬁned as 1 for 1∕2 ≤ t ≤ 1∕2 and zero elsewhere, which can be used to represent “square” pulses.
In addition to the Hamiltonian evolution given by (1), phenomenological damping constants Gamma1 and Gamma2 (corresponding to 1∕T_{1} and 1∕T_{2}, respectively) may also be speciﬁed. Note that one must always have Gamma2≥Gamma1/2, or else unphysical trajectories will result.
To be precise, if the expectation values of σ_{x}, σ_{y}, σ_{z} are written as x, y, z, corresponding to the coordinates in the Bloch sphere plot, the equations being integrated are
The equations (2)(4) are called the Bloch equations. They were ﬁrst introduced in the context of nuclear magnetic resonance (NMR), where they give the evolution of a spin (elementary magnetic moment) in a combined static magnetic ﬁeld along the z axis and a radiofrequency ﬁeld in the xy plane. In this case the quantity Ω(t) is proportional to the slowlyvarying complex amplitude of the rf ﬁeld, and the Bloch vector represents the actual orientation of the spin in space (only perhaps in a rotating frame of reference).
The same equations can be used to describe a “twolevel atom” with energy levels and in a nearresonant laser ﬁeld, and in this case Ω(t) is proportional to the slowlyvarying complex amplitude of the laser ﬁeld. For the twolevel atom, the projection of the Bloch vector onto the z axis is a measure of the average energy (with the zero of energy chosen to be exactly halfway between the two levels), and its projection onto the x  y plane gives the amplitude and phase of the atom’s electric dipole moment.