save_bs_factors(prefac, directory=None)[source]

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

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

  • prefac (numpy.array) – the Numpy array containing the precomputed beamsplitter prefactors in the Fock basis. Must be of size [D,D,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.