qiskit.optimization.applications.ising.set_packing¶
set packing module
Functions
|
check disjoint |
|
Construct the Hamiltonian for the set packing. |
|
|
- get_operator(list_of_subsets)[source]¶
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)