modules.solvers.qaoa.objective_function

objective_function(params: array, device: AwsDevice, ising: ndarray, n_qubits: int, n_shots: int, tracker: dict, s3_folder: tuple[str, str], verbose: bool) float

Objective function takes a list of variational parameters as input, and returns the cost associated with those parameters.

Parameters:
  • params -- Array containing beta and gamma parameters

  • device -- Device to run the circuit on

  • ising -- Ising matrix

  • n_qubits -- Number of qubits

  • n_shots -- Number of measurements to make on the circuit

  • tracker -- Keeps track of the runs on the circuit

  • s3_folder -- AWS S3 bucket

  • verbose -- Controls degree of detail in logs

Returns:

Energy expectation value