/ concept-collection / numbl-quantum-optics
Sign in
concept-collection / numbl-quantum-optics
numbl-quantum-optics / ex14_g2_coherence.m
38 lines · 1.4 KBCodeBlameHistory
21c62a3Quantum optics in numbl: companion to arXiv:2309.14354Jeremy Magland 1% Zero time-delay second-order coherence function g^(2)(0) (Sec. IV.C)
2% g2(0) = <a'^2 a^2> / <a'a>^2
3% Number state |n>: 1 - 1/n (sub-Poissonian); coherent: 1; thermal: 2.
5clear; % Clear memory
6clc; % Clear the command window/screen
7d = 25; % dimension of the field
8I = eye(d); % identity matrix
9A = diag(sqrt(1:d-1), 1); % Annihilation operator
10Ad = A'; % Creation operator
11AdA = Ad*A; % Number operator
12Ad2A2 = Ad*Ad*A*A; % a'^2 a^2
14%% Number state |4>
15Ket4 = I(:,5); % four-photon state |4>
16AdANumber = Ket4'*AdA*Ket4;
17Ad2A2Number = Ket4'*Ad2A2*Ket4;
18g2Number = Ad2A2Number/(AdANumber)^2 % g2(0) for number state (= 1 - 1/4 = 0.75)
20%% Coherent state
21alpha = sqrt(3); % amplitude of the coherent state
22Coh = 0; % initialization
23for x = 0:d-1
24 Coh = Coh + exp(-norm(alpha)^2/2)*alpha^x/sqrt(prod(1:x))*I(:,x+1);
25end
26AdACoherent = Coh'*AdA*Coh;
27Ad2A2Coherent = Coh'*Ad2A2*Coh;
28g2Coherent = Ad2A2Coherent/(AdACoherent)^2 % g2(0) for coherent state (= 1)
30%%% Thermal state
31nth = 0.85; % average number of photons in the thermal state
32RhoTh = 0;
33for x = 0:d-1
34 RhoTh = RhoTh + nth^(x)/(1+nth)^(x+1)*I(:,x+1)*I(:,x+1)';
35end
36AdAThermal = trace(AdA*RhoTh);
37Ad2A2Thermal = trace(Ad2A2*RhoTh);
38g2Thermal = Ad2A2Thermal/(AdAThermal)^2 % g2(0) for thermal state (= 2)
moveopenescclose