Skip to content

dq.quadrature

quadrature(dim: int, phi: float) -> Array

Returns the quadrature operator of phase angle \(\phi\).

It is defined by \(x_\phi = (e^{i\phi} a^\dag + e^{-i\phi} a) / 2\), where \(a\) and \(a^\dag\) are the annihilation and creation operators respectively.

Parameters

  • dim –

    Dimension of the Hilbert space.

  • phi –

    Phase angle.

Returns

(array of shape (dim, dim)) Quadrature operator.

Examples

>>> dq.quadrature(3, 0.0)
Array([[0.   +0.j, 0.5  +0.j, 0.   +0.j],
       [0.5  +0.j, 0.   +0.j, 0.707+0.j],
       [0.   +0.j, 0.707+0.j, 0.   +0.j]], dtype=complex64)
>>> dq.quadrature(3, jnp.pi / 2)
Array([[ 0.+0.j   , -0.-0.5j  ,  0.+0.j   ],
       [-0.+0.5j  ,  0.+0.j   , -0.-0.707j],
       [ 0.+0.j   , -0.+0.707j,  0.+0.j   ]], dtype=complex64)