Bengali
ভাষাসমূহ
English
Bengali
Japanese
Spanish



QuadraticProgram.substitute_variables

QuadraticProgram.substitute_variables(constants=None, variables=None)[source]

Substitutes variables with constants or other variables.

প্যারামিটার:
  • constants (Dict[int | str, float] | None) -- replace variable by constant e.g., {'x': 2} means x is substituted with 2

  • variables (Dict[str | int, Tuple[str | int, float]] | None) -- replace variables by weighted other variable need to copy everything using name reference to make sure that indices are matched correctly. The lower and upper bounds are updated accordingly. e.g., {'x': ('y', 2)} means x is substituted with y * 2

রিটার্নস:

An optimization problem by substituting variables with constants or other variables. If the substitution is valid, QuadraticProgram.status is still QuadraticProgram.Status.VALID. Otherwise, it gets QuadraticProgram.Status.INFEASIBLE.

রেইজেস:

QiskitOptimizationError -- if the substitution is invalid as follows. - Same variable is substituted multiple times. - Coefficient of variable substitution is zero.

রিটার্ন টাইপ:

QuadraticProgram