QuadraticProgram.continuous_var_list¶
- QuadraticProgram.continuous_var_list(keys, lowerbound=0, upperbound=1e+20, name=None, key_format='{}')[source]¶
Uses ‘var_list’ to construct a list of continuous variables
- Parameters:
lowerbound (
Union
[float
,int
]) – The lower bound of the variable(s).upperbound (
Union
[float
,int
]) – The upper bound of the variable(s).name (
Optional
[str
]) – The name(s) of the variable(s). If it’sNone
or empty""
, the default name, e.g.,x0
, is used.key_format (
str
) – The format used to name/index the variable(s).keys (
Union
[int
,Sequence
]) – If keys: int, it is interpreted as the number of variables to construct. Otherwise, the elements of the sequence are converted to strings via ‘str’ and substituted into key_format.
- Return type:
- Returns:
A list of variable instances.
- Raises:
QiskitOptimizationError – if the variable name is already taken.
QiskitOptimizationError – if less than one variable instantiation is attempted.
QiskitOptimizationError – if key_format has more than one substitution or a nested substitution.