sf.decompositions

Warning

Unless you are a Strawberry Fields developer, you likely do not need to use these functions directly.

See the decomposition operations for details on embedding states, graphs, and unitaries within a photonic quantum circuit.

This module implements common shared matrix decompositions that are used to perform gate decompositions.

Functions

T(m, n, theta, phi, nmax)

The Clements T matrix from Eq 1 of the paper

Ti(m, n, theta, phi, nmax)

The inverse Clements T matrix

bipartite_graph_embed(A[, …])

Embed a bipartite graph into a Gaussian state.

bloch_messiah(S[, tol, rounding])

Bloch-Messiah decomposition of a symplectic matrix.

covmat_to_hamil(V[, tol])

Converts a covariance matrix to a Hamiltonian.

graph_embed(A[, mean_photon_per_mode, …])

Embed a graph into a Gaussian state.

graph_embed_deprecated(A[, max_mean_photon, …])

Embed a graph into a Gaussian state.

hamil_to_covmat(H[, tol])

Converts a Hamiltonian matrix to a covariance matrix.

mach_zehnder(m, n, internal_phase, …)

A two-mode Mach-Zehnder interferometer section.

mach_zehnder_inv(m, n, phi_int, phi_ext, nmax)

The inverse of the Mach-Zehnder unitary matrix.

nullMZ(n, m, U)

Nullifies element n,m of U using mach_zehnder.

nullMZi(m, n, U)

Nullifies element m,n of U using mach_zehnder_inv.

nullT(n, m, U)

Nullifies element n,m of U using T

nullTi(m, n, U)

Nullifies element m,n of U using Ti

rectangular(V[, tol])

Rectangular decomposition of a unitary matrix, with local phase shifts applied between two interferometers.

rectangular_MZ(V[, tol])

Rectangular decomposition of a unitary matrix, with local phase shifts applied between two interferometers.

rectangular_phase_end(V[, tol])

Rectangular decomposition of a unitary matrix, with all local phase shifts placed after the interferometers.

rectangular_symmetric(V[, tol])

Decomposition of a unitary into an array of symmetric beamsplitters.

takagi(N[, tol, rounding])

Autonne-Takagi decomposition of a complex symmetric (not Hermitian!) matrix.

triangular(V[, tol])

Triangular decomposition of a unitary matrix due to Reck et al.

williamson(V[, tol])

Williamson decomposition of positive-definite (real) symmetric matrix.