sf.decompositions.graph_embed

graph_embed(A, mean_photon_per_mode=1.0, make_traceless=False, rtol=1e-05, atol=1e-08)[source]

Embed a graph into a Gaussian state.

Given a graph in terms of a symmetric adjacency matrix (in general with arbitrary complex entries), returns the squeezing parameters and interferometer necessary for creating the Gaussian state whose off-diagonal parts are proportional to that matrix.

Uses takagi().

Parameters
  • A (array[complex]) – square, symmetric (weighted) adjacency matrix of the graph

  • mean_photon_per_mode (float) – guarantees that the mean photon number in the pure Gaussian state representing the graph satisfies \(\frac{1}{N}\sum_{i=1}^N sinh(r_{i})^2 ==\) :code:mean_photon

  • make_traceless (bool) – Removes the trace of the input matrix, by performing the transformation \(\tilde{A} = A-\mathrm{tr}(A) \I/n\). This may reduce the amount of squeezing needed to encode the graph but will lead to different photon number statistics for events with more than one photon in any mode.

  • rtol (float) – relative tolerance used when checking if the input matrix is symmetric

  • atol (float) – absolute tolerance used when checking if the input matrix is symmetric

Returns

squeezing parameters of the input state to the interferometer, and the unitary matrix representing the interferometer

Return type

tuple[array, array]