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. If it’sNone
or empty""
, the default name, e.g.,x0
, is used.- Return type:
- Returns:
The added variable.
- Raises:
QiskitOptimizationError – if the variable name is already occupied.