pychemiq.Optimizer#

Module Contents#

Functions#

pychemiq.Optimizer.vqe_solver(method='NELDER-MEAD', ansatz=None, pauli=None, init_para=None, chemiq=None, Learning_rate=0.1, Xatol=0.0001, Fatol=0.0001, MaxFCalls=200, MaxIter=200)#

This class is a VQE solver, which requires specifying the classical optimizer method, ansatz, molecular Pauli Hamiltonian, initial parameter, and chemiq class in the parameters.

Parameters:
  • method (str) – Specify the classic optimizer method. Currently, pyChemiQ supports methods such as NELDER-MEAD, POWERLL, COBYLA, L-BFGS-B, SLSQP, and Gradient-Descent. If not specified, the NELDER-MEAD optimizer is used by default.

  • ansatz (AbstractAnsatz) – Specify the proposed class. Please refer to pychemiq.Circuit.Ansatz for details.

  • pauli (PauliOperator) – The Pauli Hamiltonian of the specified molecule. Pauli operator class. Please refer to pychemiq.PauliOperator for details.

  • init_para (list[float]) – Specify initial parameters.

  • chemiq (ChemiQ) – Specify the chemiq class. Please refer to pychemiq.ChemiQ for details.

  • Learning_rate (float) – Specify the learning rate. This parameter is required to select the optimizer method related to gradients. The default is 0.1.

  • Xatol (float) – The convergence threshold of the variable. The default is 0.0001.

  • Fatol (float) – The convergence threshold of the function value. The default is 0.0001.

  • MaxFCalls (int) – The maximum number of times a function can be called. The default is 200.

  • MaxIter (int) – Maximum number of optimization iterations. The default is 200.

Returns:

QOptimizationResult class. for detail: pyqpanda.QOptimizationResult

Note

For more examples of optimizers and calling external scipy. optimize libraries to achieve classic optimization, please refer to Optimizer Tutorial in the advanced tutorial