@@ -139,7 +139,7 @@ length(all_independent_sets_tree)
139139
140140collect (all_independent_sets_tree)
141141
142- # To save/ read a set of configuration to disk, one can type the following
142+ # One can use [`save_configs`](@ref) and [`load_configs`](@ref) to save and read a set of configuration to disk.
143143filename = tempname ()
144144
145145save_configs (filename, all_independent_sets; format= :binary )
@@ -150,6 +150,21 @@ loaded_sets = load_configs(filename; format=:binary, bitlength=10)
150150# When loading data, one needs to provide the `bitlength` if the data is saved in binary format.
151151# Because the bitstring length is not stored.
152152
153+ # To loading configurations from file in the `:binary` format in python.
154+ # We suggest using the following script to unpack the data correctly.
155+ # ```python
156+ # import numpy as np
157+ #
158+ # def loadfile(filename:str, bitlength:int):
159+ # C = int(np.ceil(bitlength / 64))
160+ # arr = np.fromfile(filename, dtype="uint8")
161+ # # Some axes should be transformed from big endian to little endian
162+ # res = np.unpackbits(arr).reshape(-1, C, 8, 8)[:,::-1,::-1,:].reshape(-1, C*64)[:, :(64*C-bitlength)-1:-1]
163+ # print("number of configurations = %d"%(len(res)))
164+ # return res # in big endian format
165+ #
166+ # res = loadfile(filename, 10)
167+
153168# !!! note
154169# Check section [Maximal independent set problem](@ref) for examples of finding graph properties related to minimum sizes:
155170# * [`SizeMin`](@ref) for enumerating minimum set size,
0 commit comments