modules.solvers.qaoa.train

train(device: AwsDevice, options: dict, p: int, ising: ndarray, n_qubits: int, n_shots: int, opt_method: str, tracker: dict, s3_folder: tuple[str, str], verbose: bool = True) tuple[float, ndarray, dict]

Function to run QAOA algorithm for given, fixed circuit depth p.

Parameters:
  • device -- Device to run the circuit on

  • options -- Dict containing parameters of classical part of the QAOA

  • p -- Circuit depth

  • ising -- Ising matrix

  • n_qubits -- Number of qubits

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

  • opt_method -- Controls degree of detail in logs

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

  • s3_folder -- AWS S3 bucket

  • verbose -- Controls degree of detail in logs

Returns:

Results of the training as a tuple of the energy, the angle and the tracker