sf.ops.LossChannel

class LossChannel(T)[source]

Bases: strawberryfields.ops.Channel

Perform a loss channel operation on the specified mode.

This channel couples mode \(\a\) to another bosonic mode \(\hat{b}\) prepared in the vacuum state using the following transformation:

\[\a \mapsto \sqrt{T} a+\sqrt{1-T} \hat{b}\]
Parameters

T (float) – the loss parameter \(0\leq T\leq 1\).

Loss is implemented by a CPTP map whose Kraus representation is

\[\mathcal{N}(T)\left\{\ \cdot \ \right\} = \sum_{n=0}^{\infty} E_n(T) \ \cdot \ E_n(T)^\dagger , \quad E_n(T) = \left(\frac{1-T}{T} \right)^{n/2} \frac{\a^n}{\sqrt{n!}} \left(\sqrt{T}\right)^{\ad \a}\]

Definition

Loss is implemented by coupling mode \(\a\) to another bosonic mode \(\hat{b}\) prepared in the vacuum state, by using the following transformation

\[\a \to \sqrt{T} \a+\sqrt{1-T} \hat{b}\]

and then tracing it out. Here, \(T\) is the energy transmissivity. For \(T = 0\) the state is mapped to the vacuum state, and for \(T=1\) one has the identity map.

One useful identity is

\[\mathcal{N}(T)\left\{\ket{n}\bra{m} \right\}=\sum_{l=0}^{\min(n,m)} \left(\frac{1-T}{T}\right)^l \frac{T^{(n+m)/2}}{l!} \sqrt{\frac{n! m!}{(n-l)!(m-l)!}} \ket{n-l}\bra{m-l}\]

In particular \(\mathcal{N}(T)\left\{\ket{0}\bra{0} \right\} = \pr{0}\).

measurement_deps

Extra dependencies due to parameters that depend on measurements.

ns

measurement_deps

Extra dependencies due to parameters that depend on measurements.

Returns

dependencies

Return type

set[RegRef]

ns = 1

apply(reg, backend, **kwargs)

Ask a local backend to execute the operation on the current register state right away.

decompose(reg, **kwargs)

Decompose the operation into elementary operations supported by the backend API.

merge(other)

Merge the operation with another (acting on the exact same set of subsystems).

apply(reg, backend, **kwargs)

Ask a local backend to execute the operation on the current register state right away.

Takes care of parameter evaluations and any pending formal transformations (like dagger) and then calls Operation._apply().

Parameters
  • reg (Sequence[RegRef]) – subsystem(s) the operation is acting on

  • backend (BaseBackend) – backend to execute the operation

Returns

the result of self._apply

Return type

Any

decompose(reg, **kwargs)

Decompose the operation into elementary operations supported by the backend API.

See strawberryfields.backends.base.

Parameters

reg (Sequence[RegRef]) – subsystems the operation is acting on

Returns

decomposition as a list of operations acting on specific subsystems

Return type

list[Command]

merge(other)

Merge the operation with another (acting on the exact same set of subsystems).

Note

For subclass overrides: merge may return a newly created object, or self, or other, but it must never modify self or other because the same Operation objects may be also used elsewhere.

Parameters

other (Operation) – operation to merge this one with

Returns

other * self. The return value None represents the identity gate (doing nothing).

Return type

Operation, None

Raises

MergeFailure – if the two operations cannot be merged