qrisp.vqe.VQEProblem.run#
- VQEProblem.run(qarg, depth, mes_kwargs={}, max_iter=50, init_type='random', init_point=None, optimizer='COBYLA', options={})[source]#
Run VQE for the specific problem instance.
- Parameters:
- qargQuantumVariable or callable
The argument to which the VQE circuit is applied, or a function returning a QuantumVariable to which the VQE circuit is applied.
- depthint
The amount of VQE ansatz layers.
- mes_kwargsdict, optional
The keyword arguments for the
expectation_value
function. Default is an empty dictionary. By default, the targetprecision
is set to 0.01. Precision refers to how accurately the Hamiltonian is evaluated. The number of shots the backend performs per iteration scales quadratically with the inverse precision.- max_iterint, optional
The maximum number of iterations for the optimization method. Default is 50.
- init_typestring, optional
Specifies the way the initial optimization parameters are chosen. Available is
random
. The default israndom
: Parameters are initialized uniformly at random in the interval \([0,\pi/2)]\).- init_pointndarray, shape (n,), optional
Specifies the initial optimization parameters.
- optimizerstr, optional
Specifies the SciPy optimization routine. Available are, e.g.,
COBYLA
,COBYQA
,Nelder-Mead
. The Default isCOBYLA
. In tracing mode (i.e. Jasp) Jax-traceable optimization routines must be utilized. Available areCOBYLA
,SPSA
.- optionsdict
A dictionary of solver options.
- Returns:
- float or jax.Array
The expectation value of the Hamiltonian after applying the optimal VQE circuit to the quantum argument.