Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

qiskit.optimization.applications.ising.set_packing

set packing module

Functions

check_disjoint(sol, list_of_subsets)check disjoint
get_operator(list_of_subsets)Construct the Hamiltonian for the set packing.
get_solution(x)param xbinary string as numpy array.

check_disjoint

check_disjoint(sol, list_of_subsets)

GitHub

check disjoint

get_operator

get_operator(list_of_subsets)

GitHub

Construct the Hamiltonian for the set packing.

Notes

find the maximal number of subsets which are disjoint pairwise.

Hamiltonian: H = A Ha + B Hb Ha = sum_{Si and Sj overlaps}{XiXj} Hb = -sum_{i}{Xi}

Ha is to ensure the disjoint condition, while Hb is to achieve the maximal number. Ha is hard constraint that must be satisfied. Therefore A >> B. In the following, we set A=10 and B = 1

where Xi = (Zi + 1)/2

Parameters

list_of_subsets (list) – list of lists (i.e., subsets)

Returns

operator for the Hamiltonian,

a constant shift for the obj function.

Return type

tuple(WeightedPauliOperator, float)

get_solution

get_solution(x)

GitHub

Parameters

x (numpy.ndarray) – binary string as numpy array.

Returns

graph solution as binary numpy array.

Return type

numpy.ndarray

Was this page helpful?
Report a bug or request content on GitHub.