# sf.utils.cat_state¶

cat_state(a, p=0, fock_dim=5)[source]

Returns the cat state

$|cat\rangle = \frac{1}{\sqrt{2(1+e^{-2|\alpha|^2}\cos(\phi))}} \left(|\alpha\rangle +e^{i\phi}|-\alpha\rangle\right)$

with the even cat state given for $$\phi=0$$, and the odd cat state given for $$\phi=\pi$$.

Parameters
• a (complex) – the displacement

• p (float) – parity, where $$\phi=p\pi$$. p=0 corresponds to an even cat state, and p=1 an odd cat state

• fock_dim (int) – the size of the truncated Fock basis

Returns

the cat state

Return type

array