Azure Quantum Optimization squared linear combination terms
SlcTerm
from azure.quantum.optimization import Term, SlcTerm, GroupType
Some optimization problems bear cost functions with grouped terms, which are represented by objects composed of multiple Terms. Currently, the azure-quantum Python package supports squared linear combination terms as grouped term objects using the SlcTerm class.
Constructor
To create an SlcTerm object, specify the following parameters:
terms: The list of monomial terms that make up the squared linear combination term argument. Each element of this list should be aTermobject.c: The lead coefficient.
For instance, the squared linear combination term $2 (x_1 + 3x_2 - x_3 - 1)^2$ translates to the following object:
SlcTerm(
terms=[
Term(c=1, indices=[1]),
Term(c=3, indices=[2]),
Term(c=-1, indices=[3]),
Term(c=-1, indices=[]),
],
c=2
)
Or, the term $3 (x_0 - 1)^2$ translates to the following object:
SlcTerm(
terms=[
Term(c=1, indices=[0]),
Term(c=-1, indices=[]),
],
c=3
)
Constraints on Input
For squared linear combination terms there are two main constraints on input:
- In the
termslist, each term must be linear or constant. That is, eachTermmust have anindicesargument with a length of at most 1. - Among the
termslist, like-terms must be combined before input. That is, there may not be multiple terms having the sameindicesargument within a given squared linear combination term.
For more information on cost functions and how terms relate to a problem definition, see the following topics:
Availability
SlcTerm objects are currently supported by the following Microsoft QIO solvers:
- Parallel Tempering (CPU)
- Population Annealing (CPU)
- Quantum Monte Carlo (CPU)
- Simulated Annealing (CPU)
- Substochastic Monte Carlo (CPU)
- Tabu Search (CPU)
If you submit problems with grouped term objects to a solver that doesn't support them, a client error will appear in the SDK and the submission will fail.
If you discover any bugs or issues while working with SlcTerms, please reach out to Azure Support.
Povratne informacije
Pošalјite i prikažite povratne informacije za