21c62a3Quantum optics in numbl: companion to arXiv:2309.14354Jeremy Magland 1% Squeezed vacuum state (Sec. II.E)
2% |xi> = 1/sqrt(cosh r) * sum_n (-1)^n sqrt((2n)!)/(2^n n!) e^{i n theta} (tanh r)^n |2n>
3% A superposition of the even number states only.
5clear; % Clear memory
6clc; % Clear the command window/screen
7d = 20;
8I = eye(d);
9r = 0.3; % squeezing parameter
10theta = pi/4; % squeezing direction
11Sqz = 0; % initialization
12for x = 0:(d/2)-1
13 p = (1/sqrt(cosh(r)))*sqrt(prod(1:(2*x)))/(2^x*prod(1:x));
14 Sqz = Sqz + p*(-1)^x*exp(i*x*theta)*(tanh(r))^x*I(:,2*x+1);
15end
16Sqz % squeezed vacuum state output
17N_sqz = norm(Sqz) % check norm (should be 1)