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. |
- 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 | ShotsPerGroup | None = None) None
Initialize orbital optimizer.
- Parameters:
estimator (Estimator) – The estimator to use in the cost function.
minimizer (Minimizer) – The minimizer to use in the orbital optimization algorithm.
mapper (Mapper | None) – Mapper to use for creating qubit operators.
shots (int | ShotsPerGroup | None) – Number of shots to use for the estimator.
- Return type:
None
- clear_cache() None
Clear the cache of the underlying estimator.
- Return type:
None
- gradient_norm(operator: FermionHermitianSum | PairedHardcoreBosonHermitianSum, circuit: Circuit) float | None
Compute the norm of the orbital-optimization gradient at zero rotation.
The method return None, as the
SimpleOrbitalOptimizerdoes not have an analytical gradient.- Parameters:
operator (FermionHermitianSum | PairedHardcoreBosonHermitianSum) – The operator whose expectation-value gradient should be computed.
circuit (Circuit) – The circuit ansatz with optimized parameters set.
- Return type:
float | 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:
- run_single_step(operator: T, circuit: Circuit) OrbitalOptimizerResult[T]
Perform a single, cheap orbital-optimization step.
- Parameters:
operator (T) – The operator whose expectation value should be minimized.
circuit (Circuit) – The circuit ansatz with optimized parameters set.
- Return type: