[1]:
import quanguru as qg
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as tck
import random as rn

Squeezed Vacuum#

[2]:
vacuumState = qg.basis(40, 0)
alphaReal = 0.5*rn.random()
alphaImag = 0.5*rn.random()
theta1 = 2*np.pi*rn.random()
alpha = (alphaReal+(alphaImag*1j))*(np.e**(theta1*1j))
squeezeOp = qg.squeeze(alpha, 40)
squeezedVacuum = squeezeOp @ vacuumState
[3]:
phaseSpace = np.arange(-4, 4.1, 0.1)
wignerFunc = qg.Wigner(squeezedVacuum, phaseSpace)
[4]:
fig, ax = plt.subplots(figsize=(8, 6))

x, y = np.meshgrid(phaseSpace, phaseSpace)
ax.pcolormesh(y, x, wignerFunc)
ax.plot(phaseSpace, [0 for i in phaseSpace], color='silver', linestyle="--", linewidth='0.75')
ax.plot([0 for i in phaseSpace], phaseSpace, color='silver', linestyle="--", linewidth='0.75')

ax.set_xticks([-4, -3, -2, -1, 0, 1, 2, 3, 4])
ax.set_yticks([-4, -3, -2, -1, 0, 1, 2, 3, 4])

ax.yaxis.set_minor_locator(tck.AutoMinorLocator())
ax.xaxis.set_minor_locator(tck.AutoMinorLocator())

ax.tick_params(direction='out', which='both')
ax.tick_params(bottom=True, top=True, left=True, right=True, which='both')

ax.tick_params(length=4, width=1.25)
ax.tick_params(length=2, width=1.25, which='minor')

for axis in ['top','bottom','left','right']:
    ax.spines[axis].set_linewidth(1.5)
plt.show()
../../_images/QuantumToolbox_Tutorials_3_squeezeOperator_4_0.png
[ ]: