dwave.optimization.mathematical.minimum#
- minimum(*args, **kwargs)[source]#
Return an element-wise minimum of the given symbols.
In the underlying directed acyclic expression graph, produces a
Minimum
node if two array nodes are provided and aNaryMinimum
node otherwise.- Returns:
A symbol that is the element-wise minimum of the given symbols.
Examples
This example minimizes two integer symbols of size \(1 \times 2\).
>>> from dwave.optimization import Model >>> from dwave.optimization.mathematical import minimum ... >>> model = Model() >>> i = model.integer(2) >>> j = model.integer(2) >>> m = minimum(i, j) >>> with model.lock(): ... model.states.resize(1) ... i.set_state(0, [3, 5]) ... j.set_state(0, [7, 2]) ... print(m.state(0)) [3. 2.]