dq.cd_gate
cd_gate(dim: int, alpha: ArrayLike) -> QArray
Returns a conditional displacement gate.
The conditional displacement (CD) gate displaces an oscillator conditioned on
the state of a coupled two-level system (TLS) state. It is defined by
$$
\mathrm{CD}(\alpha) = D(\alpha/2)\ket{g}\bra{g} + D(-\alpha/2)\ket{e}\bra{e},
$$
where \(\ket{g}\) (defined by dq.ground()
) and \(\ket{e}\)
(defined by dq.excited()
) are the ground and excited states of
the TLS.
Parameters
-
dim
–
Dimension of the oscillator Hilbert space.
-
alpha
(array-like of shape (...))
–
Displacement amplitude.
Returns
(qarray of shape (..., n, n)) CD gate operator (acting on the oscillator + TLS system of dimension n = 2 x dim).
Examples
>>> dq.cd_gate(2, 0.1)
QArray: shape=(4, 4), dims=(2, 2), dtype=complex64, layout=dense
[[ 0.999+0.j 0. +0.j 0.05 +0.j 0. +0.j]
[ 0. +0.j 0.999+0.j 0. +0.j -0.05 +0.j]
[-0.05 +0.j 0. +0.j 0.999+0.j 0. +0.j]
[ 0. +0.j 0.05 +0.j 0. +0.j 0.999+0.j]]
>>> dq.cd_gate(3, [0.1, 0.2]).shape
(2, 6, 6)