/ concept-collection / numbl-quantum-optics
Sign in
concept-collection / numbl-quantum-optics
numbl-quantum-optics / ex01_number_states.m
10 lines · 514 BBlameHistoryRaw
1% Number states (Sec. II.A)
2% A number state |n> is a column of the identity matrix: the (n+1)th column.
4clear; % Clear memory
5clc; % Clear the command window/screen
6d = 5; % dimension of the field
7I = eye(d); % Identity matrix of dimension d
8Vacuum = I(:,1) % First column of identity matrix: vacuum state |0>
9Ket1 = I(:,2) % Second column of identity matrix: single-photon state |1>
10Ket2 = I(:,3) % Third column of identity matrix: two-photon state |2>
moveopenescclose