qrunch.quantum.algorithms.second_quantization.orbital_optimizers.simple_orbital_optimizer
Module containing the simple orbital optimizer.
Classes
An orbital optimizer using a simple cost function and any Minimizer to perform the optimization. |
|
Creator for the orbital optimizer algorithm. |
- class SimpleOrbitalOptimizer
Bases:
OrbitalOptimizerAlgorithmAn orbital optimizer using a simple cost function and any Minimizer to perform the optimization.
- __init__(estimator: Estimator, minimizer: Minimizer, mapper: Mapper | None = None, shots: int | None = None) None
Initialize orbital optimizer.
- Parameters:
- Return type:
None
- clear_cache() None
Clear the cache of the underlying estimator.
- Return type:
None
- run(operator: T, circuit: Circuit) OrbitalOptimizerResult[T]
Run the orbital optimization and find the eigenvalue.
The orbital optimizer rotates the observable so that the expectation value is minimized.
- Parameters:
operator (T) – The operator whose expectation value should be minimized.
circuit (Circuit) – The parametrized circuit to find optimal parameters for. Should contain unspecified parameters.
callback – An optional callback function that is called at each minimizer iteration.
- Return type:
- class SimpleOrbitalOptimizerCreator
Bases:
objectCreator for the orbital optimizer algorithm.
- __init__() None
Initialize builder for the orbital optimizer.
- Return type:
None
- choose_minimizer() MinimizerSubCreator[Self]
Choose minimizer to use for the orbital optimizer.
- Return type:
MinimizerSubCreator[Self]
- create() SimpleOrbitalOptimizer
Create an instance of
SimpleOrbitalOptimizer.- Return type:
- with_estimator(estimator: Estimator) SimpleOrbitalOptimizerCreator
Set the estimator to use for the orbital optimizer.
- Parameters:
estimator (Estimator) – Estimator to use. Can be created using the
estimator_creator()builder.- Return type:
- with_shots(shots: int | None) SimpleOrbitalOptimizerCreator
Set the number of shots to use when calling the estimator.
- Parameters:
shots (int | None) – Number of shots to use in the estimator. If None is given, the estimator is assumed to be exact (e.g. the excitation gate simulator).
- Return type: