Objective function(s) (qiskit_addon_aqc_tensor.objective
)¶
Code for building and evaluating objective functions used for AQC parameter optimization.
Currently, this module provides the simplest possible objective function, OneMinusFidelity
.
- class OneMinusFidelity(target, ansatz, settings)[source][source]¶
Bases:
object
Simplest possible objective function for use with AQC-Tensor.
Its definition is given by Eq. (7) in arXiv:2301.08609v6:
\[C = 1 - \left| \langle 0 | V^{\dagger}(\vec\theta) | \psi_\mathrm{target} \rangle \right|^2 .\]Minimizing this function is equivalent to maximizing the pure-state fidelity between the state prepared by the ansatz circuit at the current parameter point,(\(V(\vec\theta) |0\rangle\), and the target state, \(| \psi_\mathrm{target} \rangle\).
When called with an
ndarray
of parameters, this object will return(objective_value, gradient)
as atuple[float, numpy.ndarray]
.Initialize the objective function.
- Parameters:
ansatz (
QuantumCircuit
) – Parametrized ansatz circuit.target (
TensorNetworkState
) – Target state in tensor-network representation.settings (
TensorNetworkSimulationSettings
) – Tensor network simulation settings.
- property target: TensorNetworkState¶
Target tensor network.