sorry @eduumorenoo, I was actually mistaken. The "Maximum Gain" algorithm does return the optimum phases and amplitudes.

The "Max Realized Gain Weights" output of the algorithm shows the optimum phases and amplitudes, as 2d fields of the form phases(theta, phi) and amplitudes(theta, phi).

Just to clarify: the "maximum gain" tool shows what Gain could be achieved in each direction, but it does not show what the radiation pattern would look like. It is a "pointwise" maximization algorithm, in the sense that the best-case Gain is computed for each direction (theta, phi) independently. So the 3D pattern you see from the "maximum gain" tool is the **envelope** of all possible Gain patterns. And the "Max Realized Gain Weights(theta, phi)" is a N-dimensional vector with the complex weights (amplitude * exp(1j*phase)) of all N independent elements that achieves the maximum gain **in direction (theta, phi)**.

As for the "generic" optimizer in Sim4Life, it is a general-purpose tool and allows you to define your own objective function - as an analytical function of quantities computed by the postprocessing pipeline. There are several tutorials for the Optimizer, in case you want to know more.