QuadraticProgram.binary_var

QuadraticProgram.binary_var(name=None)[source]

Adds a binary variable to the quadratic program.

Parameters

name (Optional[str]) – The name of the variable.

Return type

Variable

Returns

The added variable.

Raises

QiskitOptimizationError – if the variable name is already occupied.