Skip to content

Vtype

Bases: Enum

Enumeration of variable types supported by the optimization system.

This enum defines the type of a variable used in a model. The type influences the domain and behavior of the variable during optimization. It is often passed when defining variables to specify how they should behave.

Attributes:

Name Type Description
Real Vtype

Continuous real-valued variable. Can take any value within given bounds.

Integer Vtype

Discrete integer-valued variable. Takes integer values within bounds.

Binary Vtype

Binary variable. Can only take values 0 or 1.

Spin Vtype

Spin variable. Can only take values -1 or +1.

Examples:

>>> from luna_quantum import Vtype
>>> Vtype.Real
Real
>>> str(Vtype.Binary)
'Binary'

Binary class-attribute instance-attribute

Binary = ...

Binary variable. Can only take values 0 or 1.

Integer class-attribute instance-attribute

Integer = ...

Discrete integer-valued variable. Takes integer values within bounds.

Real class-attribute instance-attribute

Real = ...

Continuous real-valued variable. Can take any value within given bounds.

Spin class-attribute instance-attribute

Spin = ...

Spin variable. Can only take values -1 or +1.