dq.cd_gate
cd_gate(dim: int, alpha: ArrayLike) -> Array
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}=\ket0\) and \(\ket{e}=\ket1\) are the ground and excited states of the TLS, respectively.
Parameters
-
dim
–
Dimension of the oscillator Hilbert space.
-
alpha
(array_like of shape (...))
–
Displacement amplitude.
Returns
(array 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)
Array([[ 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]], dtype=complex64)
>>> dq.cd_gate(3, [0.1, 0.2]).shape
(2, 6, 6)