utils#

Utilities

Functions

load_adj(filename)

Load the adjacent matrix with the given filename

load_sample(filename)

Load the sample data with the given filename

mem_to_chunksize(device, dtype)

Return the chunk size of vmap according to device free memory and dtype.

save_adj(filename, data)

Save the adjacent matrix with the given filename

save_sample(filename, data)

Save the sample data with the given filename

set_hbar(hbar)

Set the global reduced Planck constant.

set_kappa(kappa)

Set the global kappa.

set_perm_chunksize(device, dtype, chunksize)

Set the global chunk size for permanent calculations.

load_adj(filename)[source]#

Load the adjacent matrix with the given filename

load_sample(filename)[source]#

Load the sample data with the given filename

mem_to_chunksize(device: device, dtype: dtype) int | None[source]#

Return the chunk size of vmap according to device free memory and dtype.

Note

Currently only optimized for permanent and complex dtype.

save_adj(filename, data)[source]#

Save the adjacent matrix with the given filename

save_sample(filename, data)[source]#

Save the sample data with the given filename

set_hbar(hbar: float) None[source]#

Set the global reduced Planck constant.

set_kappa(kappa: float) None[source]#

Set the global kappa.

set_perm_chunksize(device: device, dtype: dtype, chunksize: int | None) None[source]#

Set the global chunk size for permanent calculations.