pybic.bin_mat

pybic.bin_mat(n)[source]

Creates array of all combinations of [+/-1, +/-1, ...].

Parameters:

n (int) – Number of indices.

Returns:

Output array.

Return type:

ndarray

Example

>>> bin_mat(2)
array([[ 1, -1],
       [ 1,  1]])
>>> bin_mat(4)
array([[ 1, -1, -1, -1],
       [ 1, -1, -1,  1],
       [ 1, -1,  1, -1],
       [ 1, -1,  1,  1],
       [ 1,  1, -1, -1],
       [ 1,  1, -1,  1],
       [ 1,  1,  1, -1],
       [ 1,  1,  1,  1]])