concept-collection / numbl-quantum-optics
numbl-quantum-optics / ex02_number_state_20.m
8 lines · 385 BBlameHistoryRaw
1% Higher number state |20> (Sec. II.A)
2% To represent |n>, the field dimension d must be larger than n.
4clear; % Clear memory
5clc; % Clear the command window/screen
6d = 21; % dimension of the field (must exceed 20)
7I = eye(d); % Identity matrix of dimension d
8Ket20 = I(:,21) % number state |20>: 21st column of the identity matrix