sf.backends.shared_ops.save_squeeze_factors

save_squeeze_factors(prefac, directory=None)[source]

Saves precomputed squeeze factors in the Fock basis to a file.

This function reshapes the rank-3 array with dimension \(D\times D\times D\) to a rank-2 array of dimension \(D^2\times D\), before converting it to a sparse array, and saving it to a file in the specified directory.

Parameters
  • prefac (numpy.array) – the Numpy array containing the precomputed squeeze prefactors in the Fock basis. Must be of size [D,D,D] for some integer D

  • directory (str) – location to save the precomputed beamsplitter factors. By default, this will be the Strawberry Fields data directory.