@@ -403,33 +403,16 @@ def generate_relaxation(self,
403403 self .monomials = self .monomials [1 :]
404404 self .n_vars -= 1
405405 self .moments = self .monomials
406- # assert np.array_equal(list(_compmonomial_to_idx.values()), np.arange(len(self.monomials))), "Something went wrong with monomial initialization."
407406 old_num_vars = self .n_vars
408407 self .n_vars = len (self .monomials )
409408 self .first_free_idx = first_free_index
410409 if self .n_vars < old_num_vars :
411410 if self .verbose > 0 :
412411 eprint ("Further variable reduction has been made possible. Number of variables in the SDP:" ,
413412 self .n_vars )
414- # self.compmoment_from_idx = dict(zip(range(self.n_vars), monomials_as_list))
415- # self.compmoment_to_idx = dict(zip(monomials_as_list, range(self.n_vars)))
416413 del _compmonomial_to_idx
417414 collect (generation = 2 )
418415
419- # self.compmoment_from_idx = dict()
420- # if self.momentmatrix_has_a_zero:
421- # self.compmoment_from_idx[0] = self.Zero
422- # for (idx, lexmon) in tqdm(self.symmetrized_corresp.items(),
423- # disable=not self.verbose,
424- # desc="Initializing monomials "):
425- # self.compmoment_from_idx[idx] = self.Moment_1d(lexmon, idx)
426- # self.first_free_idx = max(self.compmoment_from_idx.keys()) + 1
427- # self.moments = list(self.compmoment_from_idx.values())
428- # self.monomials = list(self.compmoment_from_idx.values())
429- #
430- # assert all(v == 1 for v in Counter(self.monomials).values()), \
431- # "Multiple indices are being associated to the same monomial"
432-
433416 _counter = Counter ([mon .knowability_status for mon in self .moments ])
434417 self .n_knowable = _counter ["Knowable" ]
435418 self .n_something_knowable = _counter ["Semi" ]
0 commit comments