English
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.algorithms.PVQD.get_loss

PVQD.get_loss(hamiltonian, ansatz, dt, current_parameters)[source]

Get a function to evaluate the infidelity between Trotter step and ansatz.

Parameters
  • hamiltonian (BaseOperator | PauliSumOp) – The Hamiltonian under which to evolve.

  • ansatz (QuantumCircuit) – The parameterized quantum circuit which attempts to approximate the time-evolved state.

  • dt (float) – The time step.

  • current_parameters (np.ndarray) – The current parameters.

Returns

A callable to evaluate the infidelity and, if gradients are supported and required,

a second callable to evaluate the gradient of the infidelity.

Return type

tuple[Callable[[np.ndarray], float], Callable[[np.ndarray], np.ndarray]] | None