sf.ops.MeasureHeterodyne¶
-
class
MeasureHeterodyne(select=None)[source]¶ Bases:
strawberryfields.ops.MeasurementPerforms a heterodyne measurement on a mode.
Also accessible via the shortcut variable
MeasureHD.Samples the joint Husimi distribution \(Q(\vec{\alpha}) = \frac{1}{\pi}\bra{\vec{\alpha}}\rho\ket{\vec{\alpha}}\). The measured mode is reset to the vacuum state.
Warning
The heterodyne measurement can only be performed in the Gaussian or Bosonic backends.
- Parameters
select (None, complex) – (Optional) desired values of measurement result. Allows the post-selection of specific measurement results instead of randomly sampling.
Details and Conventions
Definition
Heterodyne measurement is a Gaussian projective measurement given by projecting the state onto the coherent states,
\[\frac{1}{\pi} \ket{\alpha}\bra{\alpha}\]Attributes
Extra dependencies due to parameters that depend on measurements.
-
measurement_deps¶ Extra dependencies due to parameters that depend on measurements.
- Returns
dependencies
- Return type
set[RegRef]
-
ns= 1¶
Methods
apply(reg, backend, **kwargs)Ask a 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 backend to execute the operation on the current register state right away.
Like
Operation.apply(), but also stores the measurement result in the RegRefs.- Keyword Arguments
shots (int) – Number of independent evaluations to perform. Only applies to Measurements.
-
decompose(reg, **kwargs)¶ Decompose the operation into elementary operations supported by the backend API.
See
strawberryfields.backends.base.
-
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