dwave.optimization.mathematical.logical_not#

logical_not(x: ArraySymbol) Not[source]#

Return an element-wise logical NOT on the given symbol.

Parameters:

x – Input array symbol.

Returns:

A symbol that propagates the element-wise NOT of the given symbol.

Examples

This example negates an array symbol.

>>> from dwave.optimization import Model
>>> from dwave.optimization.mathematical import logical_not
...
>>> model = Model()
>>> x = model.constant([0, 1, -2, .5])
>>> not_x = logical_not(x)
>>> model.states.resize(1)
>>> with model.lock():
...     print(not_x.state())
[1. 0. 0. 0.]

See also

Not: equivalent symbol.