qiskit-documentation/docs/api/qiskit/0.26/qiskit.aqua.algorithms.Clas...

79 lines
4.2 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: ClassicalCPLEX (v0.26)
description: API reference for qiskit.aqua.algorithms.ClassicalCPLEX in qiskit v0.26
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.aqua.algorithms.ClassicalCPLEX
---
<span id="qiskit-aqua-algorithms-classicalcplex" />
# qiskit.aqua.algorithms.ClassicalCPLEX
<Class id="qiskit.aqua.algorithms.ClassicalCPLEX" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.9/qiskit/aqua/algorithms/minimum_eigen_solvers/cplex/classical_cplex.py" signature="ClassicalCPLEX(operator, timelimit=600, thread=1, display=2)" modifiers="class">
The Classical CPLEX algorithm (classical).
This algorithm uses the IBM ILOG CPLEX Optimization Studio along with its separately installed Python API to solve optimization problems modeled as an Ising Hamiltonian.
See these `installation instructions` if you need more information in that regard.
**Parameters**
* **operator** (`WeightedPauliOperator`) The Ising Hamiltonian as an Operator
* **timelimit** (`int`) A time limit in seconds for the execution
* **thread** (`int`) The number of threads that CPLEX uses. Setting this 0 lets CPLEX decide the number of threads to allocate, but this may not be ideal for small problems for which the default of 1 is more suitable.
* **display** (`int`) Decides what CPLEX reports to the screen and records in a log during mixed integer optimization. This value must be between 0 and 5 where the amount of information displayed increases with increasing values of this parameter.
### \_\_init\_\_
<Function id="qiskit.aqua.algorithms.ClassicalCPLEX.__init__" signature="__init__(operator, timelimit=600, thread=1, display=2)">
**Parameters**
* **operator** (`WeightedPauliOperator`) The Ising Hamiltonian as an Operator
* **timelimit** (`int`) A time limit in seconds for the execution
* **thread** (`int`) The number of threads that CPLEX uses. Setting this 0 lets CPLEX decide the number of threads to allocate, but this may not be ideal for small problems for which the default of 1 is more suitable.
* **display** (`int`) Decides what CPLEX reports to the screen and records in a log during mixed integer optimization. This value must be between 0 and 5 where the amount of information displayed increases with increasing values of this parameter.
</Function>
## Methods
| | |
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| [`__init__`](#qiskit.aqua.algorithms.ClassicalCPLEX.__init__ "qiskit.aqua.algorithms.ClassicalCPLEX.__init__")(operator\[, timelimit, thread, display]) | **type operator**`WeightedPauliOperator` |
| [`run`](#qiskit.aqua.algorithms.ClassicalCPLEX.run "qiskit.aqua.algorithms.ClassicalCPLEX.run")() | Execute the classical algorithm. |
## Attributes
| | |
| -------------------------------------------------------------------------------------------------------------- | ---------------------- |
| [`random`](#qiskit.aqua.algorithms.ClassicalCPLEX.random "qiskit.aqua.algorithms.ClassicalCPLEX.random") | Return a numpy random. |
| [`solution`](#qiskit.aqua.algorithms.ClassicalCPLEX.solution "qiskit.aqua.algorithms.ClassicalCPLEX.solution") | return solution |
### random
<Attribute id="qiskit.aqua.algorithms.ClassicalCPLEX.random">
Return a numpy random.
</Attribute>
### run
<Function id="qiskit.aqua.algorithms.ClassicalCPLEX.run" signature="run()">
Execute the classical algorithm.
**Returns**
results of an algorithm.
**Return type**
dict
</Function>
### solution
<Attribute id="qiskit.aqua.algorithms.ClassicalCPLEX.solution">
return solution
</Attribute>
</Class>