def search(
        self,
        trace_func: Callable[[list[LineSequence], float, float, float, bool], None] | None = None,
    ) -> list[LineSequence]:
        """Issues new linear sequence search.

        Each call to this method starts new search.

        Args:
          trace_func: Optional callable which will be called for each simulated
            annealing step with arguments: solution candidate (list of linear
            sequences on the chip), current temperature (float), candidate cost
            (float), probability of accepting candidate (float), and acceptance
            decision (boolean).

        Returns:
          List of linear sequences on the chip found by this method.
        """

        def search_trace(
            state: _STATE, temp: float, cost: float, probability: float, accepted: bool
        ):
            if trace_func:
                trace_seqs, _ = state
                trace_func(trace_seqs, temp, cost, probability, accepted)

        seqs, _ = optimization.anneal_minimize(
            self._create_initial_solution(),
            self._quadratic_sum_cost,
            self._force_edges_active_move,
            self._rand.random_sample,
            trace_func=search_trace,
        )
        return seqs
Issues new linear sequence search.

        Each call to this method starts new search.

        Args:
          trace_func: Optional callable which will be called for each simulated
            annealing step with arguments: solution candidate (list of linear
            sequences on the chip), current temperature (float), candidate cost
            (float), probability of accepting candidate (float), and acceptance
            decision (boolean).

        Returns:
          List of linear sequences on the chip found by this method.
        
cirq-google/cirq_google/line/placement/anneal.py