Model

class Model

Methods

__init__

__init__

copy

copy

get_variables

get_variables

to_intermediate_model

to_intermediate_model

to_unconstrained_poly

to_unconstrained_poly

Attributes

constraints

constraints property

objective

objective property

variables

alias of ~amplify.Model.get_variables

__add__(self, arg: Poly | Constraint | ConstraintList, /) Model

__add__

Parameters:

arg (Poly | Constraint | ConstraintList)

Return type:

Model

__eq__(self, arg: object, /) bool

__eq__

Parameters:

arg (object)

Return type:

bool

__iadd__(self, arg: Poly | Constraint | ConstraintList, /) Model

__iadd__

Parameters:

arg (Poly | Constraint | ConstraintList)

Return type:

Model

__init__(self) None
__init__(self, objective: Poly | Matrix) None
__init__(self, constraint: Constraint | ConstraintList) None
__init__(self, objective: Poly | Matrix, constraint: Constraint | ConstraintList) None

__init__

Overload 2.

Args:
  • objective (amplify.Poly | amplify.Matrix)

Overload 3.

Args:
  • constraint (amplify.Constraint | amplify.ConstraintList)

Overload 4.

Args:
  • objective (amplify.Poly | amplify.Matrix)

  • constraint (amplify.Constraint | amplify.ConstraintList)

__isub__(self, arg: Poly, /) Model

__isub__

Parameters:

arg (Poly)

Return type:

Model

__ne__(self, arg: object, /) bool

__ne__

Parameters:

arg (object)

Return type:

bool

__radd__(self, arg: Poly | Constraint | ConstraintList, /) Model

__radd__

Parameters:

arg (Poly | Constraint | ConstraintList)

Return type:

Model

__repr__(self) str

__repr__

Return type:

str

__str__(self) str

__str__

Return type:

str

__sub__(self, arg: Poly, /) Model

__sub__

Parameters:

arg (Poly)

Return type:

Model

copy(self) Model

copy

Return type:

Model

get_variables(self, with_penalty: bool = False) list[Variable]

get_variables

Parameters:

with_penalty (bool) – Defaults to False.

Return type:

list[Variable]

to_intermediate_model(
self,
acceptable_degrees: AcceptableDegrees,
integer_encoding_method: Literal['Unary', 'Linear', 'Binary', 'Default'] | IntegerEncodingMethod = IntegerEncodingMethod.Default,
real_encoding_method: Literal['Random4', 'Random8', 'Random16', 'Random32'] | RealEncodingMethod = RealEncodingMethod.Random16,
quadratization_method: Literal['IshikawaKZFD', 'Substitute'] | QuadratizationMethod = QuadratizationMethod.IshikawaKZFD,
substitution_multiplier: float = 1.0,
) tuple[Model, IntermediateMapping]

to_intermediate_model

Parameters:
  • acceptable_degrees (AcceptableDegrees)

  • integer_encoding_method (Literal['Unary', 'Linear', 'Binary', 'Default'] | amplify.IntegerEncodingMethod) – Defaults to IntegerEncodingMethod.Default.

  • real_encoding_method (Literal['Random4', 'Random8', 'Random16', 'Random32'] | amplify.RealEncodingMethod) – Defaults to RealEncodingMethod.Random16.

  • quadratization_method (Literal['IshikawaKZFD', 'Substitute'] | amplify.QuadratizationMethod) – Defaults to QuadratizationMethod.IshikawaKZFD.

  • substitution_multiplier (float) – Defaults to 1.0.

Return type:

tuple[Model, IntermediateMapping]

to_unconstrained_poly(self) Poly

to_unconstrained_poly

Return type:

Poly

property constraints

constraints property

Return type:

ConstraintList

property objective

objective property

Return type:

Poly | Matrix

property variables

alias of ~amplify.Model.get_variables

Return type:

list[Variable]